pength wrote:

> I think it's a common way in C or C++ project to do like this, just
> don't know how to do it in Django. I have tried to put
> "MAX_UNIT_FOR_ONE_USER  = 100" in the settings.py, and used it in
> views, but got an error as "global name MAX_UNIT_FOR_ONE_USER  not
> defined", etc...

This works, but when you use the constants, you first have to import
the settings, by doing:

    from django.conf import settings

and then you when you use it, you need to refer to it as
"settings.MAX_UNIT_FOR_ONE_USER".

- Terry


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to