Python 2.7 在编写;型号.py“;,类似以下错误:django.core.exceptions.ImpropertlyConfigured:请求的设置

Python 2.7 在编写;型号.py“;,类似以下错误:django.core.exceptions.ImpropertlyConfigured:请求的设置,python-2.7,django-models,virtualenv,Python 2.7,Django Models,Virtualenv,这是我的密码: # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys sys.path.append("C:\\Users\\jm\\Desktop\\learning_log\\ll_env\\Lib\\site-packages") from django.db import models # Create your models here. class Topic(models.Model)

这是我的密码:

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
sys.path.append("C:\\Users\\jm\\Desktop\\learning_log\\ll_env\\Lib\\site-packages")
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 __unicode__(self):
        return self.text
这就是错误:

django.core.exceptions.ImpropertlyConfigured:请求设置默认\索引\表空间,但未配置设置。在访问设置之前,必须定义环境变量DJANGO_SETTINGS_MODULE或调用SETTINGS.configure()


欢迎来到stackoverflow!您是否已尝试自行解决此问题?你遇到了什么问题?你在用什么操作系统?可能是Windows的某个版本。错误消息非常清楚。那么您的环境设置是什么呢。变量