Heroku:没有名为blog error(Django)的模块..在本地服务器上运行正常

时间:2014-02-24 11:16:22

标签: python django heroku

我有一个名为myblog的django项目。 它有一个名为blog的应用程序,在settings.py中指定 它在localhost上工作正常但是当我将它发布到heroku时,我得到一个错误,没有名为blog的模块。

下面还提供了heroki日志的输出。 我也是django和heroku的新手。 有人可以帮帮我,告诉我我在哪里做错了吗?

使用django 1.6.2和python 2.7.6

"""
Django settings for myblog project.

For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/


# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'blog',
)

Heroku日志

    2014-02-24T10:44:52.534003+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/dateformat.py", line 312, in format
2014-02-24T10:44:52.534003+00:00 app[web.1]:     return df.format(format_string)
2014-02-24T10:44:52.534003+00:00 app[web.1]:     pieces.append(force_text(getattr(self, piece)()))
2014-02-24T10:44:52.534003+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/dateformat.py", line 35, in format
2014-02-24T10:44:52.534003+00:00 app[web.1]:     pieces.append(force_text(getattr(self, piece)()))
2014-02-24T10:44:52.534003+00:00 app[web.1]:     return self.format('D, j M Y H:i:s O')
2014-02-24T10:44:52.533497+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 613, in resolve
2014-02-24T10:44:52.534003+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/dateformat.py", line 216, in r
2014-02-24T10:44:52.534003+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/dateformat.py", line 35, in format
2014-02-24T10:44:52.533497+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaultfilters.py", line 705, in date
2014-02-24T10:44:52.534174+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/functional.py", line 138, in __text_cast
2014-02-24T10:44:52.534174+00:00 app[web.1]:     return func(*self.__args, **self.__kw)
2014-02-24T10:44:52.534003+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/encoding.py", line 100, in force_text
2014-02-24T10:44:52.534174+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 76, in ugettext
2014-02-24T10:44:52.534174+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 281, in ugettext
2014-02-24T10:44:52.534003+00:00 app[web.1]:     s = s.__unicode__()
2014-02-24T10:44:52.534174+00:00 app[web.1]:     return do_translate(message, 'ugettext')
2014-02-24T10:44:52.534174+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 263, in do_translate
2014-02-24T10:44:52.534174+00:00 app[web.1]:     _default = translation(settings.LANGUAGE_CODE)
2014-02-24T10:44:52.534174+00:00 app[web.1]:     default_translation = _fetch(settings.LANGUAGE_CODE)
2014-02-24T10:44:52.534174+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 177, in translation
2014-02-24T10:44:52.534174+00:00 app[web.1]:     return _trans.ugettext(message)
2014-02-24T10:44:52.534534+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch
2014-02-24T10:44:52.534534+00:00 app[web.1]:     __import__(name)
2014-02-24T10:44:52.534534+00:00 app[web.1]: ImportError: No module named blog
2014-02-24T10:44:52.534534+00:00 app[web.1]:     app = import_module(appname)
2014-02-24T10:44:52.534534+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
2014-02-24T10:51:44+00:00 heroku[slug-compiler]: Slug compilation started
2014-02-24T10:51:49+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Python app
2014-02-24T10:53:20+00:00 heroku[slug-compiler]: Slug compilation started
2014-02-24T10:53:43.183428+00:00 heroku[api]: Deploy 2956aca by arpitchaudhary52@gmail.com
2014-02-24T10:53:43.183520+00:00 heroku[api]: Release v6 created by arpitchaudhary52@gmail.com
2014-02-24T10:53:43+00:00 heroku[slug-compiler]: Slug compilation finished
2014-02-24T10:53:43.404947+00:00 heroku[web.1]: State changed from up to starting
2014-02-24T10:53:46.318675+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2014-02-24T10:53:46.975659+00:00 app[web.1]: 2014-02-24 10:53:46 [7] [INFO] Worker exiting (pid: 7)
2014-02-24T10:53:46.983948+00:00 app[web.1]: 2014-02-24 10:53:46 [2] [INFO] Shutting down: Master
2014-02-24T10:53:46.976912+00:00 app[web.1]: 2014-02-24 10:53:46 [2] [INFO] Handling signal: term
2014-02-24T10:53:47.859620+00:00 heroku[web.1]: Starting process with command `gunicorn myblog.wsgi`
2014-02-24T10:53:48.185896+00:00 heroku[web.1]: Process exited with status 0
2014-02-24T10:53:48.891900+00:00 app[web.1]: 2014-02-24 10:53:48 [2] [INFO] Listening at: http://0.0.0.0:39390 (2)
2014-02-24T10:53:48.891900+00:00 app[web.1]: 2014-02-24 10:53:48 [2] [INFO] Using worker: sync
2014-02-24T10:53:48.891194+00:00 app[web.1]: 2014-02-24 10:53:48 [2] [INFO] Starting gunicorn 18.0
2014-02-24T10:53:48.898496+00:00 app[web.1]: 2014-02-24 10:53:48 [7] [INFO] Booting worker with pid: 7
2014-02-24T10:53:49.460804+00:00 heroku[web.1]: State changed from starting to up
2014-02-24T10:53:57.277168+00:00 app[web.1]: 2014-02-24 10:53:57 [7] [ERROR] Error handling request
2014-02-24T10:53:57.277168+00:00 app[web.1]: Traceback (most recent call last):
2014-02-24T10:53:57.277168+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 131, in handle_request
2014-02-24T10:53:57.277168+00:00 app[web.1]:     respiter = self.wsgi(environ, resp.start_response)
2014-02-24T10:53:57.277168+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/dj_static.py", line 59, in __call__
2014-02-24T10:53:57.277168+00:00 app[web.1]:     return self.application(environ, start_response)
2014-02-24T10:53:57.277168+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 206, in __call__
2014-02-24T10:53:57.277168+00:00 app[web.1]:     response = self.get_response(request)
2014-02-24T10:53:57.277168+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py", line 196, in get_response
2014-02-24T10:53:57.277168+00:00 app[web.1]:     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
2014-02-24T10:53:57.277395+00:00 app[web.1]:     return debug.technical_500_response(request, *exc_info)
2014-02-24T10:53:57.277395+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py", line 231, in handle_uncaught_exception
2014-02-24T10:53:57.277395+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/views/debug.py", line 324, in get_traceback_html
2014-02-24T10:53:57.277395+00:00 app[web.1]:     return t.render(c)
2014-02-24T10:53:57.277395+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 140, in render
2014-02-24T10:53:57.277395+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/views/debug.py", line 69, in technical_500_response
2014-02-24T10:53:57.277395+00:00 app[web.1]:     return self._render(context)
2014-02-24T10:53:57.277395+00:00 app[web.1]:     html = reporter.get_traceback_html()
2014-02-24T10:53:57.277395+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 134, in _render
2014-02-24T10:53:57.277395+00:00 app[web.1]:     return self.nodelist.render(context)
2014-02-24T10:53:57.277577+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 840, in render
2014-02-24T10:53:57.277577+00:00 app[web.1]:     bit = self.render_node(node, context)
2014-02-24T10:53:57.277577+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/template/debug.py", line 78, in render_node
2014-02-24T10:53:57.277577+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/template/debug.py", line 88, in render
2014-02-24T10:53:57.277577+00:00 app[web.1]:     return node.render(context)
2014-02-24T10:53:57.277577+00:00 app[web.1]:     output = self.filter_expression.resolve(context)
2014-02-24T10:53:57.277577+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 613, in resolve
2014-02-24T10:53:57.277577+00:00 app[web.1]:     new_obj = func(obj, *arg_vals)
2014-02-24T10:53:57.277577+00:00 app[web.1]:     return format(value, arg)
2014-02-24T10:53:57.277577+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaultfilters.py", line 705, in date
2014-02-24T10:53:57.278269+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/dateformat.py", line 312, in format
2014-02-24T10:53:57.278269+00:00 app[web.1]:     return df.format(format_string)
2014-02-24T10:53:57.278269+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/dateformat.py", line 35, in format
2014-02-24T10:53:57.278269+00:00 app[web.1]:     pieces.append(force_text(getattr(self, piece)()))
2014-02-24T10:53:57.278269+00:00 app[web.1]:     pieces.append(force_text(getattr(self, piece)()))
2014-02-24T10:53:57.278530+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/functional.py", line 138, in __text_cast
2014-02-24T10:53:57.278530+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 281, in ugettext
2014-02-24T10:53:57.278269+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/dateformat.py", line 216, in r
2014-02-24T10:53:57.278269+00:00 app[web.1]:     return self.format('D, j M Y H:i:s O')
2014-02-24T10:53:57.278269+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/dateformat.py", line 35, in format
2014-02-24T10:53:57.278530+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 76, in ugettext
2014-02-24T10:53:57.278530+00:00 app[web.1]:     return _trans.ugettext(message)
2014-02-24T10:53:57.278708+00:00 heroku[router]: at=info method=GET path=/ host=mysterious-thicket-6880.herokuapp.com request_id=14b7ae4b-f496-4441-b461-12fef44ff006 fwd="103.248.32.25" dyno=web.1 connect=2ms service=758ms status=500 bytes=238
2014-02-24T10:53:57.278530+00:00 app[web.1]:     return do_translate(message, 'ugettext')
2014-02-24T10:53:57.278530+00:00 app[web.1]:     _default = translation(settings.LANGUAGE_CODE)
2014-02-24T10:53:57.278269+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/encoding.py", line 100, in force_text
2014-02-24T10:53:57.278269+00:00 app[web.1]:     s = s.__unicode__()
2014-02-24T10:53:57.278530+00:00 app[web.1]:     return func(*self.__args, **self.__kw)
2014-02-24T10:53:57.278530+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 263, in do_translate
2014-02-24T10:53:57.278530+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 177, in translation
2014-02-24T10:53:57.278530+00:00 app[web.1]:     default_translation = _fetch(settings.LANGUAGE_CODE)
2014-02-24T10:53:57.278962+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch
2014-02-24T10:53:57.278962+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
2014-02-24T10:53:57.278962+00:00 app[web.1]:     app = import_module(appname)
2014-02-24T10:53:57.278962+00:00 app[web.1]:     __import__(name)
2014-02-24T10:53:57.278962+00:00 app[web.1]: ImportError: No module named blog

0 个答案:

没有答案