Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#20254 closed Uncategorized (needsinfo)

startproject command - need better error message

Reported by: dhivya23 Owned by: nobody
Component: Core (Management commands) Version: 1.3
Severity: Normal Keywords:
Cc: bmispelon@…, dhivya23, t.l.krajca@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


can startproject command throw a more useful error message ?
When I already have started a project called 'companyweb' and have set env variable, DJANGO_SETTINGS_MODULE to its settings file, and I do, startproject mysite

Unknown command: 'startproject'
Type ' help' for usage

Can this message say something like,
"Unknown command: 'startproject'. Project 'companyweb' is the current project. "

Change History (6)

comment:1 Changed 5 years ago by Baptiste Mispelon

Cc: bmispelon@… added
Component: UncategorizedCore (Management commands)
Resolution: needsinfo
Status: newclosed


Could you provide some mode details on how to reproduce this?

The starproject command should normally always be available regardless of which settings you're using.

I've tried both with and to create a new project inside an existing one (with the DJANGO_SETTINGS_MODULE env var set), but it succeeded each time.

I'm closing this as needsinfo. Please reopen if you have more information on how to reproduce this issue.


comment:2 Changed 5 years ago by Tomas Krajca


I think this has been fixed in commit a9a0f0b03f9a02deb03617bf7e9773a307d1328f (django 1.4). The 'startproject' and 'startapp' commands are not disabled any more when specifying a settings module.

$ git diff 20c8aa2a2029be50449b25122f85bbef0f2b957f a9a0f0b03f9a02deb03617bf7e9773a307d1328f django/core/management/
diff --git a/django/core/management/ b/django/core/management/
index 7e8eebd..3672639 100644
--- a/django/core/management/
+++ b/django/core/management/
@@ -77,9 +77,7 @@ def get_commands():
     in that package are registered.
     Core commands are always included. If a settings module has been
-    specified, user-defined commands will also be included, the
-    startproject command will be disabled, and the startapp command
-    will be modified to use the directory in which the settings module appears.
+    specified, user-defined commands will also be included.
     The dictionary is in the format {command_name: app_name}. Key-value
     pairs from this dictionary can then be used in calls to

I hope this helps.

Last edited 5 years ago by Tomas Krajca (previous) (diff)

comment:3 Changed 5 years ago by dhivya23


Thanks for looking into this. I am using django version 1.3.1 . I was following this particular versions documentation,

If it is fixed in 1.4, can the 1.3 documentation have a note about the DJANGO_SETTINGS_MODULE env variable ? I can submit a documentation change patch for this.


comment:4 Changed 5 years ago by dhivya23

Cc: dhivya23 added
Version: 1.41.3

comment:5 Changed 5 years ago by Tomas Krajca


The DJANGO_SETTINGS_MODULE env variable in relation to startproject is mentioned in (for 1.3, 1.2, 1.1 and also 1.0).

This issue has also been discussed and fixed to the satisfaction of the core team before -, or

comment:6 Changed 5 years ago by Tomas Krajca

Cc: t.l.krajca@… added
Note: See TracTickets for help on using tickets.
Back to Top