#15631: There is no __file__ when settings.DEBUG = False
----------------------------+---------------------------
 Reporter:  belegnar        |         Owner:  belegnar
   Status:  new             |     Milestone:
Component:  Core framework  |       Version:  SVN
 Keywords:                  |  Triage Stage:  Unreviewed
Has patch:  0               |
----------------------------+---------------------------
 Processing admin.py with following code failed when DEBUG = False

 {{{
 from django.contrib import admin
 from django.contrib.auth.models import User

 import os.path

 app_name = os.path.basename(os.path.dirname(__file__))
 models_module = __import__('%s' % app_name).models
 models_list = [models_module.__dict__[model] for model in
 models_module.__dict__ \
                if type(models_module.__dict__[model]) == type(User) \
                and models_module.__dict__[model].__module__ == '%s.models'
 % app_name]
 admin.site.register(models_list)
 }}}

 because of __file__ = None. Working fine when DEBUG = True

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15631>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to