Check the Wiki for Django references and more documentation.
-
Clone the repository and switch into the new directory:
git clone https://github.com/wtg/petitions-rewrite.git cd petitions-rewrite -
Install the python 3.6 or greater
sudo apt install python<python_version> python3-pip -y -
Install pipenv
-
Create pipenv with python 3.6 or greater and install dependencies
pipenv install --python <python_version> -
Activate the virtual environment
pipenv shell -
Set a secret key environment variable
export SECRET_KEY="any string will work for development" -
Set up the local database
-
Install SQLite for your operating system.
-
Set the
DJANGO_SETTINGS_MODULEenvironment variable to use the settings file for development (petitions/settings/dev.py):
export DJANGO_SETTINGS_MODULE='petitions.settings.dev'- Make migrations:
python manage.py makemigrations index python manage.py migrate- Add an admin user -
python manage.py createsuperuser
-
-
Run the site:
python manage.py runserverNavigate to http://localhost:8000 to view. Go to http://localhost:8000/admin to add test data.
The code formatter, Python Black is now enforced on Travis builds. To format one file, run
black <path to file>
or to format all python files your current directory, run
black .
Then commit and push any changed files.