PyScript and Django: Basic PyScript Frontend and DOM manipulations | PyScript tutorial

Red Eyed Coder Club
Red Eyed Coder Club
5.7 هزار بار بازدید - 2 سال پیش - This is a very simple
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: t.me/red_eyed_coder_club Twitter: twitter.com/CoderEyed Facebook: fb.me/redeyedcoderclub === 📎 The source code is available via Patreon === www.patreon.com/posts/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 C...   Deploy Django on server:    • Django Deployment: How to deploy Djan...   Deploy Django on PythonAnyWhere:    • PythonAnyWhere Django Deployment: How...   PyScript and Django: Basic PyScript Frontend and DOM manipulations | PyScript tutorial    • PyScript and Django: Basic PyScript F...   #pyscript #django #redeyedcoderclub
2 سال پیش در تاریخ 1401/03/13 منتشر شده است.
5,724 بـار بازدید شده
... بیشتر