garfonzo / djangoproton

A Starter Project to get you from zero to live fast
1 stars 1 forks source link

Separate the settings.py from the proton related settings #4

Open josephmancuso opened 6 years ago

josephmancuso commented 6 years ago

IDEA:

could have a file structure like:

project/
    settings.py
    proton/
        payments.py # contains stripe, braintree, paypal integration settings
        mail.py # contains SMTP, Mailtrap, [?mailchimp] integration
        storage.py # etc etc.

I always liked the idea of breaking up the settings so it's easy to find out how to change the payment drivers, switching to Braintree from stripe should be a simple driver setting.

Also we can do things like:

pip install django-proton-cashier

proton publish django-proton-cashier

or

proton install django-proton-cashier --publish

which will just run a shell command of pip install and the proton publish command. remember. save time! :)

publish commands will either add a setting like proton/cashier.py or will append settings with a docblock seperator like

NORMAL_SETTINGS = 'blah'
SOME OTHER SETTINGS = 'blah'

'''
/-----------------------------------------
Django Proton - Cashier Package Settings
/-----------------------------------------
'''

AWESOME_SETTINGS = ['list']

This way we can go in and just clean up the settings or something and also people can make packages in the future which will just plug in to this extender framework

garfonzo commented 6 years ago

I quite like the idea of separating out the setting sections.

josephmancuso commented 6 years ago

references #7