Creating your first project
Our first Django project will be building a complete blog. Django provides a command that allows you to create an initial project file structure. Run the following command from your shell:
django-admin startproject mysite
This will create a Django project with the name mysite.
Avoid naming projects after built-in Python or Django modules in order to avoid conflicts.
Let's take a look at the project structure generated:
mysite/
manage.py
mysite/
__init__.py
asgi.py
wsgi.py
settings.py
urls.py
These files are as follows:
manage.py: This is a command-line utility used to interact with your project. It is a thin wrapper around thedjango-admin.pytool. You don't need to edit this file.mysite/: This is your project directory, which consists of the following files:__init__.py: An empty file that tells Python to treat themysitedirectory as...