Virtual Environment (Optional):
To understand and create a Python virtual environment: Windows, Mac&Linux
Install Django:
pip3 install django
Create a Django project:
Before running the command below, make sure to change your directory to where you want you Django project to be.
django-admin startproject project
This is what you'll get:
Django creates a directory with the same name as your project, which contains several files:
- manage.py: A command-line utility that lets you interact with your project, including running development servers, running database migrations, and executing tests.
- settings.py: The main configuration file for your project. It contains settings such as database connection details, installed apps, and middleware.
- urls.py: The file that maps URLs to views. It contains a list of URL patterns, each with a corresponding view function.
- wsgi.py: A file used for deploying your project on a WSGI server, such as Apache or Nginx.
- asgi.py: A file used for deploying your project on an ASGI server, such as Daphne or Uvicorn.