1
0
mirror of https://github.com/django/django.git synced 2025-10-27 07:36:08 +00:00

Fixed #17920 -- Actually pass the full path of a newly created project or app in the template context as mentioned in the startproject docs. Many thanks to Preston Holmes for the initial patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17773 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2012-03-21 22:29:32 +00:00
parent 1101739668
commit 4219e2b7f8
4 changed files with 41 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python
import os, sys
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")

View File

@@ -89,8 +89,10 @@ class TemplateCommand(BaseCommand):
message = e
raise CommandError(message)
else:
top_dir = path.expanduser(target)
top_dir = os.path.abspath(path.expanduser(target))
if not os.path.exists(top_dir):
raise CommandError("Destination directory '%s' does not "
"exist, please create it first." % top_dir)
extensions = tuple(
handle_extensions(options.get('extensions'), ignored=()))