- python 3 (version 3.9+)
- pip
- django version 4.1
- Clone project
- Install Python 3.9+
- Install django version 4.1
pip install django==4.1
in project directory - Setup Virtual Environment. For UNIX/macOS
source lifting/bin/activate
. To deactivate, just rundeactivate
(Windows users just google it) - Verify that Django is running and setup correctly by running
django-admin
from CLI
- Make sure virtual environment is launched
- From project root,
cd stevenslifting
- Run
python3 manage.py runserver
- Navigate to http://127.0.0.1:8000/ to see it in action
- To launch an environment:
source lifting/bin/activate
- To deactivate launched environment:
deactivate
- To run app server:
python3 manage.py runserver
- To generate migration files (after model object changes are made):
python3 manage.py makemigrations
- To run migration command (after makemigrations):
python3 manage.py migrate
- To launch the Django shell:
python3 manage.py shell
, and make sure tofrom base.models import <ModelName>
to access rows
If for some reason a change is made to a Model object that results in a broken migration (for example, a foreign key added AFTER migrating a table), then you might want to wipe out the db and migration files and start fresh:
- delete
db.sqlite3
file - delete all migration files
- run
python3 manage.py makemigrations
to re-generate migration files and sqlite file - finally
python3 manage.py migrate
. thedb.sqlite3
file should be automatically regenerated