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

View File

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