Allow SOCIAL_<PROVIDER> settings to be None #13

Merged
merged 1 commit into from Sep 3, 2013

Conversation

Projects
None yet
2 participants
Contributor

joeyespo commented Aug 21, 2013

With this, you can be explicit about what settings are expected
in your root settings.py file. SOCIAL_FACEBOOK can be None, for
example, and overridden in another file or in the environment.

Here's my personal setup:

SOCIAL_TWITTER = {
    'consumer_key': os.environ.get('TWITTER_CONSUMER_KEY'),
    'consumer_secret': os.environ.get('TWITTER_CONSUMER_SECRET'),
} if os.environ.get('TWITTER_CONSUMER_KEY') else None

It would be ideal if 'consumer_key' could allow None, but I didn't want
to break the OAuth mechanism in this commit, so this is good enough.

Allow SOCIAL_<PROVIDER> settings to be None.
With this, you can be explicit about what settings are expected
in your root settings.py file. SOCIAL_FACEBOOK can be None, for
example, and overridden in another file or in the environment.

Here's my personal setup:

    SOCIAL_TWITTER = {
        'consumer_key': os.environ.get('TWITTER_CONSUMER_KEY'),
        'consumer_secret': os.environ.get('TWITTER_CONSUMER_SECRET'),
    } if os.environ.get('TWITTER_CONSUMER_KEY') else None

It would be ideal if 'consumer_key' could allow None, but I didn't want
to break the OAuth mechanism in this commit, so this is good enough.
Owner

mattupstate commented Sep 3, 2013

Makes sense. Thanks!

mattupstate added a commit that referenced this pull request Sep 3, 2013

Merge pull request #13 from joeyespo/nullable-settings
Allow SOCIAL_<PROVIDER> settings to be None

@mattupstate mattupstate merged commit 9867ac0 into mattupstate:develop Sep 3, 2013

1 check failed

default The Travis CI build could not complete due to an error
Details

@joeyespo joeyespo deleted the joeyespo:nullable-settings branch Sep 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment