Thanks for the debug_toolbar archaeology!

I've been trying to improve the way settings situation 
[https://github.com/mayan-edms/mayan-edms/tree/master/mayan/config] now 
that we are close to a PyPI package and I like your solution. There are 
some things I would like to keep as they are now (default DB backend to 
sqlite instead of PostgreSQL) so that Mayan 'just works' as soon as it is 
installed. I'll pull your changes and tweak as necessary.

Thanks a lot Paul!

--Roberto


On Thursday, July 10, 2014 3:29:15 AM UTC-4, Paul Whipp wrote:
>
> The problem was that I'd re-enabled adding the debug_toolbar which I like 
> using. Very deceptive, getting a subtle import error sometimes as a result 
> of including an app but such is life. Read on for a fixed debug toolbar 
> configuration and a simpler way to handle settings.
>
> Adding debug_toolbar as an INSTALLED_APPS causes:
>
> (mayan)~/wk/cccs/mayan $ django syncdb
> ...
> django.core.exceptions.ImproperlyConfigured: ImportError installation: 
> cannot import name Installation
>
>
> Remove it from the installed_apps and this problem goes away.
>
> Some googling found this: 
> https://github.com/django-debug-toolbar/django-debug-toolbar/issues/524 so 
> I've set up the debug toolbar explicitly in my development configuration. 
> This is all done in the settings 
> <https://github.com/cccs-web/mayan-edms/tree/master/mayan/settings> 
> except for the debug urls which needed adding to mayan/urls.py 
> <https://github.com/cccs-web/mayan-edms/blob/master/mayan/urls.py> (line 
> 68 on).
>
> I think I've substantially improved the mayan settings configuration 
> <https://github.com/cccs-web/mayan-edms/tree/master/mayan/settings>. My 
> solution is based upon two scoops 
> <https://github.com/twoscoops/django-twoscoops-project/tree/develop/project_name/project_name/settings>
>  
> (with the addition of the 'includes' folder and secrets.py).
>
> Notice how you can keep each site configuration safely in the repo and 
> that it is nice and simple (no more conditional stuff in settings checking 
> the debug and then only having one possible 'development' configuration).
>
> The site secrets are kept in a secrets.py file which is not stored in the 
> repository (secrets.py.example makes it easy to create a secrets.py for 
> local development or for production as needed - the only time you need to 
> share them around might be if you are also copying the databases about 
> although it is probably unnecessary even then unless you are relying upon 
> data using the secret_key).
>
> I prefer my secrets.py solution to the two scoops use of environment 
> variables because it keeps everything in Python and I prefer using the 
> 'includes' subfolder because you can then tell at a glance what files in 
> the settings folder are actually there to be used as settings. In complex 
> applications I often have other settings/includes for special purposes 
> (such as supporting different kinds of developer or sites using different 
> deployment methods).
>
> Cheers,
> Paul
>
>
> On 10 July 2014 11:27, Paul Whipp <[email protected]> wrote:
>
>> Yes. No difference :(
>>
>>
>> On 10 July 2014 09:56, Mathias Behrle <[email protected]> wrote:
>>
>>> * Paul Whipp: " Re: [Mayan EDMS: 712] Trouble Installing head version on 
>>> Ubuntu
>>>   14.04" (Thu, 10 Jul 2014 08:08:47 +1000):
>>>
>>> Hello Paul,
>>>
>>> [...]
>>>
>>> > [To make things easier with my IDE etc. I've also added 
>>> mayan/mayan/apps to
>>> > the virtual env path]
>>>
>>> Did you try without that?
>>>
>>> Cheers,
>>> Mathias
>>>
>>
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to