Pencil-For-Schools / pencil-tech-admin

3 stars 0 forks source link

Pencil Tech Admin/API

Running the app

To run locally:

Install pipenv if you do not currently have it. This will allow you to install the version of python this project is using.

Using Pyenv to manage python versioning

You will want to have the correct Python version on your machine.

First, check your python version:

Once pyenv is installed, you can install different Python versions using it. For example, to install Python 3.9.13, you can run:

pyenv install 3.9.13

To check for all available Python versions:

pyenv versions

Install Dependencies

pipenv shell
pipenv install
python3 -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'

Run migration

This will create a local db

python3 manage.py migrate

Create 2 local super users

python3 manage.py createsuperuser --email admin1@gmail.com --username admin1
python3 manage.py createsuperuser --email admin2@gmail.com --username admin2

enter your password for the NEW SUPER USER twice

Load Fixtures

python3 manage.py loaddata LIST_DATA_TO_LOAD

Start the server

python3 manage.py runserver

Login to the admin

To login navigate to: http://127.0.0.1:8000/admin

If there are any code updates

python3 manage.py migrate

If you get errors