Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you use Python for both front end and back end using Django framework? [closed]

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?

like image 300
Beginner Programmer Avatar asked Sep 02 '17 18:09

Beginner Programmer


1 Answers

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.

like image 152
d2718nis Avatar answered Oct 16 '22 07:10

d2718nis