Being new to Django (but not new to programming) I liked the idea of a project that does a lot with very little code.

So I wanted to get this working.

But I kept getting an error about not being able to import the settings file. Maybe you have some idea of what I'm doing wrong.

I started with this:

django-admin.py starproject univ

which generated the appropriate directory and files. Then I replaced the settings.py that django generated with the one that you provided on this page.

Then I used your command:

django-admin.py runserver --settings="settings"

I received the error about not being able to import the settings file, so after googling around a bit, I created an environment variable in Windows called PYTHONPATH to point to my django-apps folder which contains my univ app. Then I created a DJANGO_MODULE_SETTINGS environment variable and set it to univ.settings.

No luck.

I deleted the DJANGO_MODULE_SETTINGS and tried pointing the PYTHONPATH variable directly at the django-apps/univ folder instead of the folder one level up.

Still no luck.

By the way, I'm using xp, django 0.96 and Python 2.5 - don't know if that makes any difference. If you have any suggestions, I would appreciate it - thought this looked pretty cool and would love to get it running.

— Wilcox (December 11, 2008 at 2:27 p.m.)

Hey Wilcox,

You shouldn't need to start a projct or set PYTHON_PATH or anything.

If the django-admin command isn't working, you could try running python in the dir that settings.py is in. You should be able to "import settings" from the python shell. That would at least tell you if python can find the file.

— Sam (December 12, 2008 at 9:59 a.m.)

Yes, python can find the file. I deleted the PYTHONPATH variable and the DJANGO_SETTINGS_MODULE as you suggested. I put your settings.py in a directory with nothing else in it.

When I do "import settings" from the python shell, python finds settings.py but I get a traceback which indicates that the environment variable DJANGO_SETTINGS_MODULE is not defined. (The traceback is down below)

Then I tried dozens of variations of adding and removing different folders from the DJANGO_SETTINGS_MODULE and PYTHONPATH variables to see if I could get it to work but nothing seemed to help.

Any suggestions would be appreciated.

Thanks.

import settings Traceback (most recent call last): File "[HTML_REMOVED]", line 1, in [HTML_REMOVED] File "settings.py", line 3, in [HTML_REMOVED] from django import forms File "C:Python25Libsite-packagesdjangoforms_init_.py", line 1, in [HTML_REMOVED] from django.oldforms import * File "C:Python25Libsite-packagesdjangooldforms_init_.py", line 1, in [HTML_REMOVED] from django.core import validators File "C:Python25libsite-packagesdjangocorevalidators.py", line 13, in [HTML_REMOVED] from django.utils.translation import gettext, gettext_lazy, ngettext File "C:Python25Libsite-packagesdjangoutilstranslation_init_.py", line 3, in [HTML_REMOVED] if settings.USE_I18N: File "C:Python25Libsite-packagesdjangoconf_init_.py", line 28, in getattr self._import_settings() File "C:Python25Libsite-packagesdjangoconf_init_.py", line 53, in importsettings raise EnvironmentError, "Environment variable %s is undefined." % ENVIRONMENT_VARIABLE EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined.

— Wilcox (December 14, 2008 at 3:47 p.m.)

How peculiar.

I just tried copying the code of the post into settings.py, and it worked for me.

I'm sorry for playing the OS card, but I wonder if this is a different between Windows and Ubuntu.

I'd be happy to continue troubleshooting this with you. Drop me a line. sam -at- pocketuniverse.ca

— Sam (December 17, 2008 at 10:57 a.m.)

Pitures Of Drugs [HTML_REMOVED]viagra for sale[HTML_REMOVED] Viagra has a bioavailability of 40%, hepatic metabolism, a half life of 3 to 4 hours, fecal excretion of around 80%, renal excretion of around 13%, is available by prescription only, and is given through oral administration. [HTML_REMOVED]buy sildenafil online[HTML_REMOVED] Viagra has a bioavailability of 40%, hepatic metabolism, a half life of 3 to 4 hours, fecal excretion of around 80%, renal excretion of around 13%, is available by prescription only, and is given through oral administration. http://www.macautocenter.com/ - cheap viagra Viagra is a drug that can help you get your private part machinery working again so that erectile dysfunction doesn’t dominate your activity in the bedroom.

moraEronnacor (July 08, 2011 at 8:10 a.m.)

wance

Wroca (March 18, 2012 at 4:21 p.m.)

Hello! adakfkf interesting adakfkf site! I'm really like it! Very, very adakfkf good!

Pharme559 (August 03, 2012 at 9:49 a.m.)

Hello! , , , , ,

cialis (October 25, 2012 at 10:32 p.m.)

Hello! , , , ,

viagra (October 29, 2012 at 6:45 a.m.)

Hello! ebagbdb interesting ebagbdb site! I'm really like it! Very, very ebagbdb good!

Pharmd78 (October 29, 2012 at 9:34 p.m.)

Very nice site!

Pharmd531 (October 29, 2012 at 9:34 p.m.)

Hello! , , , , ,

cialis (November 01, 2012 at 5:37 a.m.)

Hello! , , , , ,

for (November 05, 2012 at 11:55 p.m.)

Hello! , , , ,

viagra (November 06, 2012 at 2:14 a.m.)

Hello! , , , , ,

cialis (November 07, 2012 at 12:43 a.m.)

Hello! , , ,

cialis (November 08, 2012 at 11:44 p.m.)

Hello! , , , ,

fast (November 14, 2012 at 12:49 a.m.)

Hello! , , , ,

cialis (November 23, 2012 at 6:38 a.m.)

Hello! , , , ,

cialis (November 28, 2012 at 6:46 a.m.)

Hello!

cialis (April 15, 2014 at 2:23 a.m.)

Hello!

natural_viagra (April 15, 2014 at 2:23 a.m.)

Hello!

to (April 16, 2014 at 4:19 p.m.)

Hello!

cialis (April 16, 2014 at 4:23 p.m.)

Hello!

fast (April 17, 2014 at 7:01 p.m.)

Hello!

free_viagra (April 17, 2014 at 7:01 p.m.)

Hello!

generic_cialis (April 18, 2014 at 8:47 p.m.)

Hello!

generic (April 22, 2014 at 9:20 a.m.)

Hello!

cialis (April 23, 2014 at 2:37 a.m.)

Hello!

cialis (April 24, 2014 at 10:21 p.m.)

Hello!

to (April 27, 2014 at 1:07 a.m.)

Hello!

generic (April 28, 2014 at 3:08 a.m.)

Hello!

overnight (April 28, 2014 at 9:32 p.m.)

Hello!

online (April 29, 2014 at 9:17 p.m.)

Hello!

cialis (April 29, 2014 at 9:18 p.m.)

Hello!

erection (May 01, 2014 at 9:12 p.m.)

Hello!

cheap_viagra (May 06, 2014 at 3:13 p.m.)

Hello!

to (May 10, 2014 at 3:14 a.m.)

Hello!

viagra (May 10, 2014 at 3:14 a.m.)

Hello!

by (May 10, 2014 at 4:13 p.m.)

Hello!

viagra (May 11, 2014 at 12:17 a.m.)

Hello!

cialis (May 11, 2014 at 12:17 a.m.)

Hello!

site (May 11, 2014 at 12:17 a.m.)

Hello!

pills (May 14, 2014 at 11:05 a.m.)

Hello!

pills (May 14, 2014 at 11:05 a.m.)

Hello!

viagra (May 14, 2014 at 6:10 p.m.)

Hello!

cialis (May 14, 2014 at 6:10 p.m.)

Hello!

by (May 15, 2014 at 6:54 a.m.)

Hello!

viagra (May 15, 2014 at 6:54 a.m.)

Hello!

pills (May 15, 2014 at 3:51 p.m.)

Hello!

viagra (May 15, 2014 at 3:51 p.m.)

Hello!

online (May 15, 2014 at 3:51 p.m.)

Hello!

cialis (May 15, 2014 at 4:12 p.m.)

Hello!

viagra (May 17, 2014 at 11:31 a.m.)

Hello!

generic (May 17, 2014 at 2:29 p.m.)

Hello!

cialis (May 19, 2014 at 11:54 p.m.)

Hello!

buy_cialis (May 24, 2014 at 7:58 p.m.)

Hello!

cialis (May 27, 2014 at 7:00 a.m.)

Hello!

order (May 28, 2014 at 7:31 p.m.)

Hello!

cheap (May 28, 2014 at 8:29 p.m.)

Hello!

cheap (May 28, 2014 at 8:29 p.m.)

Hello!

cialis (May 30, 2014 at 6:25 a.m.)

Hello!

cialis (May 30, 2014 at 8:31 p.m.)

Hello!

cheap_viagra (May 30, 2014 at 8:31 p.m.)

Hello!

viagra (June 01, 2014 at 4:22 p.m.)

Hello!

price (June 01, 2014 at 4:22 p.m.)

Hello!

price (June 01, 2014 at 4:22 p.m.)

Hello!

generic (June 02, 2014 at 1:45 p.m.)

Hello!

1 (June 05, 2014 at 6:33 a.m.)

Hello!

uk (June 05, 2014 at 6:34 a.m.)

Hello!

1 (June 05, 2014 at 6:34 a.m.)

Hello!

viagra (June 05, 2014 at 9:01 a.m.)

Hello!

online (June 06, 2014 at 7:38 a.m.)

Hello!

buy_cialis (June 06, 2014 at 7:39 a.m.)

Hello!

viagra (June 07, 2014 at 4:14 p.m.)

Hello!

cialis (June 07, 2014 at 4:15 p.m.)

Hello!

buying_viagra (June 08, 2014 at 3:25 p.m.)

Hello!

cialis (June 09, 2014 at 10:54 a.m.)

Hello!

from (June 09, 2014 at 10:55 a.m.)

Hello!

cialis (June 12, 2014 at 2:02 a.m.)

Hello!

to (June 12, 2014 at 2:02 a.m.)

Hello!

cialis (June 12, 2014 at 2:03 a.m.)

Hello!

online (June 12, 2014 at 3:08 a.m.)

Hello!

in (June 13, 2014 at 6:39 a.m.)

Hello!

cialis (June 14, 2014 at 2:44 p.m.)

Hello!

order (June 15, 2014 at 5:03 p.m.)

Hello!

cialis (June 15, 2014 at 5:03 p.m.)

Hello!

order (June 15, 2014 at 5:03 p.m.)

Hello!

generic (June 16, 2014 at 9:16 p.m.)

Hello!

cialis (June 17, 2014 at 2:35 a.m.)

Hello!

cialis (June 18, 2014 at 7:13 a.m.)

Hello!

cheap_viagra (June 18, 2014 at 11:51 a.m.)

Hello!

pharmacy (June 19, 2014 at 12:06 a.m.)

Hello!

viagra (June 20, 2014 at 8:08 a.m.)

Hello!

cialis_online (June 20, 2014 at 8:09 a.m.)

Hello!

cialis (June 21, 2014 at 12:58 a.m.)

Hello!

to (June 22, 2014 at 5:02 p.m.)

Hello!

online (June 23, 2014 at 7:35 p.m.)

Hello!

with (June 26, 2014 at 12:37 p.m.)

Hello!

purchase_viagra (June 27, 2014 at 9:26 p.m.)

Hello!

viagra_pills (June 27, 2014 at 9:27 p.m.)

Hello!

viagra (July 02, 2014 at 11:59 p.m.)

Hello!

generic_cialis (July 03, 2014 at 7:39 a.m.)

Hello!

cialis (July 03, 2014 at 12:04 p.m.)

Hello!

generic_viagra (July 03, 2014 at 10:57 p.m.)

Hello!

viagra_dosage (July 04, 2014 at 11:19 p.m.)

Hello!

generic_viagra (July 04, 2014 at 11:19 p.m.)

Hello!

from (July 05, 2014 at 1:46 a.m.)

Hello!

online (July 10, 2014 at 2:19 p.m.)

Hello!

blog (July 10, 2014 at 2:19 p.m.)

Hello!

6 (July 15, 2014 at 11:39 a.m.)

Hello!

generic_cialis (July 15, 2014 at 11:49 p.m.)

Hello!

generic_viagra (July 15, 2014 at 11:49 p.m.)

Hello!

cialis (July 16, 2014 at 3:46 p.m.)

Hello!

viagra (July 16, 2014 at 4:47 p.m.)

Hello!

viagra (July 16, 2014 at 4:53 p.m.)

Hello!

generic_cialis (July 17, 2014 at 5:25 a.m.)

Hello!

generic_viagra (July 17, 2014 at 5:25 a.m.)

Hello!

cialis (July 18, 2014 at 3:16 a.m.)

Hello!

suppliers (July 18, 2014 at 3:16 a.m.)

Hello!

suppliers (July 18, 2014 at 3:17 a.m.)

Hello!

fast (July 21, 2014 at 6:35 p.m.)

Hello!

lowest (July 22, 2014 at 11:00 a.m.)

Hello!

viagra (July 22, 2014 at 11:00 a.m.)

Hello!

generic (July 23, 2014 at 11:26 a.m.)

Hello!

to (July 23, 2014 at 11:27 a.m.)

Hello!

to (July 23, 2014 at 2:04 p.m.)

Hello!

for (July 24, 2014 at 4:21 a.m.)

Hello!

cialis_online (July 24, 2014 at 3:38 p.m.)

Hello!

fast (July 24, 2014 at 3:38 p.m.)

Hello!

fast (July 24, 2014 at 3:39 p.m.)

Hello!

cialis_online (July 25, 2014 at 2:30 a.m.)

Hello!

cialis (July 25, 2014 at 1:39 p.m.)

Hello!

buy_cialis (July 25, 2014 at 4:23 p.m.)

Hello!

generic_cialis (July 29, 2014 at 7:37 p.m.)

Hello!

generic (July 30, 2014 at 2:47 p.m.)

Hello!

generic (July 30, 2014 at 2:48 p.m.)

Hello!

fast (August 01, 2014 at 4:08 a.m.)

Hello!

cheap_viagra (August 01, 2014 at 6:08 a.m.)

Hello!

viagra (August 02, 2014 at 5:25 a.m.)

Hello!

cialis (August 02, 2014 at 5:25 a.m.)

Hello!

tadalafil (August 02, 2014 at 5:25 a.m.)

Hello!

viagra (August 05, 2014 at 8:13 a.m.)

Hello!

buy_cialis (August 06, 2014 at 1:15 a.m.)

Hello!

cialis (August 06, 2014 at 1:15 a.m.)

Hello!

herbal (August 06, 2014 at 3:33 a.m.)

Hello!

cialis (August 07, 2014 at 7:27 a.m.)

Hello!

generic_cialis (August 08, 2014 at 6:00 p.m.)

Hello!

viagra (August 09, 2014 at 8:18 a.m.)

Hello!

viagra (August 09, 2014 at 8:19 a.m.)

Hello!

viagra (August 13, 2014 at 3:00 a.m.)

Hello!

cialis (August 13, 2014 at 3:00 a.m.)

Hello!

credit (August 13, 2014 at 12:39 p.m.)

Hello!

credit (August 13, 2014 at 12:39 p.m.)

Hello!

order (August 13, 2014 at 12:39 p.m.)

Hello!

cialis (August 13, 2014 at 12:39 p.m.)

Hello!

buy_cialis (August 13, 2014 at 9:29 p.m.)

Hello!

cialis (August 13, 2014 at 9:30 p.m.)

Hello!

loan (August 14, 2014 at 6:10 a.m.)

Hello!

cash (August 14, 2014 at 6:10 a.m.)

Hello!

payday (August 14, 2014 at 6:11 a.m.)

Hello!

cheap_viagra (August 14, 2014 at 11:11 a.m.)

Hello!

generic (August 14, 2014 at 7:20 p.m.)

Hello!

viagra (August 14, 2014 at 11:59 p.m.)

Hello!

cialis_online (August 15, 2014 at 12:00 a.m.)

Hello!

viagra (August 15, 2014 at 8:02 p.m.)

Hello!

order_viagra (August 19, 2014 at 7:20 p.m.)

Hello!

generic_cialis (August 21, 2014 at 12:35 a.m.)

Hello!

falls (August 21, 2014 at 2:54 p.m.)

Hello!

viagra (August 22, 2014 at 8:35 p.m.)

Hello!

cash (August 23, 2014 at 4:34 a.m.)

Hello!

advance (August 23, 2014 at 4:34 a.m.)

Hello!

generic_cialis (August 23, 2014 at 8:40 a.m.)

Hello!

viagra (August 23, 2014 at 8:40 a.m.)

Hello!

cialis (August 23, 2014 at 8:40 a.m.)

Hello!

cialis (August 25, 2014 at 8:19 a.m.)