What video should I make next? Any suggestions? Follow me @: Telegram: t.me/red_eyed_coder_club Twitter: twitter.com/CoderEyed Facebook: fb.me/redeyedcoderclub 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
@j13512092 жыл бұрын
pyscript + fastapi
@RedEyedCoderClub2 жыл бұрын
@@j1351209 Got it! Thanks for your suggestion!
@pranav86182 жыл бұрын
can u make complete tutorial about pyscript how to manipulate dom and submit data using pyscript
@RedEyedCoderClub2 жыл бұрын
@@pranav8618 of course I will continue!
@RedEyedCoderClub2 жыл бұрын
@@pranav8618 some examples of DOM manipulations you want to see will be appreciated.
@abrikosa7172 жыл бұрын
Very interesting! Thank you!
@RedEyedCoderClub2 жыл бұрын
Thanks for watching!
@hidalgodonquijote69552 жыл бұрын
Олег, спасибо за познавательный туториал. Планируете ли вернуться на свой русскоязычный канал?
@RedEyedCoderClub2 жыл бұрын
Спасибо. Если будут работать VISA и MasterCard с иностранными банками, то да, я вернусь.
@shivamrohilla2082 жыл бұрын
Can we submit the forms and add validations in the form through pyscript ?
@RedEyedCoderClub2 жыл бұрын
Of course! We can submit forms the same way we do it with JQuery or Vue.js. Do you want a video about it?
@shivamrohilla2082 жыл бұрын
@@RedEyedCoderClub yes why not 😇, please make these type of videos I mean real videos, so we can use them in our real projects ❤️
@RedEyedCoderClub2 жыл бұрын
Ok, got it! But probably it won't be soon
@shivamrohilla2082 жыл бұрын
@@RedEyedCoderClub I’ll wait
@RedEyedCoderClub2 жыл бұрын
Ok, wrote your suggestion down
@najmulsharifworld3 ай бұрын
hi boss , how to import the document under the function ? def on_click(e): ul = document.getElementById('left') ul.innerHTML = 'Hello world'
@felix30ua2 жыл бұрын
у тебя там f-string, тогда f"I got: {number:.1f}", без float 😉
@RedEyedCoderClub2 жыл бұрын
Верно! Я так сделал для очевидности и наглядности. Не нужно было ничего объяснять лишний раз, т.к. и так затянул видос.
@CabraBRGamer2 жыл бұрын
First off all, thank you so much for this very interesting post. My code before response = await make_request(... is not running and I dont know how to fix it. Any help would be wellcome. Tks async def submit_form(e): msg = document.querySelector('#msg') city_input = document.querySelector('#cityInput') city = city_input.value body = json.dumps({'name': city}) response = await make_request(url='/', method='POST', body=body) msg.innerHTML = response if response.get('errors'): city_input.classList.add('is-invalid') else: city_input.classList = 'form-control is-valid' p = document.createElement('p') p.innerHTML = 'Criado elemento ' + response['name'] ul = document.getElementById('cities') li = document.createElement('li') li.innerHTML = response['name'] ul.appendChild(li)
@RedEyedCoderClub2 жыл бұрын
What doesn't mean not running? What errors shows you Python? And what errors shows you Javascrtipt? You can find the output in Inspector > Console tab
@CabraBRGamer2 жыл бұрын
@@RedEyedCoderClub tks for read. No error shown! Simply lines after await make_request() seems to be ignored. Putting This aside, rest of the codé Works fine. For insntance, city is written on city.models and so on 🤔