我是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
我做错了什么?