我一直在尝试将应用程序部署到Heroku(没有多余的装饰,只是一个简单的页面),但还没有成功。这是我的日志文件 -
2014-08-03T21:02:53.886884+00:00 heroku[web.1]: Starting process with command `gunicorn TestApp.wsgi`
2014-08-03T21:02:57.218280+00:00 heroku[web.1]: Process exited with status 3
2014-08-03T21:03:00.994045+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/"
host=fierce-oasis-7567.herokuapp.com request_id=f53c4902-5a52-4591-a099-ef006a4658d0 fwd="202.78.172.162"
dyno= connect= service= status=503 bytes=
2014-08-03T21:03:02.570801+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET
path="/favicon.ico" host=fierce-oasis-7567.herokuapp.com request_id=22872708-cf36-47b1- a5e6-552b7a1a8668
fwd="202.78.172.162" dyno= connect= service= status=503 bytes=
2014-08-03T21:14:34+00:00 heroku[slug-compiler]: Slug compilation started
2014-08-03T21:15:02+00:00 heroku[slug-compiler]: Slug compilation finished
2014-08-03T21:15:02.272206+00:00 heroku[web.1]: State changed from crashed to starting
2014-08-03T21:15:02.150270+00:00 heroku[api]: Deploy 9b69a49 by utsav.tiwary2011@gmail.com
2014-08-03T21:15:02.150376+00:00 heroku[api]: Release v8 created by utsav.tiwary2011@gmail.com
2014-08-03T21:15:06.900391+00:00 app[web.1]: Traceback (most recent call last):
2014-08-03T21:15:06.900398+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2014-08-03T21:15:06.885690+00:00 app[web.1]: 2014-08-03 21:15:06 [2] [INFO] Starting gunicorn 18.0
2014-08-03T21:15:06.900396+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/workers/base.py", line 106, in init_process
2014-08-03T21:15:06.900402+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/wsgiapp.py", line 62, in load
2014-08-03T21:15:06.900399+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/base.py", line 114, in wsgi
2014-08-03T21:15:06.900408+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/util.py", line 354, in import_app
2014-08-03T21:15:06.900404+00:00 app[web.1]: return self.load_wsgiapp()
2014-08-03T21:15:06.900411+00:00 app[web.1]: ImportError: No module named TestApp.wsgi
2014-08-03T21:15:06.900410+00:00 app[web.1]: __import__(module)
2014-08-03T21:15:06.900413+00:00 app[web.1]: Traceback (most recent call last):
2014-08-03T21:15:06.900419+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2014-08-03T21:15:06.900388+00:00 app[web.1]: 2014-08-03 21:15:06 [7] [ERROR] Exception in worker process:
2014-08-03T21:15:06.900406+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
2014-08-03T21:15:06.900417+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/workers/base.py", line 106, in init_process
2014-08-03T21:15:06.886483+00:00 app[web.1]: 2014-08-03 21:15:06 [2] [INFO] Listening at:
http://0.0.0.0:3589 (2)
2014-08-03T21:15:06.900427+00:00 app[web.1]: return util.import_app(self.app_uri)
2014-08-03T21:15:06.900414+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/arbit
er.py", line 495, in spawn_worker
2014-08-03T21:15:06.900416+00:00 app[web.1]: worker.init_process()
2014-08-03T21:15:06.900393+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/arbiter.py", line 495, in spawn_worker
2014-08-03T21:15:06.900394+00:00 app[web.1]: worker.init_process()
2014-08-03T21:15:06.900420+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/base.py", line 114, in wsgi
2014-08-03T21:15:06.896296+00:00 app[web.1]: 2014-08-03 21:15:06 [7] [INFO] Booting worker with pid: 7
2014-08-03T21:15:06.900421+00:00 app[web.1]: self.callable = self.load()
2014-08-03T21:15:06.900428+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/util.py", line 354, in import_app
2014-08-03T21:15:06.900401+00:00 app[web.1]: self.callable = self.load()
2014-08-03T21:15:06.900407+00:00 app[web.1]: return util.import_app(self.app_uri)
2014-08-03T21:15:06.900423+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/wsgiapp.py", line 62, in load
2014-08-03T21:15:06.900429+00:00 app[web.1]: __import__(module)
2014-08-03T21:15:06.900431+00:00 app[web.1]: ImportError: No module named TestApp.wsgi
2014-08-03T21:15:07.024019+00:00 app[web.1]: 2014-08-03 21:15:07 [2] [INFO] Shutting down: Master
2014-08-03T21:15:06.900424+00:00 app[web.1]: return self.load_wsgiapp()
2014-08-03T21:15:07.024128+00:00 app[web.1]: 2014-08-03 21:15:07 [2] [INFO] Reason: Worker failed to boot.
2014-08-03T21:15:06.886586+00:00 app[web.1]: 2014-08-03 21:15:06 [2] [INFO] Using worker: sync
2014-08-03T21:15:06.900425+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
2014-08-03T21:15:06.900514+00:00 app[web.1]: 2014-08-03 21:15:06 [7] [INFO] Worker exiting (pid: 7)
2014-08-03T21:15:05.633019+00:00 heroku[web.1]: Starting process with command `gunicorn TestApp.wsgi`
2014-08-03T21:15:08.072497+00:00 heroku[web.1]: Process exited with status 3
2014-08-03T21:15:08.083536+00:00 heroku[web.1]: State changed from starting to crashed
2014-08-03T21:15:08.084259+00:00 heroku[web.1]: State changed from crashed to starting
2014-08-03T21:15:11.225689+00:00 heroku[web.1]: Starting process with command `gunicorn TestApp.wsgi`
2014-08-03T21:15:12.151723+00:00 app[web.1]: 2014-08-03 21:15:12 [2] [INFO] Starting gunicorn 18.0
2014-08-03T21:15:12.166252+00:00 app[web.1]: worker.init_process()
2014-08-03T21:15:12.166257+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/base.py", line 114, in wsgi
2014-08-03T21:15:12.166251+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/arbiter.py", line 495, in spawn_worker
2014-08-03T21:15:12.166249+00:00 app[web.1]: Traceback (most recent call last):
2014-08-03T21:15:12.166260+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/wsgiapp.py", line 62, in load
2014-08-03T21:15:12.166246+00:00 app[web.1]: 2014-08-03 21:15:12 [7] [ERROR] Exception in worker process:
2014-08-03T21:15:12.166256+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2014-08-03T21:15:12.166265+00:00 app[web.1]: return util.import_app(self.app_uri)
2014-08-03T21:15:12.166259+00:00 app[web.1]: self.callable = self.load()
2014-08-03T21:15:12.166262+00:00 app[web.1]: return self.load_wsgiapp()
2014-08-03T21:15:12.166254+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/workers/base.py", line 106, in init_process
2014-08-03T21:15:12.166263+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
2014-08-03T21:15:12.166273+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/arbiter.py", line 495, i
n spawn_worker
2014-08-03T21:15:12.166271+00:00 app[web.1]: Traceback (most recent call last):
2014-08-03T21:15:12.166275+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/workers/base.py", line 106, in init_process
2014-08-03T21:15:12.166287+00:00 app[web.1]: __import__(module)
2014-08-03T21:15:12.166266+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/util.py", line 354, in import_app
2014-08-03T21:15:12.166281+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/wsgiapp.py", line 62, in load
2014-08-03T21:15:12.166268+00:00 app[web.1]: __import__(module)
2014-08-03T21:15:12.166289+00:00 app[web.1]: ImportError: No module named TestApp.wsgi
2014-08-03T21:15:12.166274+00:00 app[web.1]: worker.init_process()
2014-08-03T21:15:12.166278+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/base.py", line 114, in wsgi
2014-08-03T21:15:12.166269+00:00 app[web.1]: ImportError: No module named TestApp.wsgi
2014-08-03T21:15:12.166285+00:00 app[web.1]: return util.import_app(self.app_uri)
2014-08-03T21:15:12.166283+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
2014-08-03T21:15:12.152842+00:00 app[web.1]: 2014-08-03 21:15:12 [2] [INFO] Using worker: sync
2014-08-03T21:15:12.166277+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2014-08-03T21:15:12.166282+00:00 app[web.1]: return self.load_wsgiapp()
2014-08-03T21:15:12.166279+00:00 app[web.1]: self.callable = self.load()
2014-08-03T21:15:12.152750+00:00 app[web.1]: 2014-08-03 21:15:12 [2] [INFO] Listening at:
http://0.0.0.0:28415 (2)
2014-08-03T21:15:12.287650+00:00 app[web.1]: 2014-08-03 21:15:12 [2] [INFO] Reason: Worker failed to boot.
2014-08-03T21:15:12.287529+00:00 app[web.1]: 2014-08-03 21:15:12 [2] [INFO] Shutting down: Master
2014-08-03T21:15:12.166286+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-
packages/gunicorn/util.py", line 354, in import_app
2014-08-03T21:15:12.166363+00:00 app[web.1]: 2014-08-03 21:15:12 [7] [INFO] Worker exiting (pid: 7)
2014-08-03T21:15:12.162414+00:00 app[web.1]: 2014-08-03 21:15:12 [7] [INFO] Booting worker with pid: 7
2014-08-03T21:15:15.136154+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/"
host=fierce-oasis-7567.herokuapp.com request_id=86c520f6-3c60-4817-a006-7d5111a22a3c fwd="54.83.118.7" dyno=
connect= service= status=503 bytes=
2014-08-03T21:15:13.398231+00:00 heroku[web.1]: State changed from starting to crashed
2014-08-03T21:15:13.379837+00:00 heroku[web.1]: Process exited with status 3
这是我的Procfile:
web: gunicorn TestApp.wsgi
这是我的requirements.txt
Django<=1.3.1
dj-database-url==0.3.0
psycopg2==2.4.5
gunicorn==18.0
wsgiref==0.1.2
dj-static==0.0.5
static==0.4
这是我的设置文件:
# Django settings for TestApp project.
import os
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ALLOWED_HOSTS = ['*']
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = 'staticfiles'
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(PROJECT_PATH, 'static'),
)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
# Additional locations of static files
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'n(bd1f1c%e8=_xad02x5qtfn%wgwpi492e$8_erx+d)!tpeoim'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'TestApp.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'TestApp.wsgi.application'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'gunicorn',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
import dj_database_url
DATABASES['default'] = dj_database_url.config()
Procfile: web:sh -c&#34; cd TestApp&amp;&amp; gunicorn TestApp.wsgi&#34;
基本上,我的错误是它无法找到TestApp.wsgi,因此每次都会崩溃。我在部署 -
时执行了以下步骤任何人都可以帮我弄清楚出了什么问题吗?提前致谢 ! (如果有任何其他文件/细节,请告诉我 需要)