What is three tier Architecture?
Django takes position in three tier architecture.
It is recommended to run the django
project in virtual environment. One may choose to use venv
, conda
anything that he is familiar with.
To run and view the django
app on browser run the following:
A Django project is a Python package containing the database configuration used by various sub-modules (Django calls them apps) and other Django-specific settings.
Use the startproject command of Django-admin as follows:
The startproject is Django’s default project template. It creates the following file structure in the Python environment:
The general usage of manage.py is as follows:
On the top we used 3 command. Here are the explanation of these commands:
startapp
A Django project folder can contain one or more apps. An app is also represented by a folder of a specific file system. The command to create an app is:
makemigrations
Django manages the database operations with the ORM technique. Migration refers to generating a database table whose structure matches the data model declared in the app.
The following command should be run whenever a new model is declared.
migrate
This command option of manage.py synchronises the database state with the currently declared models and migrations.
runserver
This command runs the sever