Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
172 views
in Technique[技术] by (71.8m points)

python - Do i need to manipulate DRF if only im using the built-in template django system?

I have some troubles understanding Django and DRF, if for instance I want to integrate a frontend framework along with Django, do I really need to use Django itself or will I touch DRF; and in the other hand, if I use the built in template django system, do I need to use DRF? please someone help me since I don't know the answer yet since I want to integrate a frontend framework such as Angular to developer my web page but I think I don't need Django, instead I need to use DRF!

question from:https://stackoverflow.com/questions/65909521/do-i-need-to-manipulate-drf-if-only-im-using-the-built-in-template-django-system

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You will have to use Django if you want to create/update/delete/read objects from/to a database. Django will enable you to create your models and manage them.

DRF will be used to create an API over Django.

If you want to integrate a frontend framework such as Angular, you will have to query this API in order to retrieve data from / send data to the database.

There are plenty of tutorials on how to build a fullstack application, combining Django - DRF - and whatever frontend framework you like (Angular, React, Vuejs,...)

Usually, it follows this schema (simplified):

Database (PSQL, MySQL,...) -> ORM (Django) -> API (DRF) -> Frontend Framework (Angular,...)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...