https://github.com/adamcharnock/swiftwind-heroku
Swiftwind for Heroku Deployment
https://github.com/adamcharnock/swiftwind-heroku
Last synced: 2 months ago
JSON representation
Swiftwind for Heroku Deployment
- Host: GitHub
- URL: https://github.com/adamcharnock/swiftwind-heroku
- Owner: adamcharnock
- License: mit
- Created: 2017-02-27T16:12:50.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-13T12:36:32.000Z (over 6 years ago)
- Last Synced: 2025-02-28T17:55:35.095Z (3 months ago)
- Language: Python
- Size: 20.5 KB
- Stars: 8
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.txt
- License: LICENSE.txt
Awesome Lists containing this project
README
Swiftwind for Heroku Deployment
===============================For more details see the `Swiftwind project`_.
Installation
------------.. image:: https://www.herokucdn.com/deploy/button.svg
:target: https://heroku.com/deploy?template=https://github.com/adamcharnock/swiftwind-herokuEnvironment variables::
# Should be setup automatically for you:
SECRET_KEY=''
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 subdomainsRequired Heroku Addons
~~~~~~~~~~~~~~~~~~~~~~The free plan for each of the following addons will be setup:
* Postgres
* RedisDokku
~~~~~This project is also designed to support deployment to dokku. To do so you will need:
* A Postgres database (See `Postgres Dokku plugin`_)
* A Redis server (`Redis Dokku plugin`_)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-stringdokku postgres:create swiftwind
dokku postgres:link swiftwind swiftwinddokku redis:create swiftwind
dokku redis:link swiftwind swiftwindgit 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 USDTroubleshooting
~~~~~~~~~~~~~~~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 DEBUGYou 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_.
.. _seed: https://github.com/adamcharnock/seed/
.. _Swiftwind project: https://github.com/adamcharnock/swiftwind
.. _Postgres Dokku plugin: https://github.com/dokku/dokku-postgres
.. _Redis Dokku plugin: https://github.com/dokku/dokku-redis
.. _Adam Charnock: https://adamcharnock.com