diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..8cdba381 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +SETTINGS = bornhack.settings.development + +all: migrate superuser run + +migrations: + ./manage.py makemigrations --settings=$(SETTINGS) + +migrate: + ./manage.py migrate --settings=$(SETTINGS) + +superuser: + ./manage.py createsuperuser --settings=$(SETTINGS) + +run: + ./manage.py runserver --settings=$(SETTINGS) + +.PHONY = all migrations migrate superuser run diff --git a/README.md b/README.md index 2895e3bc..e81afc2e 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,26 @@ Features do not include: ## Quickstart - $ source path/to/venv/bin/activate - $ pip install -r requirements/development.txt - $ ./manage.py makemigrations - $ ./manage.py migrate - $ ./manage.py createsuperuser - $ ./manage.py runserver + +Create a virtual environment and activate it: + + $ virtualenv venv + $ source venv/bin/activate + +Install dependencies: + + (venv) $ pip install -r requirements/development.txt + +Copy environment file and change settings like DATABASE_URL: + + (venv) $ cp bornhack/settings/env.dist bornhack/settings/.env + +Run `make` + + (venv) $ make + +Which is equivalent with this: + + (venv) $ ./manage.py migrate --settings=bornhack.settings.development + (venv) $ ./manage.py createsuperuser --settings=bornhack.settings.development + (venv) $ ./manage.py runserver --settings=bornhack.settings.development diff --git a/bornhack/settings/env.dist b/bornhack/settings/env.dist index 262086a7..81fcbba8 100644 --- a/bornhack/settings/env.dist +++ b/bornhack/settings/env.dist @@ -1,12 +1,12 @@ DATABASE_URL=postgres://username:password@host:port/database SECRET_KEY=somethingverysecretandunique -ALLOWED_HOSTS=a,seperated,list,without,spaces +ALLOWED_HOSTS=localhost,127.0.0.1 EMAIL_HOST='mailhost.example.com' EMAIL_PORT=587 EMAIL_HOST_USER='mymailuser' EMAIL_HOST_PASSWORD='mymailpassword' EMAIL_USE_TLS=True -EMAIL_FROM='noreply@example.com' +DEFAULT_FROM_EMAIL='noreply@example.com' ARCHIVE_EMAIL='archive@example.com' EPAY_MERCHANT_NUMBER=something EPAY_MD5_SECRET=something