2016-11-09 606 views
1

我已经安装在CentOS 7 Django的服务器当我启动服务器,我遇到这个错误Django的:导入错误:没有模块名为sslserver

Unhandled exception in thread started by <function wrapper at 0x32b6ed8> 
Traceback (most recent call last): 
File "/root/venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) 
File "/root/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run 
autoreload.raise_last_exception() 
File "/root/venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception 
six.reraise(*_exception) 
File "/root/venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper 
fn(*args, **kwargs) 
File "/root/venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup 
apps.populate(settings.INSTALLED_APPS) 
File "/root/venv/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate 
app_config = AppConfig.create(entry) 
File "/root/venv/lib/python2.7/site-packages/django/apps/config.py", line 90, in create 
module = import_module(entry) 
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module 
__import__(name) 
ImportError: No module named sslserver 
+0

是什么'settings.INSTALLED_APPS'的价值? –

+0

'pip安装django-sslserver' –

+0

你可以分享pip列表的输出吗? –

回答

0

在你的Python分发或virtualenv中安装模块:

$ pip install django-sslserver 

添加应用程序到你的INSTALLED_APPS:

INSTALLED_APPS = (... 
"sslserver", 
... 
) 

开始启用了SSL的调试服务器:

$ python manage.py runsslserver 

和访问应用程序的https://localhost:8000或指定的端口上启动服务器:

$ python manage.py runsslserver 127.0.0.1:8000 
+0

@PrakharSingh您的欢迎Prakhar:D:D –

相关问题