python -m venv envname
python -m pip install django
django-admin startproject myproject
python manage.py runserver
python manage.py runserver 8080
The app should be created in the same folder as the manage.py so that it is imported as its own top level module rather than a submodule of the project
python manage.py startapp appname
[database documentation link](https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-DATABASES)
Add an object path to the installed Apps array in the settings.py like polls.apps.PollsConfig
python manage.py makemigrations appname
python manage.py migrate
python manage.py sqlmigrate appname 0001
python manage.py check
python manage.py shell
change timezone to your current timezone using [timezone reference](https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-TIME_ZONE)
python manage.py test appname
Use django test client to simulate a user interacting with the code at the view level. It can be used in the test.py
or even in the view
[from django.test.utils import setup_test_environment
setup_test_environment()
]
setup_test_environment()
installs a template renderer which allows us to examine some additional attributes on responses such as context that would otherwise be unavailable. This method doesn't set up a test database.
from django.test import Client
client=Client()
python -c "import django; print(django.__path__)"