Python 将Django应用程序部署到Heroku时出现问题”;未检测到Cedar支持的应用程序”;
我一直在努力按照给出的说明部署一个小型Django web应用程序。在我的开发中,我只使用sqlite3来构建我的应用程序,在Django开发服务器上一切都很好。当我尝试部署到Heroku时,会出现错误“Push-rejected,no Cedar supported app detected”,但我想我已经拥有启动和运行我的应用所需的所有文件。我已经做了几天了,但是没有成功,所以我会接受任何建议和帮助。下面是我的应用程序的草图,但请随时在我的网站上筛选整个应用程序 requirements.txt(使用pip冻结) runtime.txtPython 将Django应用程序部署到Heroku时出现问题”;未检测到Cedar支持的应用程序”;,python,django,heroku,Python,Django,Heroku,我一直在努力按照给出的说明部署一个小型Django web应用程序。在我的开发中,我只使用sqlite3来构建我的应用程序,在Django开发服务器上一切都很好。当我尝试部署到Heroku时,会出现错误“Push-rejected,no Cedar supported app detected”,但我想我已经拥有启动和运行我的应用所需的所有文件。我已经做了几天了,但是没有成功,所以我会接受任何建议和帮助。下面是我的应用程序的草图,但请随时在我的网站上筛选整个应用程序 requirements.t
python-3.4.2
对于我的设置文件,我尝试按照
Production.py
from landcrab.settings.base import *
import dj_database_url
DEBUG = False
TEMPLATE_DEBUG = False
# Parse database configuration from $DATABASE_URL
DATABASES['default'] = dj_database_url.config()
# DATABASES['default'] = dj_database_url.config(default='postgres://user:pass@localhost/dbname')
# DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
# DATABASES = {'default': dj_database_url.config(default=os.environ.get('DATABASE_URL'))}
# DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
# Honor the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# Allow all host headers
ALLOWED_HOSTS = ['*']
最后是wsgi.py
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "landcrab.settings.production") #Edited by me
from django.core.wsgi import get_wsgi_application
#Added by me for Heroku
try:
from dj_static import Cling
application = Cling(get_wsgi_application())
except:
application = get_wsgi_application()
这太尴尬了。在尝试部署到Heroku之前,我没有提交我的更改。提交后,我能够毫无错误地部署。heroku堆栈:set-cedar-14 Python运行时在heroku上工作吗@眼花缭乱,看看下面还有我的(白痴)解决方案。哈哈,别不好意思,你救了我一天!
python-3.4.2
from landcrab.settings.base import *
import dj_database_url
DEBUG = False
TEMPLATE_DEBUG = False
# Parse database configuration from $DATABASE_URL
DATABASES['default'] = dj_database_url.config()
# DATABASES['default'] = dj_database_url.config(default='postgres://user:pass@localhost/dbname')
# DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
# DATABASES = {'default': dj_database_url.config(default=os.environ.get('DATABASE_URL'))}
# DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
# Honor the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# Allow all host headers
ALLOWED_HOSTS = ['*']
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "landcrab.settings.production") #Edited by me
from django.core.wsgi import get_wsgi_application
#Added by me for Heroku
try:
from dj_static import Cling
application = Cling(get_wsgi_application())
except:
application = get_wsgi_application()