开发者

Django views not getting setting variables

开发者 https://www.devze.com 2022-12-14 16:36 出处:网络
Views.py is not picking up anything from settings.py views.py has import on top from django.conf import settings

Views.py is not picking up anything from settings.py

views.py has import on top

from django.conf import settings

if tried to run in this file

name =  settings.APP_NAME

it throws this error

AttributeError at /test/app
'_CheckLogin' ob开发者_如何学Cject has no attribute 'APP_NAME'


You must have redefined settings elsewhere in the module.


I think we need more information. Is it possible you're overwriting your settings variable? This suggests that your settings object is a '_CheckLogin' object Try to debug with pdb. Here's a good tutorial: http://simonwillison.net/2008/May/22/debugging/

0

精彩评论

暂无评论...
验证码 换一张
取 消