This is a very simple project built with PyScript and Django.
Django on the backend side, and Pyscript as the frontend.
The main idea of the video is to show how to use only Python both for backend and frontend.
I wanted to show how to make AJAX (asynchoronous) GET and POST requests with Pyscript to Django project, and how to manipulate DOM with Pyscript.
The frontend of the project is written with Pyscript. When i'm clicking on the green button ... Pyscript sends a GET request to my Flask application and gets a random number from 1 to 10...
When I click on a card... Pyscript sends a POST request to the Django app and gets the float version of the sent numbers.
And again the video is about how to use Pyscript to send GET and POST requests to Flask, and how use Pyscript to manipulate with DOM.
Follow me @:
Telegram: https://t.me/red_eyed_coder_club
Twitter: / codereyed
Facebook: https://fb.me/redeyedcoderclub
=== 📎 The source code is available via Patreon ===
/ 68004987
Timecodes:
00:00 - Demo and description of the Pyscript Django project, attaching Python module to HTML template.
01:09 - Description of the basic Django project.
02:21 - Adding PyScript to Django project as a static file
03:40 - Basic example of DOM manipulations with PyScript (Pyscript onclick event handler and event listener).
06:20 - Sending GET requests with PyScript, using of pyfetch() to send requests to Django (frontend, PyScript side)
13:24 - Accepting a GET request from PyScript (backend, Django side)
15:04 - Checking a request's headers to determine AJAX request
16:15 - Sending POST request with PyScript to Django (frontend, PyScript side)
20:32 - Accepting a POST request from PyScript on Django side
23:02 - Using CSRF token with Pyscript
24:33 - Passing CSRF token with headers to Django
24:49 - Refactoring of header's definition
** Other Django Tutorials **
Django CSRF tokens from cookies: • Django CSRF Token Tutorial: Getting CSRF t...
Deploy Django on server: • Django Deployment: How to deploy Django ap...
Deploy Django on PythonAnyWhere: • PythonAnyWhere Django Deployment: How to d...
PyScript and Django: Basic PyScript Frontend and DOM manipulations | PyScript tutorial
• PyScript and Django: Basic PyScript Fronte...
#pyscript #django #redeyedcoderclub
On this page of the site you can watch the video online PyScript and Django: Basic PyScript Frontend and DOM manipulations | PyScript tutorial with a duration of hours minute second in good quality, which was uploaded by the user Red Eyed Coder Club 03 June 2022, share the link with friends and acquaintances, this video has already been watched 6,049 times on youtube and it was liked by 158 viewers. Enjoy your viewing!