omab/django-social-auth — Issue #225: Allow for URL settings to be callables
Author: mkai
Created: 2012-01-17 16:52:24+00:00
State: open

I'd like to propose that the settings for defining custom URLs (e. g. SOCIAL_AUTH_NEW_USER_REDIRECT_URL, SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL, etc.) can be defined as callables.

For example an implementation might want to add a parameter to the URL:

```python
SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL = lambda x: reverse('user_settings_account') + '?next=/'
```

The reasoning behind that is that even though I could use ``reverse_lazy``, it is a proxy object and thus cannot be concatenated with a string. If the setting is a callable, it is called when the URL patterns are loaded, so that ``reverse`` can be used.

Would you approve of that? I could implement a patch/ pull request in that case.