From c249bdcbd4208890fd5f89a546e247487c2e860d Mon Sep 17 00:00:00 2001 From: mcbloch Date: Mon, 1 Apr 2019 23:42:59 +0200 Subject: [PATCH] add venv creation to script, add to readme and gitignore --- .gitignore | 1 + README.md | 2 +- first-setup.sh | 11 ++++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ed4e28e..7c0f9c3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ __pycache__/ # Distribution / packaging .Python env/ +venv/ build/ develop-eggs/ dist/ diff --git a/README.md b/README.md index 7eaa2cf..2f4fa0c 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,4 @@ Local hosting steps 7. Run `python haldis.py runserver` --- -Or run `./localhost.sh` in the root of the git folder (in linux) +Or run `./first-setup.sh` in the root of the git folder (in linux) diff --git a/first-setup.sh b/first-setup.sh index f2bbf7c..12c83b0 100755 --- a/first-setup.sh +++ b/first-setup.sh @@ -1,11 +1,16 @@ #!/bin/bash # A simple file to run all instructions from the README ## this should be run in the root of the repository -pip3 install -r requirements.txt + +if [ ! -d "vent" ]; then + python -m venv venv +fi + +venv/bin/pip install -r requirements.txt cd app cp config.example.py config.py cp -t . database/* -python3 create_database.py +venv/bin/python create_database.py rm -f add_* create_database.py -python3 haldis.py runserver +venv/bin/python haldis.py runserver cd ..