Django is based on MVT (Model-View-Template) architecture.
MVT Structure has the following three parts –
Model: The model is going to act as the interface of your data. It is responsible for maintaining data. It is the logical data structure behind the entire application and is represented by a database (generally relational databases such as MySql, Postgres).
View: The View is the user interface — what you see in your browser when you render a website. It is represented by HTML/CSS/Javascript and Jinja files.
Template: A template consists of static parts of the desired HTML output as well as some special syntax describing how dynamic content will be inserted.
- pip install virtualenvwrapper-win
- mk virtualenv custom_virtual_env_name
- workon custom_virtual_env_name
- pip install djangorestframework
- pip install markdown # Markdown support for the browsable API.
- pip install django-filter # Filtering support
- django-admin startproject mysite
- python manage.py startapp polls
- python manage.py runserver
- python manage.py makemigrations
Your models will be scanned and compared to the versions currently contained in your migration files, and then a new set of migrations will be written out.
Once you have your new migration files, you should apply them to your database to make sure they work as expected:
- python manage.py migrate
A. Resources for uploading a file: https://blog.vivekshukla.xyz/uploading-file-using-api-django-rest-framework/
B. Resource for CRUD operation: https://medium.com/swlh/django-rest-framework-crud-with-drf-9a8756095c73
C. Making OAuth2 setup using Django Oauth Toolkit (DOT) https://django-oauth-toolkit.readthedocs.io/en/latest/getting_started.html