DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings.
Instead of just copy-pasting an error message, try to learn how to ask a
question someone has a chance to answer.
Reading something like this will help solve your problem:
https://www.propublica.org/nerds/how-to-ask-programming
*I am getting this error *
*please solve any one thanks in advance.*
django.core.exceptions.ImproperlyConfigured: Requested setting
REST_FRAMEWORK, but settings are not configured. You must either define the
environment variable DJANGO_SETTINGS_MODULE or call settings.configure()
before
trated a new django project in a venv using django 3.0 and seems
> that DJANGO_SETTINGS_MODULE is not set when running django-admin runserver
>
> Enter code here.(test1)
> ioana.i@ioana-spamexperts:~/Workspace/Ioana/test1/test1$
>> django-admin runserver
>> Traceback (mos
DJANGO_SETTINGS_MODULE is not the problem I guess, as its not there even in my
settings.py. Did you define your app in apps settings?
Regards,
Amitesh
On Friday, 24 April, 2020, 06:45:43 pm IST, Raja Sekar Sambath
wrote:
Yes I'm
On Fri, 24 Apr 2020 at 18:30, DANIEL URBANO DE LA
uot;/home/ioana.i/Workspace/Ioana/test1/lib/python3.6/site-packages/django/core/management/commands/runserver.py",
>>>> line 67, in handle
>>>> if not settings.DEBUG and not settings.ALLOWED_HOSTS:
>>>> File
>>>> "/home/ioana.i/Workspace/
i/Workspace/Ioana/test1/lib/python3.6/site-packages/django/core/management/commands/runserver.py",
>>> line 67, in handle
>>> if not settings.DEBUG and not settings.ALLOWED_HOSTS:
>>> File
>>> "/home/ioana.i/Workspace/Ioana/test1/lib/python3.6/site-packages/django/conf
te-packages/django/core/management/commands/runserver.py",
>> line 67, in handle
>> if not settings.DEBUG and not settings.ALLOWED_HOSTS:
>> File
>> "/home/ioana.i/Workspace/Ioana/test1/lib/python3.6/site-packages/django/conf/__init__.py",
>> line 76,
gt; line 67, in handle
>> if not settings.DEBUG and not settings.ALLOWED_HOSTS:
>> File
>> "/home/ioana.i/Workspace/Ioana/test1/lib/python3.6/site-packages/django/conf/__init__.py",
>> line 76, in __getattr__
>> self._setup(name)
>> File
>> &
ine 76, in __getattr__
> self._setup(name)
> File
> "/home/ioana.i/Workspace/Ioana/test1/lib/python3.6/site-packages/django/conf/__init__.py",
>
> line 61, in _setup
> % (desc, ENVIRONMENT_VARIABLE))
> django.core.exceptions.ImproperlyConfigured: Requested
na/test1/lib/python3.6/site-packages/django/conf/__init__.py",
line 61, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but
settings are not configured. You must either define the environment
variable DJANGO_SETTINGS_MODULE
seems
> that DJANGO_SETTINGS_MODULE is not set when running django-admin runserver
>
> Enter code here.(test1)
> ioana.i@ioana-spamexperts:~/Workspace/Ioana/test1/test1$
>> django-admin runserver
>> Traceback (most recent call last):
>> File "/home/ioana.i/Worksp
Hi,I'm new with django and python.
I just strated a new django project in a venv using django 3.0 and seems
that DJANGO_SETTINGS_MODULE is not set when running django-admin runserver
Enter code here.(test1)
> ioana.i@ioana-spamexperts:~/Workspace/Ioana/test1/test1$ django-admin
> run
I am trying to get a new server up and running and I am make a n00b error
somewhere.
django.core.exceptions.ImproperlyConfigured: Requested setting MIDDLEWARE, but
settings are not configured. You must either define the environment variable
DJANGO_SETTINGS_MODULE or call settings.configure
e-packages\rest_framework\authtoken\models.py",
>>> line 17, in Token
>>> settings.AUTH_USER_MODEL, related_name='auth_token',
>>> File "C:\Python\lib\site-packages\django\conf\__init__.py", line 57,
>>> in __getattr__
>>> sel
H_USER_MODEL, related_name='auth_token',
>> File "C:\Python\lib\site-packages\django\conf\__init__.py", line 57, in
>> __getattr__
>> self._setup(name)
>> File "C:\Python\lib\site-packages\django\conf\__init__.py", line 42, in
>> _setup
>>
", line 42, in
> _setup
> % (desc, ENVIRONMENT_VARIABLE))
> django.core.exceptions.ImproperlyConfigured: Requested setting
> AUTH_USER_MODEL, but settings are not configured. You must either define
> the environment variable DJANGO_SETTINGS_MODULE or call
> settings.conf
e)
>File "C:\Python\lib\site-packages\django\conf\__init__.py", line 42, in
>
>_setup
>% (desc, ENVIRONMENT_VARIABLE))
>django.core.exceptions.ImproperlyConfigured: Requested setting
>AUTH_USER_MODEL, but settings are not configured. You must either
>define
>the env
USER_MODEL, 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 unsubs
bundled with.
https://docs.djangoproject.com/en/1.11/topics/settings/#envvar-DJANGO_SETTINGS_MODULE
On Thursday, May 17, 2018 at 12:09:33 AM UTC-3, Utpal Brahma wrote:
>
> under manage.py
>
>
>
>
>
> #!/usr/bin/env python
> import os
> import sy
under manage.py
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
try:
from django.core.management import execute_from_command_line
except ImportErr
r i have bug
> like below
>
>
> django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but
>> settings are not configured. You must either define the environment
>> variable DJANGO_SETTINGS_MODULE or call settings.configure() before
>> accessing settings.
&
ine the environment
> variable DJANGO_SETTINGS_MODULE or call settings.configure() before
> accessing settings.
>
>
In Run Configuration in environment paramets I have DJANGO_SETTINGS_MODULE
with mysite.settings, wsgi and manage also have this info, where can I
check it else...
-
On Mar 7, 2016 9:37 PM, "Dariusz Mysior" wrote:
>
> When I use Console system it work's using manage shell and next import
but in PyCharm Edu 2 in Python Console I have this message like below I
wright. In PyCharm Ipython run automaticly I am not using manage shell
environ.setdefault("DJANGO_SETTINGS_MODULE", "biblio.settings")
>
> where biblio is my main project name
>
>
>
> Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not
>> configured. You must either define the environment variable
>>
anage.py I have line
>
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "biblio.settings")
>
> where biblio is my main project name
>
>
>
> Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not
>> configured. You must either
I use Django 1.8 Python 3.4.3 and I have problem when i go to Ipython or
Python and I try use command from contact.forms import MessageForm2 I have
a error like below. I add that in wsgi.py and manage.py I have line
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "biblio.se
nment variable DJANGO_SETTINGS_MODULE or call
settings.configure() before accessing settings."
Red faced embarrassment - I had inadvertently switched from
python manage.py to django-admin runserver
Bob Gailer
--
You received this message because you are subscribed to the Google Groups &quo
> After several days of running my server with no problem I am suddenly
confronted with:
>
> "django.core.exceptions.ImproperlyConfigured: Requested setting
DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either
define the environment variable DJANGO_SETTINGS_
After several days of running my server with no problem I am suddenly
confronted with:
"django.core.exceptions.ImproperlyConfigured: Requested setting
DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must
either define the environment variable DJANGO_SETTINGS_MODULE or
On Sun, Mar 8, 2015 at 5:21 AM, Dheerendra Rathor
<dheeru.ratho...@gmail.com> wrote:
> I've a django project and I've few models like ChatRoom and Chat etc
>
> I'm accessing the ChatRooms from commandline using ipython as follow
> In [1]: import os
>
> In [2]: os.environ
Rathor wrote:
>
> I've a django project and I've few models like ChatRoom and Chat etc
>
> I'm accessing the ChatRooms from commandline using ipython as follow
> In [1]: import os
>
> In [2]: os.environ['DJANGO_SETTINGS_MODULE'] = 'chat_project.settings'
>
> In [3]: f
I've a django project and I've few models like ChatRoom and Chat etc
I'm accessing the ChatRooms from commandline using ipython as follow
In [1]: import os
In [2]: os.environ['DJANGO_SETTINGS_MODULE'] = 'chat_project.settings'
In [3]: from chat.models import Chat, ChatRoom
In [4
It looks like you are typing "*django-admin.py startproject WebSite*" at
the python prompt, which is incorrect. You type it at the shell. If you
get command not found, then instead type "python
full/path/to/django-admin.py startproject WebSite". And in any case, the
current directory must be
Hello
i have sesinstalled django and re installed withdebian package
when i lauch command django-admin.py startproject website here is what i
get:
*python3.4Python 3.4.2 (default, Dec 27 2014, 13:16:08) [GCC 4.9.2] on
linuxType "help", "copyright", "credits" or "license" for more
Hello
i have just installed django 1.7 on Debian jessie via synaptic
when i start a console,
import django is OK
print(django.get_version()) ---> version 1.7.2
Now i try to launch the command "django-admin.py startproject WebSite"
i get the error:
*Traceback
I'm using Apache 2.4 and Python 2.6.8. We have several different virtual
hosts and the DJANGO_SETTINGS_MODULE is defined within each virtual host.
However, the wsgi file gets loaded before the settings.py file. This
works fine under Django 1.5.1 as settings aren't referenced from within
settings automatically - it
> automatically sets the environment variable DJANGO_SETTINGS_MODULE to
> the correct value.
>
> Cheers
>
> Tom
>
> ¹ Or standalone apps. For apps within the project, you use manage.py
> startapp, like everything else in the project.
>
--
You receive
> but while testing and pychecker i am getting this error how should i
> configure DJANGO_SETTINGS_MODULE
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails fro
y-and-manage-py
The reason you want to use manage.py over django-admin,py is that
manage.py can usually find your settings automatically - it
automatically sets the environment variable DJANGO_SETTINGS_MODULE to
the correct value.
Cheers
Tom
¹ Or standalone apps. For apps within the proj
when i am running the project it is running perfectly fine but when i am
trying to open django-admin.py shell the error:
ImproperlyConfigured: Requested setting USE_I18N, but settings are not
configured. You must either define the environment variable
DJANGO_SETTINGS_MODULE or call
)
>
> says that this should work, I always get the error:
>
> ImportError: Settings cannot be imported, because environment variable
> DJANGO_SETTINGS_MODULE is undefined.
>
> Anyone who can help with this?
>
> Cheers,
> Stefan
>
--
You received this messa
ngs-module)
says that this should work, I always get the error:
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.
Anyone who can help with this?
Cheers,
Stefan
--
You received this message because you are subscribed to the Google Gro
ble %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.
>>>
how do i fix it.
what am i missing here
You are directly importing a package which is on the Python path so the
system f
ARIABLE)
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.
>>>
how do i fix it.
what am i missing here
You are directly importing a package which is on the Python path so the
system finds it ok. But, that package (django_tables2)
ne
184, in inner
self._setup()
File "c:\Python27\lib\site-packages\django\conf\__init__.py", line 40, in
_setup
raise ImportError("Settings cannot be imported, because environment
variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be import
ente estructura
>
> manage.py
> miProyecto/
>__init__.py settings.py urls.py wsgi.py
>
> al posicionarme en el directorio raiz del proyecto me lanza el
> siguiente error
> ImportError: Settings cannot be imported, because environment variable
> DJANGO_SETTINGS_MODULE
Proyecto con la
> siguiente estructura
>
> manage.py
> miProyecto/
>__init__.py settings.py urls.py wsgi.py
>
> al posicionarme en el directorio raiz del proyecto me lanza el
> siguiente error
> ImportError: Settings cannot be imported, because environ
posicionarme en el directorio raiz del proyecto me lanza el
siguiente error
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.
Anterior a esta version no me generaba esta estructura de archivos.
¿Como puedo corregir el problema?
--
You received
> ./manage.py shell --settings=client_settings.foo
In [1]: from django.conf import settings
In [2]: settings.HELLO
Out[2]: True
> What's not working?
>
Failure is not working! Thanks
> Tim.
>
James
>> Hi all,
>>
>> I don't understand something about DJANGO_SETTINGS_MOD
I've done this.
You should be able to startup the test server with
--settings=client_settings/foo.py and get all of settings.py and HELLO
available to you.
What's not working?
Tim.
> Hi all,
>
> I don't understand something about DJANGO_SETTINGS_MODULE. My
> intention is to s
On Tue, Nov 15, 2011 at 4:42 PM, James Pic <james...@gmail.com> wrote:
> Hi all,
>
> I don't understand something about DJANGO_SETTINGS_MODULE. My
> intention is to serve several websites from the same project
> installation, by creating a subdir of website-specific setti
Hi all,
I don't understand something about DJANGO_SETTINGS_MODULE. My
intention is to serve several websites from the same project
installation, by creating a subdir of website-specific settings.
project_root/
settings.py
client_settings/
__init__.py
foo.py
bar.py
etc
s Oscar, I read the page already, but am still not totally
> > understood. The page said the value of DJANGO_SETTINGS_MODULE should
> > be "Python path syntax", e.g. mysite.settings. What exactly is
> > "Python path syntax"? Would it be ok if I just provide t
On Thu, 2011-06-02 at 05:29 -0700, Kann wrote:
> Thanks Oscar, I read the page already, but am still not totally
> understood. The page said the value of DJANGO_SETTINGS_MODULE should
> be "Python path syntax", e.g. mysite.settings. What exactly is
> "Python path syntax
On Thu, Jun 02, 2011 at 05:29:01AM -0700, Kann wrote:
> Thanks Oscar, I read the page already, but am still not totally
> understood. The page said the value of DJANGO_SETTINGS_MODULE should
> be "Python path syntax", e.g. mysite.settings. What exactly is
> "Python p
Thanks Oscar, I read the page already, but am still not totally
understood. The page said the value of DJANGO_SETTINGS_MODULE should
be "Python path syntax", e.g. mysite.settings. What exactly is
"Python path syntax"? Would it be ok if I just provide the value as
2011/6/2 Kann <vearas...@gmail.com>:
> Yep, but what if I just want to load all configurations from the
> entirely new file. What should be the proper value for me to give to
> the DJANGO_SETTINGS_MODULE?
Take a look to https://docs.djangoproject.com/en/dev/topics/settings/
You c
> You can import "setting_new.py" from "settings.py", that way you still
> only need to stablish settings.py as the DJANGO_SETTINGS_MODULE.
Yep, but what if I just want to load all configurations from the
entirely new file. What should be the p
You can import "setting_new.py" from "settings.py", that way you still
only need to stablish settings.py as the DJANGO_SETTINGS_MODULE.
It's strange though, the development server of django (python
manage.py runserver) should import automatically the settings module
and add i
Dear all,
In order to run django on the server, I need to specify the file
containing all the configuration and export it as a system variable
called "DJANGO_SETTINGS_MODULE". Also, the documentation on django
project website also stated that the value of DJANGO_SETTINGS_MOD
mail.com> wrote:
> Hi, Django developers:
> I am very new here, trying to set up my Django
> I have a project called 'mysite'
> when I run:
> $ django-admin.py runserver
>
> the terminal gives:
> Error: Settings cannot be imported, because environment variable
> DJANGO
:
>> Error: Settings cannot be imported, because environment variable
>> DJANGO_SETTINGS_MODULE is undefined
>>
>> then I tried this:
>> $ export DJANGO_SETTINGS_MODULE=mysite.settings
>>
>> the terminal then gives me:
>> django-admin.py runserverError: Could not impo
al gives:
> Error: Settings cannot be imported, because environment variable
> DJANGO_SETTINGS_MODULE is undefined
>
> then I tried this:
> $ export DJANGO_SETTINGS_MODULE=mysite.settings
>
> the terminal then gives me:
> django-admin.py runserverError: Could not import se
Hi, Django developers:
I am very new here, trying to set up my Django
I have a project called 'mysite'
when I run:
$ django-admin.py runserver
the terminal gives:
Error: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined
then I tried this:
$ export
called "setup_environ. This is called by all management
> > commands (i.e. manage.py). If you note here the os.environ is set
> > unconditionally. I suppose for your setup to work correctly django
> > should be doing:
>
> > if not "DJANGO_SETTINGS_MODULE" in os.e
_init__ you'll find
> a function called "setup_environ. This is called by all management
> commands (i.e. manage.py). If you note here the os.environ is set
> unconditionally. I suppose for your setup to work correctly django
> should be doing:
>
> if not "DJANGO_S
doing:
if not "DJANGO_SETTINGS_MODULE" in os.environ:
os.environ['DJANGO_SETTINGS_MODULE'] = ...
However, since this is not the case you don't have much choice other
then to use --settings option, or alter your manage.py file so that it
sets up this hard-coded path before it calls the mai
I have DJANGO_SETTINGS_MODULE set in my environment to an alternative
settings file. The alternate file imports the original settings file
and overrides some values for my development environment.
Whenever I try to run ./manage.py runserver, it insists on using the
settings.py on the same path
Daniel Roseman wrote:
On Mar 10, 3:44 pm, John Griessen <j...@industromatic.com> wrote:
Is this line OK?
os.environ['DJANGO_SETTINGS_MODULE'] = 'industromatic.com.settings'
The DJANGO_SETTINGS_MODULE setting is a Python module, so it must be a
valid Python path. "indust
On Mar 10, 3:44 pm, John Griessen <j...@industromatic.com> wrote:
> I am serving up sites named after their domains with .com in the name
> but when I saw the os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
> specified in tutorials it seemed like putting a .com might
I am serving up sites named after their domains with .com in the name
but when I saw the os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
specified in tutorials it seemed like putting a .com might be interpreted wrong.
Can the WSGI file os.environ['DJANGO_SETTINGS_MODULE'] =
deal
On 9 February 2010 03:25, neridaj <neri...@gmail.com> wrote:
> I'm trying to setup my first cron job and I think the reason my script
> is not running is because I don't have DJANGO_SETTINGS_MODULE defined
> for my environment i.e., .profile script. I'm using
I'm trying to setup my first cron job and I think the reason my script
is not running is because I don't have DJANGO_SETTINGS_MODULE defined
for my environment i.e., .profile script. I'm using mod_wsgi so my
DJANGO_SETTINGS_MODULE is defined in the respective wsgi file for each
site, so my
I'm getting this error even though my DJANGO_SETTINGS_MODULE is
defined in my wsgi file:
import os, sys
sys.path.append('/home/username/public_html/mysite.com')
sys.path.append('/home/username/public_html/mysite.com/mysite')
os.environ['PYTHON_EGG_CACHE'] = '/home/username/public_html
t; DEFAULT_TABLESPACE = ''
> CACHE_BACKEND = 'locmem://'
> TRANSACTIONS_MANAGED = False
>
> and it will run further into some new code, until django looks up
> another setting, and it isn't there.
>
> Everything works fine if I set the DJANGO_SETTINGS_MODULE env variable.
>
SE_OPTIONS = ''
URL_VALIDATOR_USER_AGENT = ''
DEFAULT_INDEX_TABLESPACE = ''
DEFAULT_TABLESPACE = ''
CACHE_BACKEND = 'locmem://'
TRANSACTIONS_MANAGED = False
and it will run further into some new code, until django looks up
another setting, and it isn't there.
Everything works fine if I set the DJANGO_SETTING
Copy your app to site-packages folder and see if that works. If you dont
know where site-packages folder is , do 'which python' from command line and
you will get an idea.
Dhruv Adhia
http://thirdimension.com
On Tue, Jul 14, 2009 at 8:22 AM, Nate Reed wrote:
> The
The admin tool is complaining about this environment variable, but I've
never had this problem before on this box. I'm not sure what's changed
since the last time I used it.
I tried specifying the path:
$ django-admin.py syncdb --settings=mysite.settings
Error: Could not import settings
thanks for the advice, but
#set DJANGO_SETTINGS_MODULE=mysite.settings
#python manage.py syncdb --settings=settings
# ln -s /usr/lib/python2.5/site-packages/pinax /home/pubuntu/pinax
# python manage.py suncdb
#curl -o pinax-boot.py http://svn.pinaxproject.com/pinax/trunk/scripts/pinax-boo
t.pt
owing was blank raising a nasty key error in
apocalyptic alarming red text ending with
>>>os.environ["DJANGO_SETTINGS_MODULE"]
$..."raise KeyError(key)"
# so had to set it to get moving using
# first i verified i was in my projects path
>>>os.getcwd()
$/home/m
pubu...@pubuntu:~/django-trunk/build/lib/django/bin/myapp1
export DJANGO_SETTINGS_MODULE=myapp1.settings
export PYTHONPATH=/usr/lib/python2.5/site-packages
django-admin.py dumpdata
Error: Could not import settings 'myapp1.settings' (Is it on sys.path?
Does it h
ave syntax errors?): No module
Hi,
On 07.05.2009, at 16:02, bconnors wrote:
>
> I saw this chat related to DJANGO_SETTINGS_MODULE is undefined.
> Hello I am new to Django.
> I am trying to exercise "templates" through the interactive shell,
> however I end up getting this error. Can anyone help?
&g
I saw this chat related to DJANGO_SETTINGS_MODULE is undefined.
Hello I am new to Django.
I am trying to exercise "templates" through the interactive shell,
however I end up getting this error. Can anyone help?
here is the exact steps I follow:
1) cd C:\Django\mysite
2) set DJANGO_SETTI
> urls.py
> > urls.pyc
> > views.py
> > views.pyc
> > __init__.py
> > __init__.pyc
>
> > 2) set DJANGO_SETTINGS_MODULE=mysite.settings I've also tried set
> > DJANGO_SETTINGS_MODULE=settings.py
>
> Setting it to mysite.settings will
I follow:
>
> 1) cd C:\Django\mysite
>
>manage.py
>settings.py
>settings.pyc
>urls.py
>urls.pyc
>views.py
>views.pyc
>__init__.py
>__init__.pyc
>
> 2) set DJANGO_SETTINGS_MODULE=mysite.settings I've also tried set
> DJANGO_S
views.py
views.pyc
__init__.py
__init__.pyc
2) set DJANGO_SETTINGS_MODULE=mysite.settings I've also tried set
DJANGO_SETTINGS_MODULE=settings.py
3) python
4) >>> from django.template import Template
>>> t = Template("My name is {{ name }}.")
5) ERROR: Im
I'm using LAMP with Django 1.0 B2 and mod_python.
going through http://www.djangobook.com/en/1.0/chapter20/
I get : ImportError: Settings cannot be imported, because environment
variable DJANGO_SETTINGS_MODULE is undefined.
in my apache2 httpd-vhosts.conf i have
SetHandler
Karen Tracey wrote:
> So what's changed, I'm guessing, to introduce this problem is you added this
> import to to your project's __init__.py file.
Karen,
Thanks - while I was trying to get my head wrapped around
newforms-admin, I put some stuff in __init__.py and then forgot to take
it out.
le then goes and tries to import some stuff
(django.contrib.admin) that relies on the environment already being set up.
But the setup_environ function hasn't yet reached the point where it sets
the DJANGO_SETTINGS_MODULE environment variable, so unless you've already
set it yourself, you get the error.
So
28, in __getattr__
self._import_settings()
File
"/usr/local/lib/python2.5/site-packages/django/conf/__init__.py", line
57, in _import_settings
raise ImportError("Settings cannot be imported, because environment
variable %s is undefin
On Fri, May 23, 2008 at 12:11 PM, David Robinson <[EMAIL PROTECTED]>
wrote:
>
> I have run into a problem that I don't understand - when I try to run
> "shell manage.py shell" I just started getting an error about the
> DJANGO_SETTINGS_MODULE environment variable no
I have run into a problem that I don't understand - when I try to run
"shell manage.py shell" I just started getting an error about the
DJANGO_SETTINGS_MODULE environment variable not being defined.
I found the information I needed to work around the problem (on this
list - thank
\app']
> sys.path += ['C:\\Django\\projects\\','C:\\Django\\projects\\shop\\']
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'shop.settings'
> from django.models.shop import products
> ##
> If this program is started from
> C:\Django\projects\shop it works OK
>
>
My project directory looks like this
C:\Django\projects\shop\apps\shop\views
I have this simple program
import sys,os
sys.path += ['C:\\Python23\\Lib\\site-packages\\django\\app']
sys.path += ['C:\\Django\\projects\\','C:\\Django\\projects\\shop\\']
os.environ['DJANGO_SETTINGS_MODULE
Yes -- that does resolve the problem -- adding the directory
containing mysite to the PYTHONPATH. Wonderful, Jarek.
On Feb 7, 4:38 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> Schmoopie napisał(a):
>
> > DJANGO_SETTINGS_MODULE issues are driving me crazy. So any assistan
Schmoopie napisał(a):
> DJANGO_SETTINGS_MODULE issues are driving me crazy. So any assistance
> appreciated.
>
> I set the environ variable to mysite.settings, as recommended in the
> documentation, but then I get: ImportError could not import settings
> 'mysite.settings
DJANGO_SETTINGS_MODULE issues are driving me crazy. So any assistance
appreciated.
I set the environ variable to mysite.settings, as recommended in the
documentation, but then I get: ImportError could not import settings
'mysite.settings', no module named mysite.settings
Should the variable
You can also just fix the imports to reference things properly,
including the site name :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
thing'
> export DJANGO_DB_PASS='something'
> export DJANGO_SECRET_KEY='something'
> export DJANGO_SETTINGS_MODULE='mysite.settings'
>
> # User specific aliases and functions
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
PYTHONPATH=$PYTHONPATH:/home/bobby/dev/workspace:/home/bobby/
dev/workspace/mysite
export DJANGO_PROJECT='something'
export DJANGO_DB_NAME='something'
export DJANGO_DB_USER='something'
export DJANGO_DB_PASS='something'
export DJANGO_SECRET_KEY='something'
export DJANGO_SETTINGS_MODULE='mysite.settings
1 - 100 of 133 matches
Mail list logo