没有模块名称'django'

时间:2017-01-24 19:23:54

标签: python django python-3.5

我是Python的新手,我正在尝试使用Python 3.5创建一个网站。当我运行代码时:

from django.db import models

# Create your models here.
class Topic(models.Model):
    text = models.CharField(max_length=200)
    date_added = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        """Return a string representation of the model"""
        return self.text 

我收到消息:

Traceback (most recent call last):
 File "models.py"/ line 1, in (module)
  from django.db import models
ImportError: No module named 'django'

我尝试再次在虚拟环境中安装django并收到消息:

Requirement already satisfied: Django in c:\users\owner\documents\learning_log\11_env\lib\site-packages

我做错了什么?

0 个答案:

没有答案
相关问题