Skip to content
Erik Smistad edited this page May 4, 2022 · 7 revisions

1. Clone repo

git clone https://github.com/smistad/annotationweb.git

2. Setup up virtual environment

cd annotationweb
pip install virtualenv
virtualenv -ppython3 environment
source environment/bin/activate # On windows, this command is: ./environment/Scripts/activate

3. Install requirements

pip install --upgrade pip # Make sure pip is up to date first
pip install -r requirements.txt

4. Create a secret key Generate a secret key and add it to settings.py

python manage.py shell -c 'from django.core.management import utils; print(utils.get_random_secret_key())'
# On windows, this command is: python -c "from django.core.management import utils; print(utils.get_random_secret_key())"

Open the file annotationweb/settings.py. Uncomment and set the SECRET_KEY to the output of the python command above. Remember to keep this key secret. You may change it, even when the system is in use, but note that users may be logged out. See here for more info: https://medium.com/@bayraktar.eralp/changing-rotating-django-secret-key-without-logging-users-out-804a29d3ea65

5. Initialize database

python manage.py makemigrations
python manage.py migrate

6. Create super user

python manage.py createsuperuser

7. Run server and have fun

python manage.py runserver

Open browser at http://localhost:8000

Updating

1. Back up your database Your database is stored entirely in the db.sqlite3 file. Copy this to a safe location. You may also want to keep a copy of the code as well, so you can copy the entire project folder.

2. Pull latest changes from git

git pull

3. Update database

python manage.py migrate

4. Run server and have fun

python manage.py runserver