Aymeric Augustin
unread,Jan 26, 2014, 7:54:09 AM1/26/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-d...@googlegroups.com
Hello,
Django ≥ 1.7 recommends to define AppConfig subclasses for a given application in apps.py.
If the application also imports the app registry in its __init__.py with `from django.apps import apps`, this definition of `apps` will conflict with the `apps` submodule.
I’ve worked around this problem in django.contrib.auth and django.contrib.comments (which is deprecated) with: `from django.apps import apps as django_apps`.
If anything, this is one more reason why it’s a bad idea to put code in __init__.py. Given that we have a simple workaround, I’m inclined to simply ignore this pitfall.
If someone has a better idea, let me know!
--
Aymeric.