Code

Opened 6 years ago

Closed 5 years ago

#9155 closed (invalid)

Translations cause AdminSite and auth models trouble

Reported by: elwaywitvac Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Keywords: auth adminsite bug translations
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

This is a horrifically specific bug, so I mostly post this as a warning.

IF you have a custom "siteadmin" application that registers an AdminSite within the _init_.py which imports the django.contrib.auth.admin AND is labeled in INSTALLED_APPS as 'project.app_name', you will not be able to run the server.

However, if it isn't within init or just installed as app_name you're fine. That was a fun hour...

I'm attaching a broken project, just try to run the test server.

Things of note:

# urls.py
from siteadmin import my_site
urlpatterns = patterns('',
   (r'^admin/(.*)/', my_site.root),
)

# settings.py
INSTALLED_APPS = (
   'adminsitebug.siteadmin'.
   'django.contrib.admin',
   'django.contrib.auth',
   ...

Attachments (1)

adminsitebug.zip (3.8 KB) - added by elwaywitvac 6 years ago.
a demo project of the bug in ticket #9155

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by elwaywitvac

a demo project of the bug in ticket #9155

comment:1 Changed 6 years ago by garcia_marc

  • Component changed from Translations to django.contrib.admin
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

From my point of view, it's meaningless specifying the project name in the INSTALLED_APPS. The python path will include your project, so the application name is what you would import in your code.

Anyway I just change the component, so obviously it's not a translation related issue.

comment:2 Changed 5 years ago by jacob

  • Resolution set to invalid
  • Status changed from new to closed

I don't see what the bug is here other than a simple misunderstanding of how PYTHONPATH and import works. Please reopen -- and hit me with the cluestick -- if I'm wrong.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.