Skip to main content

Swiftwind for Heroku Deployment

Project description

For more details see the Swiftwind project.

Installation

https://www.herokucdn.com/deploy/button.svg

Environment variables:

# Should be setup automatically for you:
SECRET_KEY='<a random value>'
DATABASE_URL='postgres://user:pasword@host/dbname'

# If you are using HTTPS you may wish to set the following yourself:
HTTPS=1  # Will ensure site is served over HTTPS only
HSTS_SECONDS=100000  # Will enable HSTS, and set the seconds timeout
HSTS_INCLUDE_SUBDOMAINS=1  # Apply HSTS to subdomains

Required Heroku Addons

The free plan for each of the following addons will be setup:

  • Postgres

  • Redis

Dokku

This project is also designed to support deployment to dokku. To do so you will need:

You can deploy as follows:

# Get the repo
git clone https://github.com/adamcharnock/swiftwind-heroku.git
cd swiftwind-heroku

# Create the app and set the config
dokku apps:create swiftwind
dokku config:set SECRET_KEY=random-string

dokku postgres:create swiftwind
dokku postgres:link swiftwind swiftwind

dokku redis:create swiftwind
dokku redis:link swiftwind swiftwind

git push dokku
dokku run ./manage.py migrate
# Create a user you will use to login as
dokku run ./manage.py createsuperuser
# Set currency as you wish (GBP, EUR, USD etc)
dokku run ./manage.py swiftwind_create_accounts --currency USD

Troubleshooting

Django does not display very helpful errors when deploying into production, and for good reason. However, you can enable debugging output to help fix any server errors you may see when accessing sentry in your browser:

heroku config:set DEBUG=1
heroku config:unset DEBUG

You can also view the server logs:

heroku logs -t

Note you can replace heroku with dokku in any of the above commands.

Credits

Developed by Adam Charnock. I’m a freelance developer, so do get in touch if you have a project.

swiftwind-heroku is packaged using seed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swiftwind-heroku-0.2.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

swiftwind_heroku-0.2.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file swiftwind-heroku-0.2.0.tar.gz.

File metadata

File hashes

Hashes for swiftwind-heroku-0.2.0.tar.gz
Algorithm Hash digest
SHA256 285be1281f4e7489a0779a49107c37b9fbd323db82721bb37c634fc5402cd5ac
MD5 3382083f2a7b2fbdedc0028d9a645c13
BLAKE2b-256 c41f048d264e0a1f11a4a9e177527646f5e58461dad2dba793d7ecdb63631f3d

See more details on using hashes here.

File details

Details for the file swiftwind_heroku-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for swiftwind_heroku-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41214484aa6250398ec589db3d9e5b00f08736938a39e31048de604db9c362bb
MD5 cf0a5c6b7e1d0e2316bed9223d410bc8
BLAKE2b-256 ca741d21cfce128dbf82a58c8520cee0718e95c61cfd85e19620440bbec72335

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page