Improving the setup process a bit.

This commit is contained in:
Víðir Valberg Guðmundsson 2016-07-03 14:27:31 +02:00
parent d7fdc06764
commit add35068af
3 changed files with 42 additions and 8 deletions

17
Makefile Normal file
View file

@ -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

View file

@ -10,9 +10,26 @@ Features do not include:
## Quickstart ## Quickstart
$ source path/to/venv/bin/activate
$ pip install -r requirements/development.txt Create a virtual environment and activate it:
$ ./manage.py makemigrations
$ ./manage.py migrate $ virtualenv venv
$ ./manage.py createsuperuser $ source venv/bin/activate
$ ./manage.py runserver
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

View file

@ -1,12 +1,12 @@
DATABASE_URL=postgres://username:password@host:port/database DATABASE_URL=postgres://username:password@host:port/database
SECRET_KEY=somethingverysecretandunique SECRET_KEY=somethingverysecretandunique
ALLOWED_HOSTS=a,seperated,list,without,spaces ALLOWED_HOSTS=localhost,127.0.0.1
EMAIL_HOST='mailhost.example.com' EMAIL_HOST='mailhost.example.com'
EMAIL_PORT=587 EMAIL_PORT=587
EMAIL_HOST_USER='mymailuser' EMAIL_HOST_USER='mymailuser'
EMAIL_HOST_PASSWORD='mymailpassword' EMAIL_HOST_PASSWORD='mymailpassword'
EMAIL_USE_TLS=True EMAIL_USE_TLS=True
EMAIL_FROM='noreply@example.com' DEFAULT_FROM_EMAIL='noreply@example.com'
ARCHIVE_EMAIL='archive@example.com' ARCHIVE_EMAIL='archive@example.com'
EPAY_MERCHANT_NUMBER=something EPAY_MERCHANT_NUMBER=something
EPAY_MD5_SECRET=something EPAY_MD5_SECRET=something