Opened 17 years ago

Closed 17 years ago

#6509 closed (duplicate)

django-admin startapp doesn't check for conflicts in naming

Reported by: David Sauve <dnsauve@…> Owned by: nobody
Component: Core (Other) Version: dev
Severity: Keywords: django-admin admin module error
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It is possible to create a new application using django-admin.py that has a name that will conflict with a module that already exists in the Python path.

This can be especially difficult for a newcomer to Python and Django to track down since the error messages generated do not indicate what when wrong, only that the key module symbols are missing.

I found this by creating an application called "calendar". Afterwards, the admin interface no longer worked for me because "isleap" was not defined in my version of "calendar", obviously.

However, I'm not sure how this could be prevented. Possibly the best solution would be to indicate the full path to the module (not) containing the required symbols? In my case, if the error had indicated that mysite.calendar did not define isleap, I would have realised my error right away!

Attachments (2)

6509.diff (862 bytes ) - added by Thomas Güttler 17 years ago.
Patch for startapp only, based on check in startproject.
startproject-startapp.patch (2.5 KB ) - added by Ivan Illarionov 17 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Thomas Güttler, 17 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

Yes, startapp and startproject should check invalid names (os, datetime, ...). I uploaded a patch.

comment:2 by James Bennett, 17 years ago

This was already fixed for startproject in [7320]; all that's needed is a quick copy of the patch into the startapp command.

by Thomas Güttler, 17 years ago

Attachment: 6509.diff added

Patch for startapp only, based on check in startproject.

comment:3 by Thomas Güttler, 17 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Ramiro Morales, 17 years ago

See #6654 for a similar simplification for startproject

by Ivan Illarionov, 17 years ago

Attachment: startproject-startapp.patch added

comment:5 by Thomas Güttler, 17 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #6654

Note: See TracTickets for help on using tickets.
Back to Top