I'm stuck at Step 2 (Database).

I've tried explicitly setting DJANGOSETTINGSMODULE to "osqa.settings" to no avail.

Any help is greatly appreciated.

Here's the error output:

(from the osqa dir) $ python manage.py syncdb Traceback (most recent call last): File "manage.py", line 4, in <module> import settings # Assumed to be in the same directory. File "/home/larubin/djangoprojects/osqa/settings.py", line 60, in <module> from settingslocal import * File "/home/larubin/djangoprojects/osqa/settingslocal.py", line 78, in <module> from forum.settings import * File "/home/larubin/djangoprojects/osqa/forum/settings/init.py", line 3, in <module> from forms import ImageFormWidget File "/home/larubin/djangoprojects/osqa/forum/settings/forms.py", line 2, in <module> from django import forms File "/usr/lib/python2.5/site-packages/django/forms/init.py", line 17, in <module> from models import * File "/usr/lib/python2.5/site-packages/django/forms/models.py", line 6, in <module> from django.db import connections File "/usr/lib/python2.5/site-packages/django/db/init.py", line 14, in <module> if not settings.DATABASES: File "/usr/lib/python2.5/site-packages/django/utils/functional.py", line 281, in getattr self.setup() File "/usr/lib/python2.5/site-packages/django/conf/init.py", line 38, in _setup raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENTVARIABLE) ImportError: Settings cannot be imported, because environment variable DJANGOSETTINGSMODULE is undefined. Error: Can't find the file 'settings.py' in the directory containing 'manage.py'. It appears you've customized things. You'll have to run django-admin.py, passing it your settings module. (If the file settings.py does indeed exist, it's causing an ImportError somehow.)

asked 16 Apr '10, 02:08

larubin's gravatar image

larubin
31123
accept rate: 100%

edited 16 Apr '10, 12:49


This issued is RESOLVED.

Something was wrong with my Django installation. After reinstalling Django, I am able to proceed.

link

answered 16 Apr '10, 12:35

larubin's gravatar image

larubin
31123
accept rate: 100%

Looks like there is some kind of error in your settings file that's causing an import error. Have you renamed settingslocal.py.dist to settingslocal.py?

link

answered 16 Apr '10, 05:47

Hernani%20Cerqueira's gravatar image

Hernani Cerq... ♦♦
16.8k65975
accept rate: 52%

Yes. I have renamed settings_local_py.dist to settings_local.py.

The DJANGO_SETTINGS_MODULE problem seems to be a symptom of a larger problem related to the search path. The current working directory from which "python manage.py syncdb" is called does not seem to be on that path.

(16 Apr '10, 11:50) larubin
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×156
×13

Asked: 16 Apr '10, 02:08

Seen: 1,305 times

Last updated: 16 Apr '10, 12:49

powered by OSQA