A reusable template for making django projects
-
create a new repo using the DjangoAddicts repo template: https://github.com/djangoaddicts/repo_template
-
create a new python virtual environment:
python -m venv venv
-
install the packages defined in the toml file:
pip install .[dev]
-
use the following command to create a django project based on the django project template:
django-admin startproject my_project_name --template https://github.com/djangoaddicts/project_template_default/archive/refs/heads/main.zip
-
rename the project name to "django_project":
mv <my_project_name> django_project
-
cd into django_project and use the following command to create a django app based on the django app template:
cd django_project ./manage.py startapp my_app --template https://github.com/djangoaddicts/app_template_default/archive/refs/heads/main.zip --extension htm
-
run migrations, create an admin user, and start the demo server:
./manage.py migrate ./manage.py add_superuser --group admin ./manage.py runserver
-
open a browser at 127.0.0.1:8000, log in with admin/admin