Python と Django は初めてです。そして、私が理解していないこと:
このコードを使用する理由 (django チュートリアルから):
from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
# other functions...
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)
すべてからmanage.py shell
うまくいきます。SublimeText2 でこのコードをビルドしようとすると、次のエラーが発生します。
django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
settings
2 番目のケースで、Django が使用するファイルを認識できないのはなぜですか?