The Hedge app. A working demo is available at https://warm-oasis-54877.herokuapp.com.
To run the app on your local machine, you need Python 3.5+ and PostgreSQL installed on your computer.
-
Create and activate virtualenv:
python3 -m venv venv . venv/bin/activate
-
Install package dependencies:
pip install -r requirements.txt
-
Create new PostgreSQL database and user:
$ psql postgres psql (9.6.5) Type "help" for help. postgres=# CREATE DATABASE dbname; postgres=# CREATE USER dbuser WITH PASSWORD 's3cr3t'; postgres=# ALTER ROLE dbuser SET client_encoding TO 'utf8'; postgres=# ALTER ROLE dbuser SET default_transaction_isolation TO 'read committed'; postgres=# ALTER ROLE dbuser SET timezone TO 'UTC'; postgres=# ALTER USER dbuser CREATEDB; postgres=# GRANT ALL PRIVILEGES ON DATABASE dbname TO dbuser;
-
Create new
.env
file:cp .env.example .env
-
Fill in the required values below and you can leave the others empty:
POSTGRES_DBNAME=dbname POSTGRES_USER=dbuser POSTGRES_PASSWORD=s3cr3t DJANGO_SECRET_KEY=<random string>
-
Run the development server:
./manage.py migrate ./manage.py runserver 3000
Make sure that you have Docker and Docker Compose installed.
-
Create new
.env
file:cp .env.example .env
Fill in all of the values.
-
Build and run the containers:
docker-compose build && docker-compose up -d
Make sure you have a Heroku account and Heroku CLI is installed on your computer.
-
Login to Heroku:
heroku login
-
Create new Heroku app:
heroku create
-
Set the environment variables:
heroku config:set DJANGO_SETTINGS_MODULE=config.settings.heroku heroku config:set DJANGO_SECRET_KEY=<value> heroku config:set MAILGUN_API_KEY=<value> heroku config:set MAILGUN_SENDER_DOMAIN=<value> heroku config:set DEFAULT_FROM_EMAIL=<value>
-
Push code to server:
git push heroku master
-
Run database migrations and optionally create a user:
heroku run ./manage.py migrate heroku run ./manage.py createsuperuser
-
Open the app:
heroku open