Root of the Django project is where manage.py resides
$ mkdir basic_django$ cd basic_django$ virtualenvassume user already !pip install --user virtualenv$ virtualenv -p python3 .$ source bin/activate$ pip install django$ deactivateif you don't need virtualenv
$ django-adminto see list of django commands$ mkdir ./src && cd ./src$ django-admin startproject <your project name> .$ python manage.py runserver
BASE_DIR= project locationALLOWED_HOSTS= list of urls that can access django projectINSTALLED_APPS= installed components for particular django projectMIDDLEWARE= tell us how requests/security are handledROOT_URLCONF= tell us how urls are routingTEMPLATES= tell us how html pages should be renderedWSGI_APPLICATION= tell us how server worksDATABASES= databases mappingAUTH_PASSWORD_VALIDATORS= password's standardsSTATIS_URL= tell us where do we store static files$ python manage.py migrateto Sync changes in settings
- django has built-in apps. We also can install third-party apps.
$ python manage.py migrateto Sync changes in settings including auth, admin apps$ python manage.py createsuperusercreate the ultimate user$ python manage.py startapp <your appp name>create apps- you may edit your newly created apps, you may also need to update apps in
INSTALLED_APPS $ python manage.py makemigrationsUpdate what are we migrating$ python manage.py migrateactually sync settings- Also register your models in the relative admin.py
admin.site.register(Product)
$python manage.py shellwork with django project in (kind of) python shell