0
我想練習從Madtering Django的模板上的 例如這個例子試圖解釋點可以如何引用對象的方法,我可避免的錯誤? 這是我輸入Django的模板運動給錯誤
from django.template import Template, Context
t = Template('{{var}} -- {{var.upper}} -- {{var.isdigit}}')
我得到的錯誤,並最終說
django.core.exceptions.ImproperlyConfigured: Requested setting TEMPLATES, but settings are configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
請記住我是初學者,謝謝您的回答
您沒有設置你的DJANGO_SETTINGS_MODULE環境變量的是,這意味着Django不知道什麼設置才能使用。更多詳情https://docs.djangoproject.com/en/1.11/topics/settings/#the-django-admin-utility – LaundroMat
您在./manage.py外殼的命令或只是正常的蟒蛇? – deaspo
是的,謝謝 –