update readme with extra docs

This commit is contained in:
mcbloch 2019-04-05 02:04:46 +02:00
parent 07895c5e87
commit 9e4beb7787

View file

@ -6,16 +6,29 @@ Start an order and let people add items with a simple mouse-click!
No more calculating prices and making lists!
Be lazier today!
Local hosting steps
===================
0. This is a Python 3 project so make sure to use python 3 and pip3 everywhere
1. Run `pip install -r requirements.txt`
2. `cd app`
3. Copy `config.example.py` to `config.py`
4. Copy the python files from `database/` to `app/` (yes, it's sad, I know)
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 `rm -f add_* create_database.py*` in `app/`
7. Run `python haldis.py runserver`
## Local setup
---
Or run `./first-setup.sh` in the root of the git folder (in linux)
There is a special script to get started with the project. Just run it in the root of the project.
first-setup.sh
This will create a virtual environment, install the necessary dependencies and will give you the option to seed the database.
If you are using a database other then sqlite you will first need to configure the correct uri to the database in the generated 'config.py' file.
Afterwards upgrade the database to the latest version using
python haldis.py db upgrade
You can now still seed the database by running
./populate-db.sh
in the root folder of the project.
## Development
### Changing the database
1. Update models located in 'app/models.py'
2. Run `python haldis.py db migrate` to create a new migration.
3. Apply the changes to the database using `python haldis.py db upgrade`