我试着运行开发服务器,我发现这样的错误:
Unhandled exception in thread started by <function wrapper at 0x807ad8848>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 107, in inner_run
autoreload.raise_last_exception()
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 252, in raise_last_exception
six.reraise(*_exception)
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line 86, in create
module = import_module(entry)
File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named avatar
我正在使用virtualenv并且我使用它并使用它进行项目并在那里安装了django-avatar。
在我的本地服务器上,此模块正常工作:)
你知道出了什么问题吗?
答案 0 :(得分:0)
我在解决它的环境中使用python的绝对路径解决了我的问题。然后在manage.py之后添加。
/usr/home/login/virtualenvs/env_name/bin/python passenger_wsgi.py
/usr/home/login/virtualenvs/env_name/bin/python manage.py