When you start a new Django project, various files and directories are created. Here's a glance at the typical Django project structure:
Ensure Django is installed to create a new Django project. View installation guidelines from here. (Link to installation)
Use the command below to create a project:
django-admin startproject myproject
This will create a new project directory named ‘myproject’ with a basic project structure. Now, change into your project directory using the command below:
cd myproject
Firstly, verify your Django project has a ‘manage.py’ file. Now, start your development server with the command below:
python manage.py runserver
HINT:
You can see warnings related to unapplied migrations. We’ll deal with that later in the database section.
To access the development server, open a web browser and navigate to http://127.0.0.1:8000/. You should see the Django welcome page, indicating that your development server is running successfully.
To stop the running development server, press Ctrl+C
in your terminal interface.
HINT:
If you want to run the development server on any other port than the default (i.e., 8000), you can provide the port as: For instance, to use port 8005:
python manage.py runserver 8005