I'm watching the udemy Django tutorial that requires using JavaScript as the front-end and Python for the back-end:
Can you replace JavaScript with Python?
What are the advantages and disadvantages of that?
As others already said, basically you can't use Python at the front-end. You can use Django Template Language or something like Jinja2 in your templates, but generally speaking these engines run on your server, not in the browser.
Actually, you can use Python to write the code, that runs in the browser, using transpilers like Transcrypt. But I don't recommend you to do such a thing on a real project because of raising complexity and difference between these two languages. The only advantage would be that you can use one language to write both front-end and back-end. But the complexity of supporting this code will not worth it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With