start django project
Open a terminal window.
Navigate to the directory where you want to create your Django project.
Run the following command to create a new Django project:
django-admin startproject projectname
Navigate into the newly created project directory:
cd projectname
Create a new Django app within the project:
python manage.py startapp appname
Open the
settings.py
file in the project directory and add the newly created app to theINSTALLED_APPS
section.Apply initial database migrations:
python manage.py migrate
Create a superuser for the admin interface:
python manage.py createsuperuser
Follow the prompts to set up the superuser account.
Start the development server:
python manage.py runserver
Open a web browser and go to
http://127.0.0.1:8000/
to see your Django project in action.To access the admin interface, go to
http://127.0.0.1:8000/admin/
and log in with the superuser credentials.
That's it! You've successfully started a Django project and created a basic app.