On Sun, Apr 7, 2013 at 1:35 PM, Johannes <[email protected]> wrote:
> I get again to different results.
> the shell accesses the settings.py while from the testserver the
> settings.pyc is accessed. After I deleted the pyc-file. the testserver
> uses the settings.py too.
> When and in which cases the pyc-file gets (re)-build?
Whenever I change a py file in prod I bounce apache. When using
runserver it detects when a py file is changed and automagically
restarts itself. I've found that when I change a template or a static
file I don't have to bounce apache, but often I have to clear my
browser's cache before the new files are picked up.
> On 07.04.2013 21:24, Alexis Roda wrote:
>> Al 07/04/13 20:35, En/na Johannes ha escrit:
>>>> In order to diagnose what the problem really is I'd suggest to add a
>>>> print to some of your views:
>>>
>>> databases {'default': {'ENGINE': 'django.db.backends.sqlite3',
>>> 'TEST_MIRROR': None, 'NAME': ':memory:', 'TEST_CHARSET': None,
>>> 'TIME_ZONE': 'UTC', 'TEST_COLLATION': None, 'OPTIONS': {}, 'HOST': '',
>>> 'USER': '', 'TEST_NAME': None, 'PASSWORD': '', 'PORT': ''}
>>>
>>>> and in the shell just:
>>>
>>> the shell output:
>>> databases {'default': {'ENGINE': 'django.db.backends.sqlite3',
>>> 'TEST_MIRROR': None, 'NAME': 'nacc.db', 'TEST_CHARSET': None,
>>> 'TIME_ZONE': 'UTC', 'TEST_COLLATION': None, 'OPTIONS': {}, 'HOST': '',
>>> 'USER': '', 'TEST_NAME': None, 'PASSWORD': '', 'PORT': ''}}
>>>
>>>
>>> so the name does not match. Do I miss something to import?
>>
>> So it looks like django is using two different settings.py (or the same
>> settings.py which has some kind of conditional configuration).
>>
>> Again, in any view and in the django shell, compare the output:
>>
>> import os
>> settings = os.environ["DJANGO_SETTINGS_MODULE"]
>> module = __import__(settings)
>> print settings, module.settings.__file__
>>
>> Hopefully this will give you some clue.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.