Thursday, April 30, 2015

What's the better way to get settings.DEBUG in a view?

Hi,

I have one view, and I want to get de DEBUG value..

if I try these:

import settings

if settings.DEBUG:

or:

from settings import DEBUG

if DEBUG:

show me these error:

File "views.py", line 19, in <module>
    import settings
  File "settings.py", line 178, in <module>
    from .settings_local import *
SystemError: Parent module '' not loaded, cannot perform relative import


So, what's the better way to get these value?

Regards,

T.·.F.·.A.·.     S+F
Fellipe Henrique P. Soares

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
Twitter: @fh_bash

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF1jwZF8md7Cv43RvC1HENm7EEpCqPme8DLm2aCFdCdi2L_zjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment