django is null
- Create a new Django project using the command:
django-admin startproject projectname
. - Navigate into the newly created project directory using:
cd projectname
. - Create a new app within the project with:
python manage.py startapp appname
. - Define the app's models in the
models.py
file within the app directory. - Create database tables for the models using:
python manage.py makemigrations
followed by python manage.py migrate
. - Define the app's URLs in the
urls.py
file within the app directory. - Define the app's views in the
views.py
file within the app directory. - Create HTML templates for the views in a
templates
directory within the app directory. - Run the development server with the command:
python manage.py runserver
. - Access the app in a web browser at
http://127.0.0.1:8000/
.