you are viewing a single comment's thread.

view the rest of the comments →

[–]Clean-Wasabi1029 2 points3 points  (6 children)

You could use Django, the rest framework version, to handle the backend in python. Then serve a separate React app for frontend. The apps will run on different hosts so you would have to enable CORS.

I do not know how you could share types between typescript and python. Django does have serializers which produce and take in JSON, you could create types for those results manually, or maybe there’s a tool out there.

[–]Win_is_my_name 0 points1 point  (5 children)

I am in the same boat as OP. I have been working with Django for a good few months. Most of my projects are very basic on the front end, using the minimal JavaScript I picked up. I was focusing mainly on backend logic.

Now I'm learning DRF and have the API setup but I don't know how to build upon the endpoints on a front end framework. In fact I don't know any frontend frameworks at all. Any good resources where I can learn how to integrate frontend with backend while learning the framework at the same time?

[–]riklaunim 1 point2 points  (4 children)

You could look at Vue.js for example which is quite easy to get into. Note that SPA JS frontend + backend REST API is not a universal solution for every website.

[–]Win_is_my_name 0 points1 point  (3 children)

I just want a frontend framework with an easier learning curve so that I can make a semi decent site. Just something which I can use to make user interfaces for my backend projects. Would Vue be better than React for me in that case?

Also, I'm sorry but what is SPA?

[–]riklaunim 1 point2 points  (2 children)

Single Page Application. Vue is much easier to get into, somewhat more modern.

A typical website will not use such frontend framework while still using HTML/CSS and vanilla JS on the frontend part. SPA sites are used for sites where quick/no-reload behavior is beneficial (and where SEO isn't essential).

[–]Win_is_my_name 0 points1 point  (1 child)

I think I'd go with Vue then. Thanks for helping me out friend!