Opened 9 years ago

Closed 9 years ago

#4543 closed (duplicate) startapp and startproject should help newbies avoid module name clash

Reported by: jdunck Owned by: adrian
Component: Core (Management commands) Version: master
Severity: Keywords: newbie
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Fairly often, newbies name their first Django project "site", which
breaks python's built-in site package, disabling packages and .pth's
in site-packages.


Perhaps Django should validate that the thing you supply to startapp
and startproject aren't named something that's already importable, or in the regular library paths, or similar, issuing an error something like this:

The name you've given the project, "site", clashes with the existing module "site" located at "/usr/lib/python2.5/".  
This is likely to cause confusion when importing the modules.  Please choose another name or use the --force flag to continue.
For more info, see the Python Tutorial section on modules:

As a real-world example, in the thread below, a person had the misfortune of naming an app "calendar", and then trying to use the python built-in calendar module from the wrong directory:

Forwarded Conversation
Subject: App Migration: ImportError @ isleap

From: Justin Lilly <>

Reply-To: django-users@…
To: Django users <django-users@…>
Date: Mon, Jun 11, 2007 at 12:33 PM

Hi all.

I have a little calendar working based on a django snippet from

masida_ in #django (Freenode).

It seems to be having a problem with the isleap function. I've
imported both calendar and datetime, so I'm not sure what the problem

From: Justin Lilly <justinlilly@…>

Reply-To: django-users@…
To: Django users <django-users@…>
Date: Mon, Jun 11, 2007 at 5:41 PM

For archival purposes, the reason it wasn't working is I had named one of my apps "calendar". After I renamed it to agenda and remapped it appropriately, everything was in working order.

Change History (1)

comment:1 Changed 9 years ago by SmileyChris

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

Dupe of #3475

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