我最近更名了项目及其应用。当我通过Windows命令行运行开发服务器时,它可以正常工作。问题是,当我通过PyCharm运行服务器时(我已经设置了virtualenv),它说(我最近安装了django-allauth
):
Unhandled exception in thread started by <function wrapper at 0x03767B30>
Traceback (most recent call last):
File "C:\Users\Milano\Desktop\Projekty\venvs\sflvenv\lib\site-packages\django\utils\autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "C:\Users\Milano\Desktop\Projekty\venvs\sflvenv\lib\site-packages\django\core\management\commands\runserver.py", line 107, in inner_run
autoreload.raise_last_exception()
File "C:\Users\Milano\Desktop\Projekty\venvs\sflvenv\lib\site-packages\django\utils\autoreload.py", line 252, in raise_last_exception
six.reraise(*_exception)
File "C:\Users\Milano\Desktop\Projekty\venvs\sflvenv\lib\site-packages\django\utils\autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "C:\Users\Milano\Desktop\Projekty\venvs\sflvenv\lib\site-packages\django\__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\Milano\Desktop\Projekty\venvs\sflvenv\lib\site-packages\django\apps\registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "C:\Users\Milano\Desktop\Projekty\venvs\sflvenv\lib\site-packages\django\apps\config.py", line 86, in create
module = import_module(entry)
File "c:\python27\Lib\importlib\__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named allauth
我做了什么:
我该怎么做才能让它发挥作用?
答案 0 :(得分:2)
在激活virtualenv
时安装软件包:
pip install django-allauth
如果您确定已安装,请尝试以下操作:
Django项目设置中未列出Allauth特定的上下文处理器。所以你需要删除这两行:
# `allauth` specific context processors
'allauth.account.context_processors.account',
'allauth.socialaccount.context_processors.socialaccount',
相关的SO thread