Index: django/conf/project_template/manage.py
===================================================================
--- django/conf/project_template/manage.py	(revision 3145)
+++ django/conf/project_template/manage.py	(working copy)
@@ -8,4 +8,6 @@
     sys.exit(1)
 
 if __name__ == "__main__":
-    execute_manager(settings)
+    import os
+    path = os.path.normpath(os.path.join(os.getcwd(), __file__))
+    execute_manager(settings, path)
Index: django/core/management.py
===================================================================
--- django/core/management.py	(revision 3145)
+++ django/core/management.py	(working copy)
@@ -1228,11 +1228,12 @@
         if action not in NO_SQL_TRANSACTION:
             print style.SQL_KEYWORD("COMMIT;")
 
-def execute_manager(settings_mod, argv=None):
+def execute_manager(settings_mod, manage_file, argv=None):
     # Add this project to sys.path so that it's importable in the conventional
     # way. For example, if this file (manage.py) lives in a directory
     # "myproject", this code would add "/path/to/myproject" to sys.path.
-    project_directory = os.path.dirname(settings_mod.__file__)
+    project_directory = os.path.dirname(manage_file)
+
     project_name = os.path.basename(project_directory)
     sys.path.append(os.path.join(project_directory, '..'))
     project_module = __import__(project_name, '', '', [''])
