And BTW, my bad.  Change the except: line to except ImportError, then 
the syntax error from the dash will be apparent in your 500 page.

--Ned.
http://nedbatchelder.com

Ned Batchelder wrote:
> settings-custom isn't a valid Python file name, because a Python 
> identifier can't have a dash in it.  Use an underscore.
>
> --Ned.
> http://nedbatchelder.com
>
> Dana wrote:
>> Ned/Felix,
>>
>> Ok, I tried your guys solution but it does not seem to be working for
>> me, so Im wondering where I goofed.
>>
>> Here is what ive got
>>
>> My settings.py and settings-custom.py file are here:
>>
>> config/
>>     settings.py
>>     settings-custom.py
>>
>> The directory containing config is on the PythonPath, so an import of:
>>
>> from config.settings-custom import *
>>
>> ... should work correct?
>>
>> In settings.py I have DEBUG=False and in settings-custom.py I have
>> DEBUG=True, but Im getting my 500.html page, so that means it is only
>> respecting the DEBUG setting in settings.py.
>>
>> Any ideas?
>>
>> Thanks
>>
>> On Oct 23, 5:04 pm, Ned Batchelder <[EMAIL PROTECTED]> wrote:
>>   
>>> In settings.py:
>>>
>>>     try:
>>>        from settings_local import *
>>>     except:
>>>        pass
>>>
>>> --Ned.http://nedbatchelder.com
>>>
>>>
>>>
>>> Dana wrote:
>>>     
>>>> Hello everyone,
>>>>       
>>>> I know a form of this question has been asked before on this group but
>>>> I can't for the life of me find the thread.
>>>>       
>>>> I am wondering how I can have a generic settings.py file that contains
>>>> all my basic settings and then have a settings-local.py (or
>>>> whatever...) and have that contain custom settings such as DEBUG=True,
>>>> etc... Ideally the settings-local.py file would *only* have the custom
>>>> settings, and nothing else, but I cannot seem to get this to work. For
>>>> example:
>>>>       
>>>> In settings.py I would have default settings:
>>>>       
>>>> settings.py
>>>> -------------------------------------------
>>>> DEBUG = False
>>>>       
>>>> DATABASE_ENGINE = 'mysql'
>>>>       
>>>> DATABASE_NAME = 'something'
>>>>       
>>>> DATABASE_USER = 'root'
>>>> DATABASE_PASSWORD = ''
>>>>       
>>>> MEDIA_ROOT = '/home/user/media/'
>>>> MEDIA_URL = 'http://media.example.com/'
>>>>       
>>>> ADMIN_MEDIA_PREFIX = '/admin_media/'
>>>>       
>>>> INSTALLED_APPS = (
>>>>     ....
>>>> )
>>>>       
>>>> ...... etc
>>>>       
>>>> -------------------------------------------
>>>> and in settings-local.py I would override the settings:
>>>>       
>>>> # settings-local.py
>>>> -------------------------------------------
>>>> DEBUG = True
>>>>       
>>>> DATABASE_USER = 'username'
>>>> DATABASE_PASSWORD = 'somethinghere123'
>>>> -------------------------------------------
>>>>       
>>>> I would like some way to have settings-local import my settings.py
>>>> file and then override specific settings. Anyone know how to do this
>>>> cleanly?
>>>>       
>>>> Thanks!
>>>>       
>>> --
>>> Ned Batchelder,http://nedbatchelder.com
>>>     
>>
>>
>>
>>   
>
> -- 
> Ned Batchelder, http://nedbatchelder.com
>   
>
> >

-- 
Ned Batchelder, http://nedbatchelder.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to