Setting an environment variable is done by saying something like:

lightning@rigel5:~$ export DJANGO_SETTINGS_MODULE='mysite.settings'

assuming that your settings.py file is in a directory named "mysite", in
turn in the current directory (your home directory, if I interpret your
prompt string correctly).  Then that command may work.

But that's the painful way to do that.  Presumably there is a file named
manage.py either in the same directory as settings.py (older Djangos) or
one directory up (newer Djangos).  'cd' to the directory containing
manage.py and type:

lightning@rigel5:pathToDirectoryContainingManage_py$ python manage.py
diffsettings

If you look at manage.py with 'less' or with an editor, you will see that
it sets the DJANGO_SETTINGS_MODULE environment variable (though using
python code, rather than shell code) appropriately (for use from the
current directory) before doing other stuff.

For my money, django-admin.py should only ever be used for its startproject
command.  Everything else should be done with manage.py after cd'ing to the
directory that contains it (or from a wsgi script, which also sets the
DJANGO_SETTINGS_MODULE environment variable and adjusts sys.path to be sure
that the directory containing manage.py is there, but that will come much
later for you, I think).

Bill

On Thu, Mar 21, 2013 at 1:13 PM, Lightning <hughmanch...@gmail.com> wrote:

>
>
> On Wednesday, March 20, 2013 11:50:49 PM UTC-7, Lightning wrote:
>>
>>
>> <http://stackoverflow.com/questions/15538277/i-encountered-a-core-exception-and-need-help-configuring-for-a-database-my-os-i#>
>> **
>>
>> [image: enter image description here]I need help configuring for a
>> database. Is there a paper I can read that will give me an overview on this
>> procedure? I encountered a core exception. My OS is Ubuntu 12.10 32 bit.
>>
>> ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
>> class LazySettings(LazyObject):
>>     """
>>     A lazy proxy for either global Django settings or a custom settings 
>> object.
>>     The user can manually configure settings prior to using them. Otherwise,
>>     Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.
>>     """
>>
>>
>
>
>  ImproperlyConfigured: Requested setting USE_I18N, but settings are not
> configured. You must either define the environment variable
> DJANGO_SETTINGS_MODULE or call settings.configure() before accessing
> settings.
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to