Background: I am new to Django and Python, having started on Windows this 
past December. Currently I am working in a Vagrant precise64 box, and 
wanted to import one of my old Windows apps which was done on sqlite3 to my 
current postgres. Once I got that done, Django told me I would need to run 
sqlcustom. So I did, and all I’ve been getting since is one error after 
another. 

The current error is:

django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, 
> but se
> ttings are not configured. You must either define the environment variable 
> DJANG
> O_SETTINGS_MODULE or call settings.configure() before accessing settings.

 I am working off Randall Degges’ django-skel with Django 1.5, so I have 
apps, settings, and requirements folders for prod, common, and dev. Prod is 
working fine on Heroku, where DJANGO SETTINGS MODULE is in the config vars.

Up until now, when I want to do something locally, I use 
–settings=mylocalsettings, which I got from the Two Scoops book and had 
been working fine, but not here. The sqlcustom command does not seem to 
accept or recognize this attempt to direct it to my local settings.

The error message tells me to either set DJANGO SETTINGS MODULE or 
configure(). I’ve never come across configure() before. Apparently it is 
different from –settings=mylocalsettings, but I can’t tell you how or why.

I don’t want to put DJANGO SETTINGS MODULE in my local environment because 
I don’t know what that would do to either my other projects or my Heroku 
settings. I am in a virtual environment, but does that isolate the 
environmental variables? Even if it does, what impact would this have on my 
Heroku settings for this project?

On the official docs, I found this either or message 
<https://docs.djangoproject.com/en/1.5/topics/settings/#either-configure-or-django-settings-module-is-required>.
 
But the same document allows for the TwoScoops way, which it calls ‘manual’.

I tried django-admin.py but then I got this:

ImportError: Could not import settings 'fed1.settings.dev' (Is it on 
> sys.path?):
>  No module named fed1.settings.dev

 Note that now there is no database or settings module issue. The path is 
correct – *IF *django-admin.py is looking at the directory I am in. I have 
manage.py but not django-admin.py, which I assume is buried somewhere else 
in Django itself.

 

Why isn’t manual working?

Where do I put configure()? At the top of settings.dev? 

Why was manage.py runserver not giving me any errors?

What do I do to get this working?

Bonus: Why don't the instructions also tell me to syncdb or run a migration?

thx.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3884e06b-0b32-4591-8ec1-b88ef17bc039%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to