On Tue, 2008-02-12 at 05:35 -0800, Julien wrote: > Hi there, > > I'm trying import a class definition in settings.py with: > from myapp.models import MyModel
Oh, don't do that. Very bad. :-( Importing models means they start to get registered with the app_cache (to track reverse relations, amongst other things), which means we need to know about other applications, which is specified in a setting, which is in the settings file. Spot the circular dependency. In settings.py, you can't really expect to use anything from Django itself. You can write arbitrary Python code that talks to other parts of your system or whatever, but large portions of the core of Django requires settings to have been fully imported before they can be used. So you cannot use them inside settings itself. Perhaps if you explain what you're trying to achieve we could suggest an alternate route. Regards, Malcolm -- I don't have a solution, but I admire your problem. http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---