added a script to run haldis locally + README update

This commit is contained in:
Jan-Pieter Baert 2019-02-13 20:37:07 +01:00
parent 52188e0fb2
commit 4137016965
No known key found for this signature in database
GPG key ID: B19186932178234A
2 changed files with 20 additions and 5 deletions

View file

@ -10,8 +10,12 @@ Local hosting steps
=================== ===================
0. This is a Python 3 project so make sure to use python 3 and pip3 everywhere 0. This is a Python 3 project so make sure to use python 3 and pip3 everywhere
1. Run `pip install -r requirements.txt` 1. Run `pip install -r requirements.txt`
2. Copy `config.example.py` to `config.py` 2. `cd app`
3. Copy the python files from `database/` to `app/` (yes, it's sad, I know) 3. Copy `config.example.py` to `config.py`
4. Run `python create_database.py` in `app/` (if you want to fill the DB with sample data be sure to answer `Y` to `Do you still want to add something?`) 4. Copy the python files from `database/` to `app/` (yes, it's sad, I know)
5. Run `rm -f add_admins.py* add_oceans_garden.py* add_simpizza.py* create_database.py*` in `app/` 5. Run `python create_database.py` in `app/` (if you want to fill the DB with sample data be sure to answer `Y` to `Do you still want to add something?`)
6. Run `python haldis.py runserver` 6. Run `rm -f add_* create_database.py*` in `app/`
7. Run `python haldis.py runserver`
---
Or run `./localhost.sh` in the root of the git folder

11
localhost.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
# A simple file to run all instructions from the README
## this should be run in the root of the repository
pip install -r requirements.txt
cd app
cp config.example.py config.py
cp -t . database/*
python3 create_database.py
rm -f add_* create_database.py
python3 haldis.py runserver
cd ..