2013-04-19 2 views
1

Я получаю эту ошибку при запуске Django от uWSGI и не могу понять, что случилось:Джанго: ImportError: Нет модуль с именем pocdebug_toolbar

... 
File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 160, in _fetch 
    app = import_module(appname) 
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module 
    __import__(name) 
ImportError: No module named pocdebug_toolbar 

Python 2.7.3; Джанго == 1.4.3; Ubuntu 12.04.2 LTS

Here is the full traceback: 
Traceback (most recent call last): 
    File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 241, in __call__ 
    response = self.get_response(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 179, in get_response 
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info()) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 221, in handle_uncaught_exception 
    return debug.technical_500_response(request, *exc_info) File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 66, in technical_500_response 
    html = reporter.get_traceback_html() File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 287, in get_traceback_html 
    return t.render(c) 
    File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140, in render 
    return self._render(context) 
    File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render 
    return self.nodelist.render(context) 
    File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render 
    bit = self.render_node(node, context) 
    File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 74, in render_node 
    return node.render(context) 
    File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py", line 84, in render 
    output = self.filter_expression.resolve(context) 
    File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 599, in resolve 
    new_obj = func(obj, *arg_vals) 
    File "/usr/local/lib/python2.7/dist-packages/django/template/defaultfilters.py", line 718, in date 
    return format(value, arg) 
    File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 310, in format 
    return df.format(format_string) 
    File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 33, in format 
    pieces.append(force_unicode(getattr(self, piece)())) 
    File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 214, in r 
    return self.format('D, j M Y H:i:s O') 
    File "/usr/local/lib/python2.7/dist-packages/django/utils/dateformat.py", line 33, in format 
    pieces.append(force_unicode(getattr(self, piece)())) 
    File "/usr/local/lib/python2.7/dist-packages/django/utils/encoding.py", line 71, in force_unicode 
    s = unicode(s) File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 121, in __unicode_cast 
    return func(*self.__args, **self.__kw) File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py", line 86, in ugettext 
    return _trans.ugettext(message) File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 278, in ugettext 
    return do_translate(message, 'ugettext') File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 268, in do_translate 
    _default = translation(settings.LANGUAGE_CODE) File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 183, in translation 
    default_translation = _fetch(settings.LANGUAGE_CODE) File "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 160, in _fetch 
    app = import_module(appname) 
    File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module 
    __import__(name) 
ImportError: No module named pocdebug_toolbar 
+0

Ответ на этот вопрос довольно сложно, поскольку вы его создали. Мы понятия не имеем, какие пакеты вы установили в своей системе, каков ваш путь, как вы устанавливаете пакеты, которые используете ... Мы просто не можем вам помочь, если это все, что вы говорите. Кроме того, я думаю, что есть другой сайт обмена стеками, который лучше подходит для такого вопроса (http://stackexchange.com/sites), может быть, Ask Ubuntu, Server Fault или Superuser. – mattg

+1

Что содержит ваш 'INSTALLED_APPS'? Похоже, вы указали 'pocdebug_toolbar' вместо' debug_toolbar'. –

+0

Ты прибил его - спасибо @Austin_Phillips! Я забыл запятую между моими двумя приложениями в кортеже INSTALLED_APPS, поэтому строки были объединены. –

ответ

1

Решено. Я забыл запятую между моими приложениями в кортеже settings.pyINSTALLED_APPS, поэтому он объединял две строки «poc» и «debug_toolbar» в «pocdebug_toolbar».

INSTALLED_APPS = (
    ... 
    'poc' # <== missing comma here 
    'debug_toolbar' 
    ) 
Смежные вопросы