﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19774	contentypes generic module has core functionality plus admins-specific one	Ramiro Morales	nobody	"(Copied from https://code.djangoproject.com/ticket/16368#comment:16)

The django/contrib/contenttypes/generic.py modules contains both the definitions of the model-related generic stuff (!GenericForeignKey, etc.) AND the admin app-related specialized inlines (!GenericInlineModelAdmin, !GenericStackedInline, !GenericTabularInline.)

So, for example, if you import `django.contrib.contenttypes.generic` from your models.py because you need !GenericForeignKey then the !GenericXInlineY sutff imports django.contrib.admin and it in its own turn imports contrib.sites causing the reported failure (see below). Again, the Sites framework isn't listed in INSTALLED_APPS and what is worse: The admin app isn't either (!).

Maybe it's time we move !GenericInlineModelAdmin, !GenericStackedInline, !GenericTabularInline from django.contrib.contenttypes.generic to, say, django.contrib.contenttypes.generic_admin? (of course this would need a deprecation process)

{{{
    from django.contrib.contenttypes import generic
  File ""django/contrib/contenttypes/generic.py"", line 14, in <module>
    from django.contrib.admin.options import InlineModelAdmin, flatten_fieldsets
  File ""django/contrib/admin/__init__.py"", line 6, in <module>
    from django.contrib.admin.sites import AdminSite, site
  File ""django/contrib/admin/sites.py"", line 4, in <module>
    from django.contrib.admin.forms import AdminAuthenticationForm
  File ""django/contrib/admin/forms.py"", line 4, in <module>
    from django.contrib.auth.forms import AuthenticationForm
  File ""django/contrib/auth/forms.py"", line 10, in <module>
    from django.contrib.sites.models import get_current_site
  File ""/django/contrib/sites/models.py"", line 5, in <module>
    raise Exception
}}}"	Bug	new	contrib.contenttypes	dev	Normal				Unreviewed	0	0	0	0	0	0
