跳转到主要内容

Swiftwind for Heroku部署

项目描述

更多详情请参阅Swiftwind项目

安装

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

环境变量

# 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

必需的Heroku插件

以下每个插件的免费计划将被设置

  • Postgres

  • Redis

Dokku

本项目也设计为支持部署到dokku。要这样做,您需要

您可以按照以下方式部署

# 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

故障排除

Django在生产环境中部署时不会显示非常有用的错误,这是有原因的。然而,您可以启用调试输出以帮助修复您在浏览器中访问sentry时可能看到的任何服务器错误

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

您还可以查看服务器日志

heroku logs -t

注意,您可以在上述任何命令中将heroku替换为dokku

致谢

Adam Charnock开发。我是一名自由职业开发者,如果您有一个项目,请与我联系。

swiftwind-heroku使用seed打包。

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

swiftwind-heroku-0.2.0.tar.gz (6.7 kB 查看哈希值)

上传时间 源代码

构建发行版

swiftwind_heroku-0.2.0-py3-none-any.whl (8.5 kB 查看哈希值)

上传时间 Python 3

由以下支持