Skip to main content

Swiftwind for Heroku Deployment

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.

Metadata

Release files for swiftwind-heroku 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swiftwind-heroku 0.1.0
File Size Uploaded
swiftwind-heroku-0.1.0.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swiftwind-heroku 0.1.0
File Interpreter ABI Platform
swiftwind_heroku-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.2 kB

Release files / swiftwind-heroku-0.1.0.tar.gz

Download URL swiftwind-heroku-0.1.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
de4f52fde00d074484e2c2445a9bcebbf2137e52749bb3139a0c6dad95cff56f
BLAKE2b-256 checksum
How to use checksums
bce1477ac6dfc5bcda7c836e74fd45e0bced862bd9e5b956db5d6754e3d48511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / swiftwind_heroku-0.1.0-py3-none-any.whl

Download URL swiftwind_heroku-0.1.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35baf52494d652cf518d3f2cdd302bf4a8728540b805fe8a279bebffa643c742
BLAKE2b-256 checksum
How to use checksums
94cdbb82d10032f800ed94c4625969ac11edbe9803aade6206ec4c69925dee39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page