Skip to content

Pencil-For-Schools/pencil-tech-admin

Repository files navigation

Pencil Tech Admin/API

Running the app

To run locally:

  • Make a copy of the .env.sample in the root directory and name it .env
  • Get the private keys from another engineer if you cannot access MAKE A LINK

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:

  • python --version

Install Pyenv if not installed

  • brew install pyenv

If using bash:

  • echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
    echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile

If using Zsh:

  • echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.zshrc
    echo 'eval "$(pyenv init --path)"' >> ~/.zshrc

Remember to restart your terminal or run source ~/.bash_profile or source ~/.zshrc to apply the changes.

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
  • Create a secret key for the .env
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

  • make sure that you are in the shell environment

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors