here 지침에 따라 작은 Django 웹 응용 프로그램을 배포하는 데 어려움을 겪고 있습니다. 난 내 개발에 내 애플 리케이션을 빌드하고 모든 장고 개발 서버에서 잘 작동 sqlite3 사용하고 있습니다. Heroku에 배포하려고하면 "푸시 거부 됨, 시더 지원 앱이 감지되지 않음"오류가 발생하지만 내 앱을 설치하고 실행하는 데 필요한 모든 파일이 있다고 생각합니다. 며칠 동안 성공을 거두지 않았으니 아무 제안이나 도움이 될 것입니다. 아래는 내 애플의 스케치이지만 내 github repo에서 모든 것을 샅샅이 조사 할 수 있습니다.Django 응용 프로그램을 Heroku에 배포하는 데 문제가 발생했습니다. "Cedar 지원 응용 프로그램이 감지되지 않았습니다"
landcrab/
landcrab/ <----- main project
settings/
__init__.py
base.py
local.py
production.py
__init__.py
urls.py
db.sqlite3
wsgi.py
vcrental/ <----- my app
admin.py
....
static/
....
.gitignore
db.sqlite3
manage.py
Procfile
requirements.txt
runtime.txt
은 manage.py
및 wsgi.py
에서 나는 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "landcrab.settings.production")
Procfile
web: gunicorn landcrab.wsgi --log-file -
requirements.txt (사용 PIP 동결)
Django==1.7.1
dj-database-url==0.3.0
dj-static==0.0.6
django-toolbelt==0.0.1
gunicorn==19.1.1
jsmin==2.0.11
nose==1.3.4
psycopg2==2.5.4
pyparsing==2.0.3
python-dateutil==2.2
pytz==2014.9
six==1.8.0
static3==0.5.1
runtime.txt
,536,913을 설정 한 내 설정 파일의 경우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:[email protected]/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 = ['*']
Production.py
this structure을 따르도록 시도하고 마지막
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 스택 : set cedar-14 –
Python 런타임이 heroku에서 작동합니까? [heroku가 현재 Python 3.4.1까지 런타임을 지원한다는 사실을 알게되었습니다] (https://devcenter.heroku.com/articles/python-runtimes#supported-python-runtimes) – dazedconfused
@dazedconfused https : //devcenter.heroku를 참조하십시오. .com/articles/python-support뿐만 아니라 내 (바보 같은) 해결책을 아래에서보십시오. – Ben