Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#142 closed defect (duplicate)

tutorial 1 bug in init --settings

Reported by: Jason Huggins Owned by: jacob
Component: Documentation Version:
Severity: normal Keywords: tutorial django-admin init settings
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In tutorial1, rev 253, line 77:
django-admin.py init --settings='myproject.settings.main'

should be:
django-admin.py init --settings=myproject.settings.main

With Windows XP, Python 2.4.1, Django rev 282, I get this error when the quotes are present:

C:\MyStuff\projects\django>c:\Python24\python.exe C:\Python24\Lib\site-packages\
django-1.0.0-py2.4.egg\django\bin\django-admin.py init --settings='myapp.setting
s.admin'
Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\bin\django-a
dmin.py", line 103, in ?
    main()
  File "C:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\bin\django-a
dmin.py", line 68, in main
    ACTION_MAPPING[action]()
  File "c:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\core\managem
ent.py", line 278, in init
    from django.core import db, meta
  File "c:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\core\db\__in
it__.py", line 16, in ?
    from django.conf.settings import DATABASE_ENGINE
  File "c:\Python24\Lib\site-packages\django-1.0.0-py2.4.egg\django\conf\setting
s.py", line 34, in ?
    raise EnvironmentError, "Could not import %s '%s' (is it on sys.path?): %s"
% (ENVIRONMENT_VARIABLE, me.SETTINGS_MODULE, e)
EnvironmentError: Could not import DJANGO_SETTINGS_MODULE ''myapp.settings.admin
'' (is it on sys.path?): No module named 'myapp.settings.admin'

When I remove the quotes, I don't get an error, and my database is initialized correctly.

C:\MyStuff\projects\django>c:\Python24\python.exe C:\Python24\Lib\site-packages\
django-1.0.0-py2.4.egg\django\bin\django-admin.py init --settings=myapp.settings
.admin

C:\MyStuff\projects\django>

Change History (1)

comment:1 Changed 10 years ago by Jason Huggins

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

Doh.. just realized this is a dupe of #141.

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