我想使用Heroku的审阅应用程序来测试和展示我的网站给我的同事。该网站有一个大型数据库,不能使用Heroku的免费
我正在尝试使用
这个可以顺利构建,但是我如何明确指定我想要使用的数据库计划呢?
hobby-dev
数据库。我正在尝试使用
app.json
清单文件来指定我的应用程序平台,根据指南要求进行操作。我正在使用以下代码:
app.json
{
"name": "SiteName",
"description": "The website for SiteName",
"keywords": [
"mezzanine",
"django"
],
"image": "heroku/python",
"env": {
"EMAIL_SYSTEM": {
"description": "The email system to use, either console or mailgun",
"value": "mailgun"
},
"ENVIRONMENT": {
"description": "The dev environment, either production or test",
"value": "production"
},
"ALLOWED_HOSTS": {
"description": "Comma-separated list of hosts",
"value": ".herokuapp.com"
},
"DEFAULT_FROM_EMAIL": "noreply@example.com",
"SECRET_KEY": {
"description": "A secret key for verifying the integrity of signed cookies.",
"generator": "secret"
},
"WEB_CONCURRENCY": {
"description": "The number of processes to run.",
"value": "5"
},
"NODE_ENV": "production",
"DEBUG": "False",
"NPM_CONFIG_PRODUCTION": "false",
"CELERY_REDIS_MAX_CONNECTIONS": 3,
"S3_BUCKET": "my-s3-bucket",
"USE_CELERY_TASKS": "True"
},
"formation": {
"web": {
"quantity": 1,
"size": "Standard-1X"
},
"worker": {
"quantity": 1,
"size": "Standard-1X"
}
},
"addons": [
"heroku-redis",
{
"plan": "heroku-postgresql:standard-0",
"as": "DATABASE"
}
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-python.git"
}
],
"scripts": {
"postdeploy": "python manage.py migrate && python manage.py populate_db"
},
"environments": {
"test": {
"addons": [
"heroku-postgresql:in-dyno",
"heroku-redis:in-dyno"
],
"env": {
"APP_SKIP_DB_TEARDOWN": "True",
"DB_REQUIRE_SSL": "False",
"DEBUG": "True",
"S3_BUCKET": "my-s3-bucket",
"USE_CELERY_TASKS": "False"
},
"scripts": {
"test-setup": "python manage.py collectstatic --noinput",
"test": "python manage.py test"
}
}
}
}
这个可以顺利构建,但是我如何明确指定我想要使用的数据库计划呢?
{"plan": "heroku-postgresql:standard-0"}
而不是as
键。 - Tin NguyenSTANDARD_DB
作为附件,但仍然创建了一个带有DATABASE
作为附件值的爱好数据库。 - Pete Dermott