简体   繁体   English

使用 Django 1.9 运行 Django 1.8 项目时解耦模块错误

[英]Decouple module error running Django 1.8 project using Django 1.9

Currently, I am using latest version of Django 1.9.目前,我使用的是最新版本的 Django 1.9。 I have a project that is written in Django 1.8我有一个用 Django 1.8 编写的项目

When I tried to runserver, I encountered the following error当我尝试运行服务器时,遇到以下错误

我的第一张图片

What should I do as I do not want to downgrade to Django 1.8 to run the project?我不想降级到 Django 1.8 来运行项目,我该怎么办?

Edit: The above problem is due to lack of python-decouple module.编辑:上述问题是由于缺少 python-decouple 模块。 After I install decouple module and try to runserver again it gives another error.在我安装解耦模块并再次尝试运行服务器后,它又出现了另一个错误。 图 2

It is not because you use Django 1.9 that you get that error, it is because that module is not install at the moment.出现该错误并不是因为您使用 Django 1.9,而是因为该模块目前未安装。 Run pip install python-decouple to install the module.运行pip install python-decouple安装模块。

In my case installing python-decouple also outside the vitualenv solved the problem.在我的情况下,也在 vitualenv 之外安装 python-decouple 解决了这个问题。

comp@debian:~/Desktop/prj$sudo pip install python-decouple
(venv) comp@debian:~/Desktop/prj$pip install python-decouple

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM