├── allauth ├── models.py ├── __init__.py ├── account │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ └── __init__.py │ ├── templatetags │ │ ├── __init__.py │ │ ├── account_tags.py │ │ └── account.py │ ├── apps.py │ ├── __init__.py │ ├── context_processors.py │ ├── migrations │ │ └── __init__.py │ ├── signals.py │ └── admin.py ├── socialaccount │ ├── providers │ │ ├── fxa │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ ├── provider.py │ │ │ └── views.py │ │ ├── vk │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ └── tests.py │ │ ├── xing │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── provider.py │ │ │ └── views.py │ │ ├── amazon │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ ├── provider.py │ │ │ └── views.py │ │ ├── angellist │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ ├── views.py │ │ │ └── provider.py │ │ ├── bitbucket │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ └── provider.py │ │ ├── bitly │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ ├── provider.py │ │ │ └── views.py │ │ ├── coinbase │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── provider.py │ │ │ ├── views.py │ │ │ └── tests.py │ │ ├── douban │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ ├── provider.py │ │ │ └── views.py │ │ ├── dropbox │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ ├── provider.py │ │ │ └── views.py │ │ ├── evernote │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── provider.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── facebook │ │ │ ├── __init__.py │ │ │ ├── south_migrations │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── templates │ │ │ │ └── facebook │ │ │ │ │ ├── channel.html │ │ │ │ │ └── fbconnect.html │ │ │ ├── forms.py │ │ │ └── urls.py │ │ ├── feedly │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ ├── views.py │ │ │ └── provider.py │ │ ├── flickr │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ └── urls.py │ │ ├── github │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ └── provider.py │ │ ├── google │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── hubic │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ ├── provider.py │ │ │ └── views.py │ │ ├── instagram │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ ├── views.py │ │ │ └── provider.py │ │ ├── linkedin │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ └── tests.py │ │ ├── mailru │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ ├── provider.py │ │ │ └── tests.py │ │ ├── oauth │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ └── provider.py │ │ ├── oauth2 │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ └── provider.py │ │ ├── openid │ │ │ ├── __init__.py │ │ │ ├── migrations │ │ │ │ ├── __init__.py │ │ │ │ └── 0001_initial.py │ │ │ ├── south_migrations │ │ │ │ └── __init__.py │ │ │ ├── admin.py │ │ │ ├── urls.py │ │ │ ├── forms.py │ │ │ └── models.py │ │ ├── orcid │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── paypal │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ └── provider.py │ │ ├── persona │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ └── templates │ │ │ │ └── persona │ │ │ │ └── auth.html │ │ ├── spotify │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── provider.py │ │ │ ├── views.py │ │ │ └── tests.py │ │ ├── twitch │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ ├── views.py │ │ │ └── provider.py │ │ ├── twitter │ │ │ ├── __init__.py │ │ │ ├── south_migrations │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ └── urls.py │ │ ├── vimeo │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── provider.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── weibo │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── provider.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── dropbox_oauth2 │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── provider.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── foursquare │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── provider.py │ │ │ └── views.py │ │ ├── odnoklassniki │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ └── provider.py │ │ ├── soundcloud │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ ├── provider.py │ │ │ └── tests.py │ │ ├── stackexchange │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── provider.py │ │ │ └── views.py │ │ ├── windowslive │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ └── provider.py │ │ ├── linkedin_oauth2 │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── tumblr │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── urls.py │ │ │ ├── provider.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ └── __init__.py │ ├── templatetags │ │ ├── __init__.py │ │ └── socialaccount_tags.py │ ├── south_migrations │ │ └── __init__.py │ ├── context_processors.py │ ├── migrations │ │ └── __init__.py │ ├── apps.py │ ├── __init__.py │ ├── urls.py │ └── signals.py ├── templates │ ├── account │ │ ├── base.html │ │ ├── messages │ │ │ ├── logged_out.txt │ │ │ ├── email_confirmed.txt │ │ │ ├── password_set.txt │ │ │ ├── primary_email_set.txt │ │ │ ├── email_deleted.txt │ │ │ ├── password_changed.txt │ │ │ ├── email_confirmation_sent.txt │ │ │ ├── unverified_primary_email.txt │ │ │ ├── cannot_delete_primary_email.txt │ │ │ └── logged_in.txt │ │ ├── email │ │ │ ├── email_confirmation_signup_message.txt │ │ │ ├── email_confirmation_signup_subject.txt │ │ │ ├── password_reset_key_subject.txt │ │ │ ├── email_confirmation_subject.txt │ │ │ ├── email_confirmation_message.txt │ │ │ └── password_reset_key_message.txt │ │ ├── snippets │ │ │ └── already_logged_in.html │ │ ├── account_inactive.html │ │ ├── password_reset_from_key_done.html │ │ ├── signup_closed.html │ │ ├── password_set.html │ │ ├── verification_sent.html │ │ ├── password_change.html │ │ ├── password_reset_done.html │ │ ├── email_confirmed.html │ │ ├── logout.html │ │ ├── signup.html │ │ ├── verified_email_required.html │ │ ├── password_reset.html │ │ ├── password_reset_from_key.html │ │ ├── email_confirm.html │ │ └── login.html │ ├── openid │ │ ├── base.html │ │ └── login.html │ ├── socialaccount │ │ ├── base.html │ │ ├── snippets │ │ │ ├── login_extra.html │ │ │ └── provider_list.html │ │ ├── messages │ │ │ ├── account_connected.txt │ │ │ ├── account_disconnected.txt │ │ │ └── account_connected_other.txt │ │ ├── authentication_error.html │ │ ├── login_cancelled.html │ │ └── signup.html │ └── base.html ├── locale │ ├── cs │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── de │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── el │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── en │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── es │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── fa │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── fr │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── he │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── hr │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── it │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── ja │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── nl │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── pl │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── ru │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── sk │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── sv │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── tr │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── uk │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── pt_BR │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── pt_PT │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── zh_CN │ │ └── LC_MESSAGES │ │ │ └── django.mo │ └── zh_TW │ │ └── LC_MESSAGES │ │ └── django.mo ├── exceptions.py ├── urls.py └── app_settings.py ├── example ├── example │ ├── __init__.py │ ├── demo │ │ ├── __init__.py │ │ ├── views.py │ │ └── tests.py │ ├── locale │ │ └── nl │ │ │ └── LC_MESSAGES │ │ │ └── django.mo │ ├── templates │ │ ├── plain │ │ │ └── example │ │ │ │ ├── index.html │ │ │ │ ├── profile.html │ │ │ │ └── base.html │ │ ├── bootstrap │ │ │ └── allauth │ │ │ │ ├── account │ │ │ │ ├── password_set.html │ │ │ │ ├── password_change.html │ │ │ │ ├── logout.html │ │ │ │ ├── signup.html │ │ │ │ ├── base.html │ │ │ │ ├── password_reset_from_key.html │ │ │ │ ├── email_confirm.html │ │ │ │ ├── password_reset.html │ │ │ │ └── login.html │ │ │ │ └── socialaccount │ │ │ │ └── signup.html │ │ └── uniform │ │ │ └── allauth │ │ │ ├── openid │ │ │ └── login.html │ │ │ ├── account │ │ │ ├── password_set.html │ │ │ ├── password_change.html │ │ │ ├── signup.html │ │ │ ├── password_reset.html │ │ │ ├── password_reset_from_key.html │ │ │ └── login.html │ │ │ └── socialaccount │ │ │ └── signup.html │ └── urls.py ├── requirements.txt ├── manage.py └── README.rst ├── .coveragerc ├── docs ├── support.rst ├── index.rst ├── views.rst ├── decorators.rst └── showcase.rst ├── MANIFEST.in ├── manage.py ├── .tx └── config ├── requirements.txt ├── .gitignore ├── .travis.yml ├── LICENSE └── AUTHORS /allauth/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/example/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/example/demo/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/account/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | include = allauth* -------------------------------------------------------------------------------- /allauth/account/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/account/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/fxa/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/fxa/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/vk/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/xing/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/amazon/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/angellist/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/bitbucket/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/bitly/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/coinbase/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/douban/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/evernote/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/facebook/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/feedly/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/flickr/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/github/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/google/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/hubic/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/instagram/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/linkedin/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/mailru/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/oauth/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/oauth2/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/openid/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/orcid/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/paypal/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/persona/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/persona/models.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/spotify/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/twitch/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/twitter/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/vimeo/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/weibo/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/south_migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox_oauth2/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/foursquare/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/odnoklassniki/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/soundcloud/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/stackexchange/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/windowslive/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/linkedin_oauth2/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/openid/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/example/demo/views.py: -------------------------------------------------------------------------------- 1 | # Create your views here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/openid/south_migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/twitter/south_migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/facebook/south_migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/requirements.txt: -------------------------------------------------------------------------------- 1 | django>=1.4.3 2 | django-allauth>=0.13.0 3 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/bitly/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/hubic/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/oauth/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/orcid/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/tumblr/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'jshedd' 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/vimeo/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/vk/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/weibo/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/xing/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/templates/account/base.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | 4 | -------------------------------------------------------------------------------- /allauth/templates/openid/base.html: -------------------------------------------------------------------------------- 1 | {% extends "socialaccount/base.html" %} 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/amazon/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/angellist/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/bitbucket/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/coinbase/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/douban/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/evernote/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/facebook/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/feedly/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/flickr/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/foursquare/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/github/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/google/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/instagram/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/linkedin/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/mailru/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/oauth2/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/paypal/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/soundcloud/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/spotify/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/tumblr/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/twitch/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/twitter/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox_oauth2/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/linkedin_oauth2/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/odnoklassniki/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/stackexchange/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/windowslive/models.py: -------------------------------------------------------------------------------- 1 | # Create your models here. 2 | -------------------------------------------------------------------------------- /allauth/templates/socialaccount/base.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | -------------------------------------------------------------------------------- /docs/support.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../README.rst 2 | :start-after: with flows that just work. 3 | -------------------------------------------------------------------------------- /allauth/templates/socialaccount/snippets/login_extra.html: -------------------------------------------------------------------------------- 1 | {% load socialaccount %} 2 | 3 | {% providers_media_js %} 4 | 5 | -------------------------------------------------------------------------------- /allauth/templates/account/messages/logged_out.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}You have signed out.{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include AUTHORS 2 | include LICENSE 3 | include README.rst 4 | recursive-include allauth *.html *.txt *.xml *.po *.mo *.js 5 | -------------------------------------------------------------------------------- /allauth/templates/account/email/email_confirmation_signup_message.txt: -------------------------------------------------------------------------------- 1 | {% include "account/email/email_confirmation_message.txt" %} 2 | -------------------------------------------------------------------------------- /allauth/templates/account/email/email_confirmation_signup_subject.txt: -------------------------------------------------------------------------------- 1 | {% include "account/email/email_confirmation_subject.txt" %} 2 | -------------------------------------------------------------------------------- /allauth/locale/cs/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/cs/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/de/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/de/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/el/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/el/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/en/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/en/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/es/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/es/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/fa/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/fa/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/fr/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/fr/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/he/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/he/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/hr/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/hr/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/it/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/it/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/ja/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/ja/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/nl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/nl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/pl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/pl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/ru/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/ru/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/sk/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/sk/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/sv/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/sv/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/tr/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/tr/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/uk/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/uk/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/templates/account/messages/email_confirmed.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}You have confirmed {{email}}.{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /allauth/templates/account/messages/password_set.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}Password successfully set.{% endblocktrans %} 3 | 4 | -------------------------------------------------------------------------------- /allauth/templates/account/messages/primary_email_set.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}Primary e-mail address set.{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /allauth/locale/pt_BR/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/pt_BR/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/pt_PT/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/pt_PT/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/zh_CN/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/zh_CN/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/locale/zh_TW/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/allauth/locale/zh_TW/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/templates/account/messages/email_deleted.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}Removed e-mail address {{email}}.{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /allauth/templates/account/messages/password_changed.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}Password successfully changed.{% endblocktrans %} 3 | 4 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/facebook/templates/facebook/channel.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /example/example/locale/nl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/django-allauth/master/example/example/locale/nl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /allauth/templates/account/messages/email_confirmation_sent.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}Confirmation e-mail sent to {{email}}.{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /allauth/templates/socialaccount/messages/account_connected.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}The social account has been connected.{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /allauth/templates/account/messages/unverified_primary_email.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}Your primary e-mail address must be verified.{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /allauth/templates/socialaccount/messages/account_disconnected.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}The social account has been disconnected.{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /example/example/templates/plain/example/index.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 |
Welcome
7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /example/example/templates/plain/example/profile.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 |Your profile
7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/facebook/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | 4 | class FacebookConnectForm(forms.Form): 5 | access_token = forms.CharField(required=True) 6 | -------------------------------------------------------------------------------- /allauth/templates/account/email/password_reset_key_subject.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% autoescape off %} 3 | {% blocktrans %}Password Reset E-mail{% endblocktrans %} 4 | {% endautoescape %} -------------------------------------------------------------------------------- /allauth/templates/account/messages/cannot_delete_primary_email.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}You cannot remove your primary e-mail address ({{email}}).{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /allauth/templates/socialaccount/messages/account_connected_other.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans %}The social account is already connected to a different account.{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /allauth/templates/account/messages/logged_in.txt: -------------------------------------------------------------------------------- 1 | {% load account %} 2 | {% load i18n %} 3 | {% user_display user as name %} 4 | {% blocktrans %}Successfully signed in as {{name}}.{% endblocktrans %} 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/context_processors.py: -------------------------------------------------------------------------------- 1 | from . import providers 2 | 3 | def socialaccount(request): 4 | ctx = { 'providers': providers.registry.get_list() } 5 | return dict(socialaccount=ctx) 6 | -------------------------------------------------------------------------------- /allauth/templates/account/email/email_confirmation_subject.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% autoescape off %} 3 | {% blocktrans %}Please Confirm Your E-mail Address{% endblocktrans %} 4 | {% endautoescape %} 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/vk/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import VKProvider 3 | 4 | urlpatterns = default_urlpatterns(VKProvider) 5 | -------------------------------------------------------------------------------- /allauth/account/templatetags/account_tags.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | warnings.warn("{% load account_tags %} is deprecated, use {% load account %}", 4 | DeprecationWarning) 5 | 6 | from account import * 7 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/tumblr/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth.urls import default_urlpatterns 2 | from .provider import TumblrProvider 3 | 4 | urlpatterns = default_urlpatterns(TumblrProvider) -------------------------------------------------------------------------------- /allauth/socialaccount/providers/vimeo/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth.urls import default_urlpatterns 2 | from .provider import VimeoProvider 3 | 4 | urlpatterns = default_urlpatterns(VimeoProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/xing/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth.urls import default_urlpatterns 2 | from .provider import XingProvider 3 | 4 | urlpatterns = default_urlpatterns(XingProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/amazon/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import AmazonProvider 3 | 4 | urlpatterns = default_urlpatterns(AmazonProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/bitly/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import BitlyProvider 3 | 4 | urlpatterns = default_urlpatterns(BitlyProvider) 5 | 6 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/feedly/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import FeedlyProvider 3 | 4 | urlpatterns = default_urlpatterns(FeedlyProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/google/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import GoogleProvider 3 | 4 | urlpatterns = default_urlpatterns(GoogleProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/mailru/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import MailRuProvider 3 | 4 | urlpatterns = default_urlpatterns(MailRuProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/orcid/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import OrcidProvider 3 | 4 | urlpatterns = default_urlpatterns(OrcidProvider) 5 | 6 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/paypal/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import PaypalProvider 3 | 4 | urlpatterns = default_urlpatterns(PaypalProvider) 5 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings' 4 | from django.core import management 5 | if __name__ == "__main__": 6 | management.execute_from_command_line() 7 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/coinbase/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import CoinbaseProvider 3 | 4 | urlpatterns = default_urlpatterns(CoinbaseProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/douban/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | 3 | from .provider import DoubanProvider 4 | 5 | urlpatterns = default_urlpatterns(DoubanProvider) 6 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth.urls import default_urlpatterns 2 | 3 | from .provider import DropboxProvider 4 | 5 | urlpatterns = default_urlpatterns(DropboxProvider) 6 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/flickr/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth.urls import default_urlpatterns 2 | from .provider import FlickrProvider 3 | 4 | 5 | urlpatterns = default_urlpatterns(FlickrProvider) 6 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/github/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import GitHubProvider 3 | 4 | urlpatterns = default_urlpatterns(GitHubProvider) 5 | 6 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/hubic/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | 3 | from .provider import HubicProvider 4 | 5 | urlpatterns = default_urlpatterns(HubicProvider) 6 | 7 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/linkedin/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth.urls import default_urlpatterns 2 | from .provider import LinkedInProvider 3 | 4 | urlpatterns = default_urlpatterns(LinkedInProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/twitter/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth.urls import default_urlpatterns 2 | 3 | from .provider import TwitterProvider 4 | 5 | urlpatterns = default_urlpatterns(TwitterProvider) 6 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/weibo/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | 3 | from .provider import WeiboProvider 4 | 5 | urlpatterns = default_urlpatterns(WeiboProvider) 6 | 7 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/bitbucket/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth.urls import default_urlpatterns 2 | from .provider import BitbucketProvider 3 | 4 | urlpatterns = default_urlpatterns(BitbucketProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/twitch/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | 3 | from .provider import TwitchProvider 4 | 5 | urlpatterns = default_urlpatterns(TwitchProvider) 6 | 7 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/angellist/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import AngelListProvider 3 | 4 | 5 | urlpatterns = default_urlpatterns(AngelListProvider) 6 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/evernote/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth.urls import default_urlpatterns 2 | 3 | from .provider import EvernoteProvider 4 | 5 | urlpatterns = default_urlpatterns(EvernoteProvider) 6 | 7 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/fxa/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import FirefoxAccountsProvider 3 | 4 | urlpatterns = default_urlpatterns(FirefoxAccountsProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/instagram/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import InstagramProvider 3 | 4 | urlpatterns = default_urlpatterns(InstagramProvider) 5 | 6 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/soundcloud/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import SoundCloudProvider 3 | 4 | urlpatterns = default_urlpatterns(SoundCloudProvider) 5 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/windowslive/urls.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 2 | from .provider import WindowsLiveProvider 3 | 4 | urlpatterns = default_urlpatterns(WindowsLiveProvider) 5 | -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | 4 | [django-allauth.django] 5 | file_filter = allauth/locale/{% trans "Note" %}: {% blocktrans %}you are already logged in as {{ user_display }}.{% endblocktrans %}
6 | -------------------------------------------------------------------------------- /allauth/exceptions.py: -------------------------------------------------------------------------------- 1 | class ImmediateHttpResponse(Exception): 2 | """ 3 | This exception is used to interrupt the flow of processing to immediately 4 | return a custom HttpResponse. 5 | """ 6 | def __init__(self, response): 7 | self.response = response 8 | -------------------------------------------------------------------------------- /allauth/socialaccount/apps.py: -------------------------------------------------------------------------------- 1 | # require django >= 1.7 2 | from django.apps import AppConfig 3 | from django.utils.translation import ugettext_lazy as _ 4 | 5 | 6 | class SocialAccountConfig(AppConfig): 7 | name = 'allauth.socialaccount' 8 | verbose_name = _('Social Accounts') 9 | -------------------------------------------------------------------------------- /allauth/account/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | #Ok, this is really weird but, in python3.2 we must import app_settings before 3 | # django imports apps; otherwise the module-class hack doesn't work as expected 4 | from . import app_settings 5 | 6 | default_app_config = 'allauth.account.apps.AccountConfig' 7 | -------------------------------------------------------------------------------- /allauth/account/context_processors.py: -------------------------------------------------------------------------------- 1 | def account(request): 2 | # We used to have this due to the now removed 3 | # settings.CONTACT_EMAIL. Let's see if we need a context processor 4 | # in the future, otherwise, deprecate this context processor 5 | # completely. 6 | return { } 7 | -------------------------------------------------------------------------------- /allauth/socialaccount/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | #Ok, this is really weird but, in python3.2 we must import app_settings before 3 | # django imports apps; otherwise the module-class hack doesn't work as expected 4 | from . import app_settings 5 | 6 | default_app_config = 'allauth.socialaccount.apps.SocialAccountConfig' 7 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/persona/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | 3 | from . import views 4 | 5 | urlpatterns = patterns('', 6 | url('^persona/login/$', 7 | views.persona_login, 8 | name="persona_login")) 9 | -------------------------------------------------------------------------------- /example/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | django>=1.4.3 2 | mock>=1.0.1 3 | # There is no OpenID lib that support both Python 2 and 3 from a single-source base. 4 | # So we have to choose between: 5 | # python-openid>=2.2.5 6 | # python3-openid>=3.0.1 7 | python-openid>=2.2.5 8 | requests>=2.0.0 9 | requests-oauthlib>=0.3.0 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *~ 3 | .idea 4 | .project 5 | .pydevproject 6 | *.geany 7 | docs/_build 8 | build 9 | dist 10 | *.egg* 11 | example/local_settings.py 12 | coverage.xml 13 | .ropeproject/* 14 | pep8.txt 15 | *.bak 16 | .#* 17 | \#* 18 | *.db 19 | *.tmp 20 | virtualenv 21 | .DS_Store 22 | 23 | *.prefs 24 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/facebook/templates/facebook/fbconnect.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /allauth/templates/account/account_inactive.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block head_title %}{% trans "Account Inactive" %}{% endblock %} 6 | 7 | {% block content %} 8 |{% trans "This account is inactive." %}
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /allauth/templates/account/password_reset_from_key_done.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% block head_title %}{% trans "Change Password" %}{% endblock %} 5 | 6 | {% block content %} 7 |{% trans 'Your password is now changed.' %}
9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /allauth/templates/account/signup_closed.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block head_title %}{% trans "Sign Up Closed" %}{% endblock %} 6 | 7 | {% block content %} 8 |{% trans "We are sorry, but the sign up is currently closed." %}
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/openid/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from .models import OpenIDStore, OpenIDNonce 4 | 5 | 6 | class OpenIDStoreAdmin(admin.ModelAdmin): 7 | pass 8 | 9 | class OpenIDNonceAdmin(admin.ModelAdmin): 10 | pass 11 | 12 | admin.site.register(OpenIDStore, OpenIDStoreAdmin) 13 | admin.site.register(OpenIDNonce, OpenIDNonceAdmin) 14 | -------------------------------------------------------------------------------- /allauth/templates/socialaccount/authentication_error.html: -------------------------------------------------------------------------------- 1 | {% extends "socialaccount/base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block head_title %}{% trans "Social Network Login Failure" %}{% endblock %} 6 | 7 | {% block content %} 8 |{% trans "An error occurred while attempting to login via your social network account." %}
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/openid/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | 3 | from . import views 4 | 5 | urlpatterns = patterns('', 6 | url('^openid/login/$', views.login, 7 | name="openid_login"), 8 | url('^openid/callback/$', views.callback, 9 | name='openid_callback'), 10 | ) 11 | -------------------------------------------------------------------------------- /allauth/templates/openid/login.html: -------------------------------------------------------------------------------- 1 | {% extends "openid/base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block head_title %}OpenID Sign In{% endblock %} 6 | 7 | {% block content %} 8 | 9 |{% blocktrans %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}
11 | 12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/facebook/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | 3 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns 4 | 5 | from .provider import FacebookProvider 6 | from . import views 7 | 8 | urlpatterns = default_urlpatterns(FacebookProvider) 9 | 10 | urlpatterns += patterns('', 11 | url('^facebook/login/token/$', views.login_by_token, 12 | name="facebook_login_by_token"), 13 | url('^facebook/channel/$', views.channel, name='facebook_channel'), 14 | ) 15 | -------------------------------------------------------------------------------- /allauth/templates/account/password_change.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block head_title %}{% trans "Change Password" %}{% endblock %} 6 | 7 | {% block content %} 8 |{% blocktrans %}You decided to cancel logging in to our site using one of your existing accounts. If this was a mistake, please proceed to sign in.{% endblocktrans %}
14 | 15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /allauth/account/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | # The `account` app never had any South migrations, as the data models 2 | # (specifically email uniqueness) depend on the settings, which is 3 | # something that collides with South freezing mechanism. For Django 4 | # 1.7, we are able to provide migrations, but to stay backwards 5 | # compatible we still need to make sure South does not pick up this 6 | # `migrations` package. Therefore, let's do a bogus import which 7 | # raises an ImportError in case South is used. 8 | 9 | from django.db import migrations # noqa 10 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/oauth/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url, include 2 | 3 | 4 | def default_urlpatterns(provider): 5 | 6 | urlpatterns = patterns(provider.package + '.views', 7 | url('^login/$', 'oauth_login', 8 | name=provider.id + "_login"), 9 | url('^login/callback/$', 'oauth_callback', 10 | name=provider.id + "_callback")) 11 | 12 | return patterns('', url('^' + provider.id + '/', include(urlpatterns))) 13 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/oauth2/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url, include 2 | 3 | 4 | def default_urlpatterns(provider): 5 | urlpatterns = patterns(provider.package + '.views', 6 | url('^login/$', 'oauth2_login', 7 | name=provider.id + "_login"), 8 | url('^login/callback/$', 'oauth2_callback', 9 | name=provider.id + "_callback")) 10 | 11 | return patterns('', url('^' + provider.id + '/', include(urlpatterns))) 12 | -------------------------------------------------------------------------------- /example/example/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, include, url 2 | from django.contrib import admin 3 | from django.views.generic.base import TemplateView 4 | admin.autodiscover() 5 | 6 | urlpatterns = patterns('', 7 | (r'^accounts/', include('allauth.urls')), 8 | url(r'^$', TemplateView.as_view(template_name='index.html')), 9 | url(r'^accounts/profile/$', TemplateView.as_view(template_name='profile.html')), 10 | url(r'^admin/', include(admin.site.urls)), 11 | ) 12 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/fxa/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import FirefoxAccountsProvider 6 | 7 | 8 | class FirefoxAccountsTests(create_oauth2_tests(registry.by_id(FirefoxAccountsProvider.id))): 9 | def get_mocked_response(self): 10 | return MockedResponse(200, """ 11 | { 12 | "uid":"6d940dd41e636cc156074109b8092f96", 13 | "email":"user@example.domain" 14 | }""") 15 | -------------------------------------------------------------------------------- /allauth/templates/account/password_reset_done.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load account %} 5 | 6 | {% block head_title %}{% trans "Password Reset" %}{% endblock %} 7 | 8 | {% block content %} 9 |{% blocktrans %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}
16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. django-allauth documentation master file, created by 2 | sphinx-quickstart on Wed Jun 6 22:58:42 2012. 3 | 4 | .. include:: ../README.rst 5 | 6 | Contents 7 | ======== 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | 12 | overview 13 | showcase 14 | installation 15 | configuration 16 | providers 17 | signals 18 | views 19 | templates 20 | decorators 21 | advanced 22 | faq 23 | changelog 24 | support 25 | 26 | 27 | ================== 28 | Indices and tables 29 | ================== 30 | 31 | * :ref:`genindex` 32 | * :ref:`search` 33 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox/tests.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from allauth.socialaccount.tests import create_oauth_tests 5 | from allauth.tests import MockedResponse 6 | from allauth.socialaccount.providers import registry 7 | 8 | from .provider import DropboxProvider 9 | 10 | 11 | class DropboxTests(create_oauth_tests(registry.by_id(DropboxProvider.id))): 12 | def get_mocked_response(self): 13 | # FIXME: Replace with actual/complete Dropbox response 14 | return [MockedResponse(200, """ 15 | { "uid": "123" } 16 | """)] 17 | -------------------------------------------------------------------------------- /allauth/templates/account/email_confirmed.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load account %} 5 | 6 | {% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} 7 | 8 | 9 | {% block content %} 10 | 11 |{% blocktrans with confirmation.email_address.email as email %}You have confirmed that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}
16 | 17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /example/example/templates/bootstrap/allauth/account/password_set.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load bootstrap %} 5 | 6 | {% block head_title %}{% trans "Set Password" %}{% endblock %} 7 | {% block account_nav_change_password %}active{% endblock %} 8 | 9 | {% block account_content %} 10 | 17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /example/example/templates/uniform/allauth/openid/login.html: -------------------------------------------------------------------------------- 1 | {% extends "openid/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load uni_form_tags %} 5 | 6 | {% block head_title %}OpenID Sign In{% endblock %} 7 | 8 | {% block content %} 9 | 10 |{% trans 'Are you sure you want to sign out?' %}
11 | 12 | 19 | 20 | 21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /allauth/templates/account/email/email_confirmation_message.txt: -------------------------------------------------------------------------------- 1 | {% load account %}{% user_display user as user_display %}{% load i18n %}{% autoescape off %}{% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Hello from {{ site_name }}! 2 | 3 | You're receiving this e-mail because user {{ user_display }} at {{ site_domain }} has given yours as an e-mail address to connect their account. 4 | 5 | To confirm this is correct, go to {{ activate_url }} 6 | {% endblocktrans %}{% endautoescape %} 7 | {% blocktrans with site_name=current_site.name site_domain=current_site.domain %}Thank you from {{ site_name }}! 8 | {{ site_domain }}{% endblocktrans %} 9 | -------------------------------------------------------------------------------- /example/example/templates/bootstrap/allauth/account/password_change.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load bootstrap %} 5 | 6 | {% block head_title %}{% trans "Change Password" %}{% endblock %} 7 | {% block account_nav_change_password %}active{% endblock %} 8 | 9 | {% block account_content %} 10 | 17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/amazon/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import AmazonProvider 6 | 7 | 8 | class AmazonTests(create_oauth2_tests(registry.by_id(AmazonProvider.id))): 9 | def get_mocked_response(self): 10 | return MockedResponse(200, """ 11 | { 12 | "Profile":{ 13 | "CustomerId":"amzn1.account.K2LI23KL2LK2", 14 | "Name":"John Doe", 15 | "PrimaryEmail":"johndoe@gmail.com" 16 | } 17 | }""") 18 | -------------------------------------------------------------------------------- /example/example/templates/bootstrap/allauth/account/logout.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block head_title %}{% trans "Sign Out" %}{% endblock %} 6 | 7 | {% block content %} 8 |{% trans 'Are you sure you want to sign out?' %}
11 | 12 | 19 | 20 | 21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/paypal/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import PaypalProvider 6 | 7 | class PaypalTests(create_oauth2_tests(registry.by_id(PaypalProvider.id))): 8 | def get_mocked_response(self): 9 | return MockedResponse(200, """ 10 | { 11 | "user_id": "https://www.paypal.com/webapps/auth/server/64ghr894040044", 12 | "name": "Jane Doe", 13 | "given_name": "Jane", 14 | "family_name": "Doe", 15 | "email": "janedoe@paypal.com" 16 | } 17 | """) 18 | -------------------------------------------------------------------------------- /allauth/socialaccount/signals.py: -------------------------------------------------------------------------------- 1 | from django.dispatch import Signal 2 | 3 | # Sent after a user successfully authenticates via a social provider, 4 | # but before the login is actually processed. This signal is emitted 5 | # for social logins, signups and when connecting additional social 6 | # accounts to an account. 7 | pre_social_login = Signal(providing_args=["request", "sociallogin"]) 8 | 9 | # Sent after a user connects a social account to a their local account. 10 | social_account_added = Signal(providing_args=["request", "sociallogin"]) 11 | 12 | # Sent after a user disconnects a social account from their local 13 | # account. 14 | social_account_removed = Signal(providing_args=["request", "socialaccount"]) 15 | -------------------------------------------------------------------------------- /example/example/templates/uniform/allauth/account/password_set.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load uni_form_tags %} 5 | 6 | {% block head_title %}{% trans "Set Password" %}{% endblock %} 7 | 8 | {% block content %} 9 |{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}
11 | 12 | 20 | 21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/linkedin_oauth2/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import LinkedInOAuth2Provider 6 | 7 | 8 | class LinkedInOAuth2Tests(create_oauth2_tests( 9 | registry.by_id(LinkedInOAuth2Provider.id))): 10 | 11 | def get_mocked_response(self): 12 | return MockedResponse(200, """ 13 | { 14 | "emailAddress": "raymond.penners@intenct.nl", 15 | "firstName": "Raymond", 16 | "id": "ZLARGMFT1M", 17 | "lastName": "Penners", 18 | "pictureUrl": "http://m.c.lnkd.licdn.com/mpr/mprx/0_e0hbvSLc", 19 | "publicProfileUrl": "http://www.linkedin.com/in/intenct" 20 | } 21 | """) 22 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/twitch/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import TwitchProvider 6 | 7 | class TwitchTests(create_oauth2_tests(registry.by_id(TwitchProvider.id))): 8 | def get_mocked_response(self): 9 | return MockedResponse(200, """{"name":"test_user1","created_at":"2011-06-03T17:49:19Z","updated_at":"2012-06-18T17:19:57Z","_links":{"self":"https://api.twitch.tv/kraken/users/test_user1"},"logo":"http://static-cdn.jtvnw.net/jtv_user_pictures/test_user1-profile_image-62e8318af864d6d7-300x300.jpeg","_id":22761313,"display_name":"test_user1","email":"asdf@asdf.com","partnered":true} 10 | 11 | """) 12 | 13 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox_oauth2/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class DropboxOAuth2Account(ProviderAccount): 7 | pass 8 | 9 | 10 | class DropboxOAuth2Provider(OAuth2Provider): 11 | id = 'dropbox_oauth2' 12 | name = 'Dropbox' 13 | package = 'allauth.socialaccount.providers.dropbox_oauth2' 14 | account_class = DropboxOAuth2Account 15 | 16 | def extract_uid(self, data): 17 | return data['uid'] 18 | 19 | def extract_common_fields(self, data): 20 | return dict(name=data.get('display_name'), 21 | email=data.get('email')) 22 | 23 | providers.registry.register(DropboxOAuth2Provider) 24 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth.provider import OAuthProvider 4 | 5 | 6 | class DropboxAccount(ProviderAccount): 7 | pass 8 | 9 | 10 | class DropboxProvider(OAuthProvider): 11 | id = 'dropbox' 12 | name = 'Dropbox' 13 | package = 'allauth.socialaccount.providers.dropbox' 14 | account_class = DropboxAccount 15 | 16 | def extract_uid(self, data): 17 | return data['uid'] 18 | 19 | def extract_common_fields(self, data): 20 | return dict(username=data.get('display_name'), 21 | name=data.get('display_name'), 22 | email=data.get('email')) 23 | 24 | providers.registry.register(DropboxProvider) 25 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/evernote/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth.provider import OAuthProvider 4 | 5 | 6 | class EvernoteAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return None 9 | 10 | def get_avatar_url(self): 11 | return None 12 | 13 | 14 | class EvernoteProvider(OAuthProvider): 15 | id = 'evernote' 16 | name = 'Evernote' 17 | package = 'allauth.socialaccount.providers.evernote' 18 | account_class = EvernoteAccount 19 | 20 | def extract_uid(self, data): 21 | return str(data['edam_userId']) 22 | 23 | def extract_common_fields(self, data): 24 | return data 25 | 26 | 27 | providers.registry.register(EvernoteProvider) 28 | -------------------------------------------------------------------------------- /allauth/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url, patterns, include 2 | 3 | try: 4 | import importlib 5 | except ImportError: 6 | from django.utils import importlib 7 | 8 | from allauth.socialaccount import providers 9 | 10 | from . import app_settings 11 | 12 | urlpatterns = patterns('', url('^', include('allauth.account.urls'))) 13 | 14 | if app_settings.SOCIALACCOUNT_ENABLED: 15 | urlpatterns += patterns('', url('^social/', 16 | include('allauth.socialaccount.urls'))) 17 | 18 | for provider in providers.registry.get_list(): 19 | try: 20 | prov_mod = importlib.import_module(provider.package + '.urls') 21 | except ImportError: 22 | continue 23 | prov_urlpatterns = getattr(prov_mod, 'urlpatterns', None) 24 | if prov_urlpatterns: 25 | urlpatterns += prov_urlpatterns 26 | -------------------------------------------------------------------------------- /example/example/templates/bootstrap/allauth/account/signup.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load bootstrap %} 4 | {% load i18n %} 5 | 6 | {% block head_title %}{% trans "Signup" %}{% endblock %} 7 | 8 | {% block content %} 9 |{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}
12 | 13 | 23 | 24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /docs/views.rst: -------------------------------------------------------------------------------- 1 | Views 2 | ===== 3 | 4 | Logout 5 | ------ 6 | 7 | The logout view (`allauth.account.views.LogoutView`) requests for 8 | confirmation before logging out. The user is logged out only when the 9 | confirmation is received by means of a POST request. 10 | 11 | If you are wondering why, consider what happens when a malicious user 12 | embeds the following image in a post:: 13 | 14 |{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to 11 | {{site_name}}. As a final step, please complete the following form:{% endblocktrans %}
12 | 13 | 21 | 22 | {% endblock %} 23 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/openid/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.utils.encoding import python_2_unicode_compatible 3 | 4 | @python_2_unicode_compatible 5 | class OpenIDStore(models.Model): 6 | server_url = models.CharField(max_length=255) 7 | handle = models.CharField(max_length=255) 8 | secret = models.TextField() 9 | issued = models.IntegerField() 10 | lifetime = models.IntegerField() 11 | assoc_type = models.TextField() 12 | 13 | def __str__(self): 14 | return self.server_url 15 | 16 | 17 | @python_2_unicode_compatible 18 | class OpenIDNonce(models.Model): 19 | server_url = models.CharField(max_length=255) 20 | timestamp = models.IntegerField() 21 | salt = models.CharField(max_length=255) 22 | date_created = models.DateTimeField(auto_now_add=True) 23 | 24 | def __str__(self): 25 | return self.server_url 26 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/fxa/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class FirefoxAccountsAccount(ProviderAccount): 7 | 8 | def to_str(self): 9 | return self.account.uid 10 | 11 | 12 | class FirefoxAccountsProvider(OAuth2Provider): 13 | id = 'fxa' 14 | name = 'Firefox Accounts' 15 | package = 'allauth.socialaccount.providers.fxa' 16 | account_class = FirefoxAccountsAccount 17 | 18 | def get_default_scope(self): 19 | return ['profile'] 20 | 21 | def extract_uid(self, data): 22 | return str(data['uid']) 23 | 24 | def extract_common_fields(self, data): 25 | return dict(email=data.get('email')) 26 | 27 | 28 | providers.registry.register(FirefoxAccountsProvider) 29 | -------------------------------------------------------------------------------- /allauth/account/signals.py: -------------------------------------------------------------------------------- 1 | from django.dispatch import Signal 2 | 3 | user_logged_in = Signal(providing_args=["request", "user"]) 4 | 5 | # Typically followed by `user_logged_in` (unless, e-mail verification kicks in) 6 | user_signed_up = Signal(providing_args=["request", "user"]) 7 | 8 | password_set = Signal(providing_args=["request", "user"]) 9 | password_changed = Signal(providing_args=["request", "user"]) 10 | password_reset = Signal(providing_args=["request", "user"]) 11 | 12 | email_confirmed = Signal(providing_args=["email_address"]) 13 | email_confirmation_sent = Signal(providing_args=["confirmation"]) 14 | 15 | email_changed = Signal(providing_args=["request", "user", 16 | "from_email_address", "to_email_address"]) 17 | email_added = Signal(providing_args=["request", "user", "email_address"]) 18 | email_removed = Signal(providing_args=["request", "user", "email_address"]) 19 | -------------------------------------------------------------------------------- /example/example/templates/bootstrap/allauth/account/base.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block content %} 6 | 7 |{% blocktrans %}This part of the site requires us to verify that 13 | you are who you claim to be. For this purpose, we require that you 14 | verify ownership of your e-mail address. {% endblocktrans %}
15 | 16 |{% blocktrans %}We have sent an e-mail to you for 17 | verification. Please click on the link inside this e-mail. Please 18 | contact us if you do not receive it within a few minutes.{% endblocktrans %}
19 | 20 |{% blocktrans %}Note: you can still change your e-mail address.{% endblocktrans %}
21 | 22 | 23 | {% endblock %} 24 | -------------------------------------------------------------------------------- /allauth/templates/account/password_reset.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load account %} 5 | 6 | {% block head_title %}{% trans "Password Reset" %}{% endblock %} 7 | 8 | {% block content %} 9 | 10 |{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}
16 | 17 | 22 | 23 |{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}
24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /example/example/templates/uniform/allauth/account/signup.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load uni_form_tags %} 5 | 6 | {% block head_title %}{% trans "Signup" %}{% endblock %} 7 | 8 | {% block content %} 9 |{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}
12 | 13 | 25 | 26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/feedly/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import FeedlyProvider 6 | 7 | class FeedlyTests(create_oauth2_tests(registry.by_id(FeedlyProvider.id))): 8 | def get_mocked_response(self): 9 | return MockedResponse(200, """ 10 | { 11 | "id": "c805fcbf-3acf-4302-a97e-d82f9d7c897f", 12 | "email": "jim.smith@gmail.com", 13 | "givenName": "Jim", 14 | "familyName": "Smith", 15 | "picture": "https://www.google.com/profile_images/1771656873/bigger.jpg", 16 | "gender": "male", 17 | "locale": "en", 18 | "reader": "9080770707070700", 19 | "google": "115562565652656565656", 20 | "twitter": "jimsmith", 21 | "facebook": "", 22 | "wave": "2013.7" 23 | }""") 24 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/linkedin/tests.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from allauth.socialaccount.tests import create_oauth_tests 5 | from allauth.tests import MockedResponse 6 | from allauth.socialaccount.providers import registry 7 | 8 | from .provider import LinkedInProvider 9 | 10 | 11 | class LinkedInTests(create_oauth_tests(registry.by_id(LinkedInProvider.id))): 12 | def get_mocked_response(self): 13 | return [MockedResponse(200, """ 14 |{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to 12 | {{site_name}}. As a final step, please complete the following form:{% endblocktrans %}
13 | 14 | 24 | 25 | 26 | {% endblock %} 27 | 28 | 29 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/instagram/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import InstagramProvider 6 | 7 | class InstagramTests(create_oauth2_tests(registry.by_id(InstagramProvider.id))): 8 | def get_mocked_response(self): 9 | return MockedResponse(200, """ 10 | { 11 | "meta": { 12 | "code": 200 13 | }, 14 | "data": { 15 | "username": "georgewhewell", 16 | "bio": "", 17 | "website": "", 18 | "profile_picture": "http://images.ak.instagram.com/profiles/profile_11428116_75sq_1339547159.jpg", 19 | "full_name": "georgewhewell", 20 | "counts": { 21 | "media": 74, 22 | "followed_by": 91, 23 | "follows": 104 24 | }, 25 | "id": "11428116" 26 | } 27 | }""") 28 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/oauth/provider.py: -------------------------------------------------------------------------------- 1 | from django.core.urlresolvers import reverse 2 | from django.utils.http import urlencode 3 | 4 | from allauth.socialaccount.providers.base import Provider 5 | 6 | 7 | class OAuthProvider(Provider): 8 | 9 | def get_login_url(self, request, **kwargs): 10 | url = reverse(self.id + "_login") 11 | if kwargs: 12 | url = url + '?' + urlencode(kwargs) 13 | return url 14 | 15 | def get_auth_url(self, request, action): 16 | # TODO: This is ugly. Move authorization_url away from the 17 | # adapter into the provider. Hmpf, the line between 18 | # adapter/provider is a bit too thin here. 19 | return None 20 | 21 | def get_scope(self, request): 22 | settings = self.get_settings() 23 | scope = settings.get('SCOPE') 24 | if scope is None: 25 | scope = self.get_default_scope() 26 | return scope 27 | 28 | def get_default_scope(self): 29 | return [] 30 | -------------------------------------------------------------------------------- /docs/showcase.rst: -------------------------------------------------------------------------------- 1 | Showcase 2 | ======== 3 | 4 | Here are some sites that have `django-allauth` up and running: 5 | 6 | - `Drakdoo: Bitcoin trading app{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktrans %}
12 | {% else %} 13 | {% if form %} 14 | 19 | {% else %} 20 |{% trans 'Your password is now changed.' %}
21 | {% endif %} 22 | {% endif %} 23 | {% endblock %} 24 | -------------------------------------------------------------------------------- /example/example/templates/bootstrap/allauth/account/password_reset_from_key.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load bootstrap %} 5 | 6 | {% block head_title %}{% trans "Change Password" %}{% endblock %} 7 | 8 | {% block content %} 9 |{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktrans %}
14 | 15 | {% else %} 16 | {% if form %} 17 | 24 | {% else %} 25 |{% trans 'Your password is now changed.' %}
26 | {% endif %} 27 | {% endif %} 28 | 29 | {% endblock %} 30 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: python 3 | python: 4 | - "2.6" 5 | - "2.7" 6 | - "3.2" 7 | - "3.3" 8 | - "3.4" 9 | env: 10 | global: 11 | - TEST_APPS="allauth account socialaccount amazon angellist bitbucket coinbase evernote feedly foursquare douban dropbox dropbox_oauth2 facebook flickr google github hubic instagram linkedin linkedin_oauth2 mailru odnoklassniki windowslive openid orcid paypal persona soundcloud spotify stackexchange tumblr twitch twitter vimeo vk weibo bitly xing" 12 | matrix: 13 | - DJANGO=Django==1.5 14 | - DJANGO=Django==1.6 15 | - DJANGO=Django==1.7 16 | install: 17 | - pip install $DJANGO --use-mirrors 18 | - pip install . --use-mirrors 19 | - pip install coverage 20 | branches: 21 | only: 22 | - master 23 | script: if [ -o $DJANGO == Django==1.5 ]; then coverage run manage.py test $TEST_APPS; else coverage run manage.py test allauth; fi 24 | matrix: 25 | exclude: 26 | - python: "2.6" 27 | env: DJANGO=Django==1.7 28 | after_success: 29 | - coverage report 30 | - pip install --quiet python-coveralls 31 | - coveralls 32 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/odnoklassniki/tests.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from __future__ import absolute_import 4 | 5 | from allauth.socialaccount.tests import create_oauth2_tests 6 | from allauth.socialaccount.providers import registry 7 | from allauth.tests import MockedResponse 8 | 9 | from .provider import OdnoklassnikiProvider 10 | 11 | 12 | class OdnoklassnikiTests( 13 | create_oauth2_tests(registry.by_id(OdnoklassnikiProvider.id))): 14 | 15 | def get_mocked_response(self, verified_email=True): 16 | return MockedResponse(200, """ 17 | {"uid":"561999209121","birthday":"1999-09-09","age":33,"first_name":"Ivan","last_name":"Petrov","name":"Ivan Petrov","locale":"en","gender":"male","has_email":true,"location":{"city":"Moscow","country":"RUSSIAN_FEDERATION","countryCode":"RU","countryName":"Russia"},"online":"web","pic_1":"http://i500.mycdn.me/res/stub_50x50.gif","pic_2":"http://usd1.mycdn.me/res/stub_128x96.gif"} 18 | """) 19 | 20 | def get_login_response_json(self, with_refresh_token=True): 21 | return '{"access_token": "testac"}' # noqa 22 | -------------------------------------------------------------------------------- /allauth/templates/account/email_confirm.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load account %} 5 | 6 | {% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} 7 | 8 | 9 | {% block content %} 10 |{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}
17 | 18 | 22 | 23 | {% else %} 24 | 25 | {% url 'account_email' as email_url %} 26 | 27 |{% blocktrans %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktrans %}
28 | 29 | {% endif %} 30 | 31 | {% endblock %} 32 | -------------------------------------------------------------------------------- /example/example/templates/uniform/allauth/socialaccount/signup.html: -------------------------------------------------------------------------------- 1 | {% extends "socialaccount/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load uni_form_tags %} 5 | 6 | {% block head_title %}{% trans "Signup" %}{% endblock %} 7 | 8 | {% block content %} 9 |{% blocktrans with provider_name=account.get_provider.name site_name=site.name %}You are about to use your {{provider_name}} account to login to 12 | {{site_name}}. As a final step, please complete the following form:{% endblocktrans %}
13 | 14 | 26 | 27 | 28 | {% endblock %} 29 | 30 | 31 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/douban/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class DoubanAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return self.account.extra_data.get('alt') 9 | 10 | def get_avatar_url(self): 11 | return self.account.extra_data.get('large_avatar') 12 | 13 | def to_str(self): 14 | dflt = super(DoubanAccount, self).to_str() 15 | return self.account.extra_data.get('name', dflt) 16 | 17 | 18 | class DoubanProvider(OAuth2Provider): 19 | id = 'douban' 20 | name = 'Douban' 21 | package = 'allauth.socialaccount.providers.douban' 22 | account_class = DoubanAccount 23 | 24 | def extract_uid(self, data): 25 | return data['id'] 26 | 27 | def extract_common_fields(self, data): 28 | return dict(username=data.get('id'), 29 | name=data.get('name')) 30 | 31 | 32 | providers.registry.register(DoubanProvider) 33 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/foursquare/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class FoursquareAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return 'https://foursquare.com/user/' \ 9 | + self.account.extra_data.get('id') 10 | 11 | def get_avatar_url(self): 12 | return self.account.extra_data.get('photo') 13 | 14 | 15 | class FoursquareProvider(OAuth2Provider): 16 | id = 'foursquare' 17 | name = 'Foursquare' 18 | package = 'allauth.socialaccount.providers.foursquare' 19 | account_class = FoursquareAccount 20 | 21 | def extract_uid(self, data): 22 | return str(data['id']) 23 | 24 | def extract_common_fields(self, data): 25 | return dict(first_name=data.get('firstname'), 26 | last_name=data.get('lastname'), 27 | email=data.get('contact').get('email')) 28 | 29 | 30 | providers.registry.register(FoursquareProvider) 31 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/spotify/views.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 2 | OAuth2LoginView, 3 | OAuth2CallbackView) 4 | import requests 5 | 6 | from .provider import SpotifyOAuth2Provider 7 | 8 | 9 | class SpotifyOAuth2Adapter(OAuth2Adapter): 10 | provider_id = SpotifyOAuth2Provider.id 11 | access_token_url = 'https://accounts.spotify.com/api/token' 12 | authorize_url = 'https://accounts.spotify.com/authorize' 13 | profile_url = 'https://api.spotify.com/v1/me' 14 | 15 | def complete_login(self, request, app, token, **kwargs): 16 | extra_data = requests.get(self.profile_url, params={ 17 | 'access_token': token.token 18 | }) 19 | 20 | return self.get_provider().sociallogin_from_response( 21 | request, 22 | extra_data.json() 23 | ) 24 | 25 | 26 | oauth_login = OAuth2LoginView.adapter_view(SpotifyOAuth2Adapter) 27 | oauth_callback = OAuth2CallbackView.adapter_view(SpotifyOAuth2Adapter) 28 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/douban/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | 7 | from .provider import DoubanProvider 8 | 9 | 10 | class DoubanOAuth2Adapter(OAuth2Adapter): 11 | provider_id = DoubanProvider.id 12 | access_token_url = 'https://www.douban.com/service/auth2/token' 13 | authorize_url = 'https://www.douban.com/service/auth2/auth' 14 | profile_url = 'https://api.douban.com/v2/user/~me' 15 | 16 | def complete_login(self, request, app, token, **kwargs): 17 | headers = {'Authorization': 'Bearer %s' % token.token} 18 | resp = requests.get(self.profile_url, headers=headers) 19 | extra_data = resp.json() 20 | return self.get_provider().sociallogin_from_response( 21 | request, extra_data) 22 | 23 | 24 | oauth2_login = OAuth2LoginView.adapter_view(DoubanOAuth2Adapter) 25 | oauth2_callback = OAuth2CallbackView.adapter_view(DoubanOAuth2Adapter) 26 | -------------------------------------------------------------------------------- /example/example/templates/bootstrap/allauth/account/email_confirm.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load account %} 5 | 6 | {% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} 7 | 8 | 9 | {% block content %} 10 |{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}
17 | 18 | 22 | 23 | {% else %} 24 | 25 | {% url 'account_email' as email_url %} 26 | 27 |{% blocktrans %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktrans %}
28 | 29 | {% endif %} 30 | 31 | {% endblock %} 32 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/bitly/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import BitlyProvider 6 | 7 | class BitlyTests(create_oauth2_tests(registry.by_id(BitlyProvider.id))): 8 | def get_mocked_response(self): 9 | return MockedResponse(200, """{ 10 | "data": { 11 | "apiKey": "R_f6397a37e765574f2e198dba5bb59522", 12 | "custom_short_domain": null, 13 | "display_name": null, 14 | "full_name": "Bitly API Oauth Demo Account", 15 | "is_enterprise": false, 16 | "login": "bitlyapioauthdemo", 17 | "member_since": 1331567982, 18 | "profile_image": "http://bitly.com/u/bitlyapioauthdemo.png", 19 | "profile_url": "http://bitly.com/u/bitlyapioauthdemo", 20 | "share_accounts": [], 21 | "tracking_domains": [] 22 | }, 23 | "status_code": 200, 24 | "status_txt": "OK" 25 | }""") 26 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/github/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | from .provider import GitHubProvider 7 | 8 | 9 | class GitHubOAuth2Adapter(OAuth2Adapter): 10 | provider_id = GitHubProvider.id 11 | access_token_url = 'https://github.com/login/oauth/access_token' 12 | authorize_url = 'https://github.com/login/oauth/authorize' 13 | profile_url = 'https://api.github.com/user' 14 | 15 | def complete_login(self, request, app, token, **kwargs): 16 | resp = requests.get(self.profile_url, 17 | params={'access_token': token.token}) 18 | extra_data = resp.json() 19 | return self.get_provider().sociallogin_from_response(request, 20 | extra_data) 21 | 22 | 23 | oauth2_login = OAuth2LoginView.adapter_view(GitHubOAuth2Adapter) 24 | oauth2_callback = OAuth2CallbackView.adapter_view(GitHubOAuth2Adapter) 25 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/github/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class GitHubAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return self.account.extra_data.get('html_url') 9 | 10 | def get_avatar_url(self): 11 | return self.account.extra_data.get('avatar_url') 12 | 13 | def to_str(self): 14 | dflt = super(GitHubAccount, self).to_str() 15 | return self.account.extra_data.get('name', dflt) 16 | 17 | 18 | class GitHubProvider(OAuth2Provider): 19 | id = 'github' 20 | name = 'GitHub' 21 | package = 'allauth.socialaccount.providers.github' 22 | account_class = GitHubAccount 23 | 24 | def extract_uid(self, data): 25 | return str(data['id']) 26 | 27 | def extract_common_fields(self, data): 28 | return dict(email=data.get('email'), 29 | username=data.get('login'), 30 | name=data.get('name')) 31 | 32 | 33 | providers.registry.register(GitHubProvider) 34 | -------------------------------------------------------------------------------- /example/example/templates/uniform/allauth/account/password_reset.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load uni_form_tags %} 5 | {% load account %} 6 | 7 | {% block head_title %}{% trans "Password Reset" %}{% endblock %} 8 | 9 | {% block content %} 10 | 11 |{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}
17 | 18 | 27 | 28 |{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}
29 | {% endblock %} 30 | 31 | {% block extra_body %} 32 | 35 | {% endblock %} 36 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/__init__.py: -------------------------------------------------------------------------------- 1 | from django.conf import settings 2 | 3 | try: 4 | import importlib 5 | except ImportError: 6 | from django.utils import importlib 7 | 8 | 9 | class ProviderRegistry(object): 10 | def __init__(self): 11 | self.provider_map = {} 12 | self.loaded = False 13 | 14 | def get_list(self): 15 | self.load() 16 | return self.provider_map.values() 17 | 18 | def register(self, cls): 19 | self.provider_map[cls.id] = cls() 20 | 21 | def by_id(self, id): 22 | self.load() 23 | return self.provider_map[id] 24 | 25 | def as_choices(self): 26 | self.load() 27 | for provider in self.get_list(): 28 | yield (provider.id, provider.name) 29 | 30 | def load(self): 31 | if not self.loaded: 32 | for app in settings.INSTALLED_APPS: 33 | provider_module = app + '.provider' 34 | try: 35 | importlib.import_module(provider_module) 36 | except ImportError: 37 | pass 38 | self.loaded = True 39 | 40 | registry = ProviderRegistry() 41 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/soundcloud/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | from .provider import SoundCloudProvider 7 | 8 | 9 | class SoundCloudOAuth2Adapter(OAuth2Adapter): 10 | provider_id = SoundCloudProvider.id 11 | access_token_url = 'https://api.soundcloud.com/oauth2/token' 12 | authorize_url = 'https://soundcloud.com/connect' 13 | profile_url = 'https://api.soundcloud.com/me.json' 14 | 15 | def complete_login(self, request, app, token, **kwargs): 16 | resp = requests.get(self.profile_url, 17 | params={'oauth_token': token.token}) 18 | extra_data = resp.json() 19 | return self.get_provider().sociallogin_from_response(request, 20 | extra_data) 21 | 22 | 23 | oauth2_login = OAuth2LoginView.adapter_view(SoundCloudOAuth2Adapter) 24 | oauth2_callback = OAuth2CallbackView.adapter_view(SoundCloudOAuth2Adapter) 25 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/twitch/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | 7 | from .provider import TwitchProvider 8 | 9 | 10 | class TwitchOAuth2Adapter(OAuth2Adapter): 11 | provider_id = TwitchProvider.id 12 | access_token_url = 'https://api.twitch.tv/kraken/oauth2/token' 13 | authorize_url = 'https://api.twitch.tv/kraken/oauth2/authorize' 14 | profile_url = 'https://api.twitch.tv/kraken/user' 15 | 16 | def complete_login(self, request, app, token, **kwargs): 17 | resp = requests.get(self.profile_url, 18 | params={'oauth_token': token.token}) 19 | extra_data = resp.json() 20 | return self.get_provider().sociallogin_from_response(request, 21 | extra_data) 22 | 23 | 24 | oauth2_login = OAuth2LoginView.adapter_view(TwitchOAuth2Adapter) 25 | oauth2_callback = OAuth2CallbackView.adapter_view(TwitchOAuth2Adapter) 26 | -------------------------------------------------------------------------------- /example/example/templates/bootstrap/allauth/account/password_reset.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load bootstrap %} 5 | {% load account %} 6 | 7 | {% block head_title %}{% trans "Password Reset" %}{% endblock %} 8 | 9 | {% block content %} 10 | 11 |{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}
17 | 18 | 25 | 26 |{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}
27 | {% endblock %} 28 | 29 | {% block extra_body %} 30 | 33 | {% endblock %} 34 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/coinbase/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class CoinbaseAccount(ProviderAccount): 7 | def get_avatar_url(self): 8 | return None 9 | 10 | def to_str(self): 11 | return self.account.extra_data.get('name', 12 | super(CoinbaseAccount, self).to_str()) 13 | 14 | 15 | class CoinbaseProvider(OAuth2Provider): 16 | id = 'coinbase' 17 | name = 'Coinbase' 18 | package = 'allauth.socialaccount.providers.coinbase' 19 | account_class = CoinbaseAccount 20 | 21 | def get_default_scope(self): 22 | # See: https://coinbase.com/docs/api/permissions 23 | return ['user'] 24 | 25 | def extract_uid(self, data): 26 | return str(data['id']) 27 | 28 | def extract_common_fields(self, data): 29 | # See: https://coinbase.com/api/doc/1.0/users/index.html 30 | return dict(name=data['name'], email=data['email']) 31 | 32 | providers.registry.register(CoinbaseProvider) 33 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/instagram/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | from .provider import InstagramProvider 7 | 8 | 9 | class InstagramOAuth2Adapter(OAuth2Adapter): 10 | provider_id = InstagramProvider.id 11 | access_token_url = 'https://instagram.com/oauth/access_token' 12 | authorize_url = 'https://instagram.com/oauth/authorize' 13 | profile_url = 'https://api.instagram.com/v1/users/self' 14 | 15 | def complete_login(self, request, app, token, **kwargs): 16 | resp = requests.get(self.profile_url, 17 | params={'access_token': token.token}) 18 | extra_data = resp.json() 19 | return self.get_provider().sociallogin_from_response(request, 20 | extra_data) 21 | 22 | 23 | oauth2_login = OAuth2LoginView.adapter_view(InstagramOAuth2Adapter) 24 | oauth2_callback = OAuth2CallbackView.adapter_view(InstagramOAuth2Adapter) 25 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/twitch/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class TwitchAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return 'http://twitch.tv/' + self.account.extra_data.get('name') 9 | 10 | def get_avatar_url(self): 11 | return self.account.extra_data.get('logo') 12 | 13 | def to_str(self): 14 | dflt = super(TwitchAccount, self).to_str() 15 | return self.account.extra_data.get('name', dflt) 16 | 17 | 18 | class TwitchProvider(OAuth2Provider): 19 | id = 'twitch' 20 | name = 'Twitch' 21 | package = 'allauth.socialaccount.providers.twitch' 22 | account_class = TwitchAccount 23 | 24 | def extract_uid(self, data): 25 | return str(data['_id']) 26 | 27 | def extract_common_fields(self, data): 28 | return dict(username=data.get('display_name'), 29 | name=data.get('name'), 30 | email=data.get('email')) 31 | 32 | 33 | providers.registry.register(TwitchProvider) 34 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/weibo/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class WeiboAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | # profile_url = "u/3195025850" 9 | return 'http://www.weibo.com/' + self.account.extra_data.get('profile_url') 10 | 11 | def get_avatar_url(self): 12 | return self.account.extra_data.get('avatar_large') 13 | 14 | def to_str(self): 15 | dflt = super(WeiboAccount, self).to_str() 16 | return self.account.extra_data.get('name', dflt) 17 | 18 | 19 | class WeiboProvider(OAuth2Provider): 20 | id = 'weibo' 21 | name = 'Weibo' 22 | package = 'allauth.socialaccount.providers.weibo' 23 | account_class = WeiboAccount 24 | 25 | def extract_uid(self, data): 26 | return data['idstr'] 27 | 28 | def extract_common_fields(self, data): 29 | return dict(username=data.get('screen_name'), 30 | name=data.get('name')) 31 | 32 | 33 | providers.registry.register(WeiboProvider) 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2010-2015 Raymond Penners and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /allauth/account/admin.py: -------------------------------------------------------------------------------- 1 | import django 2 | from django.contrib import admin 3 | 4 | from .models import EmailConfirmation, EmailAddress 5 | from .adapter import get_adapter 6 | 7 | 8 | class EmailAddressAdmin(admin.ModelAdmin): 9 | list_display = ('email', 'user', 'primary', 'verified') 10 | list_filter = ('primary', 'verified') 11 | search_fields = [] 12 | raw_id_fields = ('user',) 13 | 14 | def __init__(self, *args, **kwargs): 15 | super(EmailAddressAdmin, self).__init__(*args, **kwargs) 16 | if not self.search_fields and django.VERSION[:2] < (1, 7): 17 | self.search_fields = self.get_search_fields(None) 18 | 19 | def get_search_fields(self, request): 20 | base_fields = get_adapter().get_user_search_fields() 21 | return ['email'] + list(map(lambda a: 'user__' + a, base_fields)) 22 | 23 | 24 | class EmailConfirmationAdmin(admin.ModelAdmin): 25 | list_display = ('email_address', 'created', 'sent', 'key') 26 | list_filter = ('sent',) 27 | raw_id_fields = ('email_address',) 28 | 29 | 30 | admin.site.register(EmailConfirmation, EmailConfirmationAdmin) 31 | admin.site.register(EmailAddress, EmailAddressAdmin) 32 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/bitly/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class BitlyAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return self.account.extra_data.get('profile_url') 9 | 10 | def get_avatar_url(self): 11 | return self.account.extra_data.get('profile_image') 12 | 13 | def to_str(self): 14 | dflt = super(BitlyAccount, self).to_str() 15 | return '%s (%s)' % ( 16 | self.account.extra_data.get('full_name', ''), 17 | dflt, 18 | ) 19 | 20 | 21 | class BitlyProvider(OAuth2Provider): 22 | id = 'bitly' 23 | name = 'Bitly' 24 | package = 'allauth.socialaccount.providers.bitly' 25 | account_class = BitlyAccount 26 | 27 | def extract_uid(self, data): 28 | return str(data['login']) 29 | 30 | def extract_common_fields(self, data): 31 | return dict(username=data['login'], 32 | name=data.get('full_name')) 33 | 34 | 35 | providers.registry.register(BitlyProvider) 36 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/tumblr/tests.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from allauth.socialaccount.tests import create_oauth_tests 5 | from allauth.tests import MockedResponse 6 | from allauth.socialaccount.providers import registry 7 | 8 | from .provider import TumblrProvider 9 | 10 | 11 | class TumblrTests(create_oauth_tests(registry.by_id(TumblrProvider.id))): 12 | def get_mocked_response(self): 13 | return [MockedResponse(200, """ 14 | { 15 | "meta": { 16 | "status": 200, 17 | "msg": "OK" 18 | }, 19 | "response": { 20 | "user": { 21 | "following": 263, 22 | "default_post_format": "html", 23 | "name": "derekg", 24 | "likes": 606, 25 | "blogs": [ 26 | { 27 | "name": "derekg", 28 | "title": "Derek Gottfrid", 29 | "url": "http://derekg.org/", 30 | "tweet": "auto", 31 | "primary": true, 32 | "followers": 33004929 33 | }, 34 | { 35 | "name": "ihatehipstrz", 36 | "title": "I Hate Hipstrz" 37 | } 38 | ] 39 | } 40 | } } 41 | """)] 42 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/angellist/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | from .provider import AngelListProvider 7 | 8 | 9 | class AngelListOAuth2Adapter(OAuth2Adapter): 10 | provider_id = AngelListProvider.id 11 | access_token_url = 'https://angel.co/api/oauth/token/' 12 | authorize_url = 'https://angel.co/api/oauth/authorize/' 13 | profile_url = 'https://api.angel.co/1/me/' 14 | supports_state = False 15 | 16 | def complete_login(self, request, app, token, **kwargs): 17 | resp = requests.get(self.profile_url, 18 | params={'access_token': token.token}) 19 | extra_data = resp.json() 20 | return self.get_provider().sociallogin_from_response(request, 21 | extra_data) 22 | 23 | 24 | oauth2_login = OAuth2LoginView.adapter_view(AngelListOAuth2Adapter) 25 | oauth2_callback = OAuth2CallbackView.adapter_view(AngelListOAuth2Adapter) 26 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/angellist/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class AngelListAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return self.account.extra_data.get('angellist_url') 9 | 10 | def get_avatar_url(self): 11 | return self.account.extra_data.get('image') 12 | 13 | def to_str(self): 14 | dflt = super(AngelListAccount, self).to_str() 15 | return self.account.extra_data.get('name', dflt) 16 | 17 | 18 | class AngelListProvider(OAuth2Provider): 19 | id = 'angellist' 20 | name = 'AngelList' 21 | package = 'allauth.socialaccount.providers.angellist' 22 | account_class = AngelListAccount 23 | 24 | def extract_uid(self, data): 25 | return str(data['id']) 26 | 27 | def extract_common_fields(self, data): 28 | return dict(email=data.get('email'), 29 | username=data.get('angellist_url').split('/')[-1], 30 | name=data.get('name')) 31 | 32 | 33 | providers.registry.register(AngelListProvider) 34 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/bitly/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | 7 | from .provider import BitlyProvider 8 | 9 | 10 | class BitlyOAuth2Adapter(OAuth2Adapter): 11 | provider_id = BitlyProvider.id 12 | access_token_url = 'https://api-ssl.bitly.com/oauth/access_token' 13 | authorize_url = 'https://bitly.com/oauth/authorize' 14 | profile_url = 'https://api-ssl.bitly.com/v3/user/info' 15 | supports_state = False 16 | 17 | def complete_login(self, request, app, token, **kwargs): 18 | resp = requests.get( 19 | self.profile_url, 20 | params={'access_token': token.token} 21 | ) 22 | extra_data = resp.json()['data'] 23 | return self.get_provider().sociallogin_from_response(request, 24 | extra_data) 25 | 26 | 27 | oauth2_login = OAuth2LoginView.adapter_view(BitlyOAuth2Adapter) 28 | oauth2_callback = OAuth2CallbackView.adapter_view(BitlyOAuth2Adapter) 29 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/feedly/views.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | import requests 4 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 5 | OAuth2LoginView, 6 | OAuth2CallbackView) 7 | from .provider import FeedlyProvider 8 | 9 | 10 | class FeedlyOAuth2Adapter(OAuth2Adapter): 11 | provider_id = FeedlyProvider.id 12 | access_token_url = 'https://cloud.feedly.com/v3/auth/token' 13 | authorize_url = 'https://cloud.feedly.com/v3/auth/auth' 14 | profile_url = 'https://cloud.feedly.com/v3/profile' 15 | 16 | def complete_login(self, request, app, token, **kwargs): 17 | headers = {'Authorization': 'OAuth {0}'.format(token.token)} 18 | resp = requests.get(self.profile_url, headers=headers) 19 | extra_data = resp.json() 20 | return self.get_provider().sociallogin_from_response(request, 21 | extra_data) 22 | 23 | 24 | oauth2_login = OAuth2LoginView.adapter_view(FeedlyOAuth2Adapter) 25 | oauth2_callback = OAuth2CallbackView.adapter_view(FeedlyOAuth2Adapter) 26 | -------------------------------------------------------------------------------- /allauth/app_settings.py: -------------------------------------------------------------------------------- 1 | import django 2 | from django.conf import settings 3 | from django.core.exceptions import ImproperlyConfigured 4 | 5 | SOCIALACCOUNT_ENABLED = 'allauth.socialaccount' in settings.INSTALLED_APPS 6 | 7 | if SOCIALACCOUNT_ENABLED: 8 | allauth_ctx = 'allauth.socialaccount.context_processors.socialaccount' 9 | ctx_present = True 10 | 11 | if django.VERSION < (1, 8,): 12 | if allauth_ctx not in settings.TEMPLATE_CONTEXT_PROCESSORS: 13 | ctx_present = False 14 | else: 15 | for engine in settings.TEMPLATES: 16 | if allauth_ctx not in engine.get('OPTIONS', {})\ 17 | .get('context_processors', []): 18 | ctx_present = False 19 | break 20 | 21 | if not ctx_present: 22 | raise ImproperlyConfigured("socialaccount context processor " 23 | "not found in settings.TEMPLATE_CONTEXT_PROCESSORS." 24 | "See settings.py instructions here: " 25 | "https://github.com/pennersr/django-allauth#installation") 26 | 27 | 28 | LOGIN_REDIRECT_URL = getattr(settings, 'LOGIN_REDIRECT_URL', '/') 29 | 30 | USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') 31 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/persona/tests.py: -------------------------------------------------------------------------------- 1 | try: 2 | from mock import patch 3 | except ImportError: 4 | from unittest.mock import patch 5 | 6 | from django.test import TestCase 7 | from django.test.utils import override_settings 8 | from django.core.urlresolvers import reverse 9 | 10 | from allauth.utils import get_user_model 11 | 12 | SOCIALACCOUNT_PROVIDERS = {'persona': 13 | {'AUDIENCE': 'https://www.example.com:433'}} 14 | 15 | 16 | class PersonaTests(TestCase): 17 | 18 | @override_settings(SOCIALACCOUNT_PROVIDERS=SOCIALACCOUNT_PROVIDERS) 19 | def test_login(self): 20 | with patch('allauth.socialaccount.providers.persona.views' 21 | '.requests') as requests_mock: 22 | requests_mock.post.return_value.json.return_value = { 23 | 'status': 'okay', 24 | 'email': 'persona@mail.com' 25 | } 26 | resp = self.client.post(reverse('persona_login'), 27 | dict(assertion='dummy')) 28 | self.assertEqual('http://testserver/accounts/profile/', 29 | resp['location']) 30 | get_user_model().objects.get(email='persona@mail.com') 31 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/weibo/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import WeiboProvider 6 | 7 | class WeiboTests(create_oauth2_tests(registry.by_id(WeiboProvider.id))): 8 | def get_mocked_response(self): 9 | return MockedResponse(200, """{"bi_followers_count": 0, "domain": "", "avatar_large": "http://tp3.sinaimg.cn/3195025850/180/0/0", "block_word": 0, "star": 0, "id": 3195025850, "city": "1", "verified": false, "follow_me": false, "verified_reason": "", "followers_count": 6, "location": "\u5317\u4eac \u4e1c\u57ce\u533a", "mbtype": 0, "profile_url": "u/3195025850", "province": "11", "statuses_count": 0, "description": "", "friends_count": 0, "online_status": 0, "mbrank": 0, "idstr": "3195025850", "profile_image_url": "http://tp3.sinaimg.cn/3195025850/50/0/0", "allow_all_act_msg": false, "allow_all_comment": true, "geo_enabled": true, "name": "pennersr", "lang": "zh-cn", "weihao": "", "remark": "", "favourites_count": 0, "screen_name": "pennersr", "url": "", "gender": "f", "created_at": "Tue Feb 19 19:43:39 +0800 2013", "verified_type": -1, "following": false} 10 | 11 | """) 12 | -------------------------------------------------------------------------------- /example/example/templates/plain/example/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktrans %}
13 | {% else %} 14 | {% if form %} 15 | 24 | {% else %} 25 |{% trans 'Your password is now changed.' %}
26 | {% endif %} 27 | {% endif %} 28 | {% endblock %} 29 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/amazon/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class AmazonAccount(ProviderAccount): 7 | def to_str(self): 8 | return self.account.extra_data.get('name', 9 | super(AmazonAccount, self).to_str()) 10 | 11 | 12 | class AmazonProvider(OAuth2Provider): 13 | id = 'amazon' 14 | name = 'Amazon' 15 | package = 'allauth.socialaccount.providers.amazon' 16 | account_class = AmazonAccount 17 | 18 | def get_default_scope(self): 19 | return ['profile'] 20 | 21 | def extract_uid(self, data): 22 | return str(data['user_id']) 23 | 24 | def extract_common_fields(self, data): 25 | # Hackish way of splitting the fullname. 26 | # Asumes no middlenames. 27 | name = data.get('name', '') 28 | first_name, last_name = name, '' 29 | if name and ' ' in name: 30 | first_name, last_name = name.split(' ', 1) 31 | return dict(email=data['email'], 32 | last_name=last_name, 33 | first_name=first_name) 34 | 35 | providers.registry.register(AmazonProvider) 36 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/persona/templates/persona/auth.html: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 36 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox_oauth2/tests.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from allauth.socialaccount.tests import create_oauth2_tests 5 | from allauth.tests import MockedResponse 6 | from allauth.socialaccount.providers import registry 7 | 8 | from .provider import DropboxOAuth2Provider 9 | 10 | 11 | class DropboxOAuth2Tests(create_oauth2_tests(registry.by_id( 12 | DropboxOAuth2Provider.id))): 13 | def get_mocked_response(self): 14 | return [MockedResponse(200, """{ 15 | "display_name": "Björn Andersson", 16 | "name_details": { 17 | "surname": "Andersson", 18 | "familiar_name": "Björn", 19 | "given_name": "Björn" 20 | }, 21 | "locale": "en", 22 | "email": "test@example.se", 23 | "uid": 1234567890, 24 | "email_verified": true, 25 | "quota_info": { 26 | "shared": 3195052017, 27 | "datastores": 0, 28 | "quota": 61337501696, 29 | "normal": 15455059441 30 | }, 31 | "is_paired": true, 32 | "team": null, 33 | "referral_link": "https://db.tt/UzhBTVjU", 34 | "country": "SE" 35 | }""")] 36 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/soundcloud/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class SoundCloudAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return self.account.extra_data.get('permalink_url') 9 | 10 | def get_avatar_url(self): 11 | return self.account.extra_data.get('avatar_url') 12 | 13 | def to_str(self): 14 | dflt = super(SoundCloudAccount, self).to_str() 15 | full_name = self.account.extra_data.get('full_name') 16 | username = self.account.extra_data.get('username') 17 | return full_name or username or dflt 18 | 19 | 20 | class SoundCloudProvider(OAuth2Provider): 21 | id = 'soundcloud' 22 | name = 'SoundCloud' 23 | package = 'allauth.socialaccount.providers.soundcloud' 24 | account_class = SoundCloudAccount 25 | 26 | 27 | def extract_uid(self, data): 28 | return str(data['id']) 29 | 30 | def extract_common_fields(self, data): 31 | return dict(name=data.get('full_name'), 32 | username=data.get('username'), 33 | email=data.get('email')) 34 | 35 | 36 | providers.registry.register(SoundCloudProvider) 37 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/vk/tests.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from allauth.socialaccount.tests import create_oauth2_tests 4 | from allauth.socialaccount.providers import registry 5 | from allauth.tests import MockedResponse 6 | 7 | from .provider import VKProvider 8 | 9 | 10 | class VKTests(create_oauth2_tests(registry.by_id(VKProvider.id))): 11 | 12 | def get_mocked_response(self, verified_email=True): 13 | return MockedResponse(200, """ 14 | {"response": [{"last_name": "Penners", "university_name": "", "photo": "http://vk.com/images/camera_c.gif", "sex": 2, "photo_medium": "http://vk.com/images/camera_b.gif", "relation": "0", "timezone": 1, "photo_big": "http://vk.com/images/camera_a.gif", "uid": 219004864, "universities": [], "city": "1430", "first_name": "Raymond", "faculty_name": "", "online": 1, "counters": {"videos": 0, "online_friends": 0, "notes": 0, "audios": 0, "photos": 0, "followers": 0, "groups": 0, "user_videos": 0, "albums": 0, "friends": 0}, "home_phone": "", "faculty": 0, "nickname": "", "screen_name": "id219004864", "has_mobile": 1, "country": "139", "university": 0, "graduation": 0, "activity": "", "last_seen": {"time": 1377805189}}]} 15 | """) 16 | 17 | def get_login_response_json(self, with_refresh_token=True): 18 | return '{"user_id": 219004864, "access_token":"testac"}' 19 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox_oauth2/views.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 2 | OAuth2LoginView, 3 | OAuth2CallbackView) 4 | import requests 5 | 6 | from .provider import DropboxOAuth2Provider 7 | 8 | 9 | class DropboxOAuth2Adapter(OAuth2Adapter): 10 | provider_id = DropboxOAuth2Provider.id 11 | access_token_url = 'https://api.dropbox.com/1/oauth2/token' 12 | authorize_url = 'https://www.dropbox.com/1/oauth2/authorize' 13 | profile_url = 'https://api.dropbox.com/1/account/info' 14 | redirect_uri_protocol = 'https' 15 | 16 | def complete_login(self, request, app, token, **kwargs): 17 | extra_data = requests.get(self.profile_url, params={ 18 | 'access_token': token.token 19 | }) 20 | 21 | # This only here because of weird response from the test suite 22 | if isinstance(extra_data, list): 23 | extra_data = extra_data[0] 24 | 25 | return self.get_provider().sociallogin_from_response( 26 | request, 27 | extra_data.json() 28 | ) 29 | 30 | 31 | oauth_login = OAuth2LoginView.adapter_view(DropboxOAuth2Adapter) 32 | oauth_callback = OAuth2CallbackView.adapter_view(DropboxOAuth2Adapter) 33 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/oauth2/provider.py: -------------------------------------------------------------------------------- 1 | try: 2 | from urllib.parse import parse_qsl 3 | except ImportError: 4 | from urlparse import parse_qsl 5 | 6 | from django.core.urlresolvers import reverse 7 | from django.utils.http import urlencode 8 | 9 | from allauth.socialaccount.providers.base import Provider 10 | 11 | 12 | class OAuth2Provider(Provider): 13 | 14 | def get_login_url(self, request, **kwargs): 15 | url = reverse(self.id + "_login") 16 | if kwargs: 17 | url = url + '?' + urlencode(kwargs) 18 | return url 19 | 20 | def get_auth_params(self, request, action): 21 | settings = self.get_settings() 22 | ret = settings.get('AUTH_PARAMS', {}) 23 | dynamic_auth_params = request.GET.get('auth_params', None) 24 | if dynamic_auth_params: 25 | ret.update(dict(parse_qsl(dynamic_auth_params))) 26 | return ret 27 | 28 | def get_scope(self, request): 29 | settings = self.get_settings() 30 | scope = settings.get('SCOPE') 31 | if scope is None: 32 | scope = self.get_default_scope() 33 | dynamic_scope = request.GET.get('scope', None) 34 | if dynamic_scope: 35 | scope.extend(dynamic_scope.split(',')) 36 | return scope 37 | 38 | def get_default_scope(self): 39 | return [] 40 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/instagram/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class InstagramAccount(ProviderAccount): 7 | 8 | PROFILE_URL = 'http://instagram.com/' 9 | 10 | def get_profile_url(self): 11 | return self.PROFILE_URL + self.account.extra_data.get('username') 12 | 13 | def get_avatar_url(self): 14 | return self.account.extra_data.get('profile_picture') 15 | 16 | def to_str(self): 17 | dflt = super(InstagramAccount, self).to_str() 18 | return self.account.extra_data.get('username', dflt) 19 | 20 | 21 | class InstagramProvider(OAuth2Provider): 22 | id = 'instagram' 23 | name = 'Instagram' 24 | package = 'allauth.socialaccount.providers.instagram' 25 | account_class = InstagramAccount 26 | 27 | def extract_extra_data(self, data): 28 | return data.get('data', {}) 29 | 30 | def get_default_scope(self): 31 | return ['basic'] 32 | 33 | def extract_uid(self, data): 34 | return str(data['data']['id']) 35 | 36 | def extract_common_fields(self, data): 37 | return dict(username=data['data'].get('username')) 38 | 39 | 40 | providers.registry.register(InstagramProvider) 41 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/paypal/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class PaypalAccount(ProviderAccount): 7 | def get_avatar_url(self): 8 | return self.account.extra_data.get('picture') 9 | 10 | def to_str(self): 11 | return self.account.extra_data.get('name', 12 | super(PaypalAccount, self).to_str()) 13 | 14 | 15 | class PaypalProvider(OAuth2Provider): 16 | id = 'paypal' 17 | name = 'Paypal' 18 | package = 'allauth.socialaccount.providers.paypal' 19 | account_class = PaypalAccount 20 | 21 | def get_default_scope(self): 22 | # See: https://developer.paypal.com/docs/integration/direct/identity/attributes/ # noqa 23 | return ['openid', 'email'] 24 | 25 | def extract_uid(self, data): 26 | return str(data['user_id']) 27 | 28 | def extract_common_fields(self, data): 29 | # See: https://developer.paypal.com/docs/api/#get-user-information 30 | return dict(first_name=data.get('given_name', ''), 31 | last_name=data.get('family_name', ''), 32 | email=data.get('email')) 33 | 34 | providers.registry.register(PaypalProvider) 35 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/feedly/provider.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from allauth.socialaccount import providers 4 | from allauth.socialaccount.providers.base import ProviderAccount 5 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 6 | 7 | 8 | class FeedlyAccount(ProviderAccount): 9 | def get_avatar_url(self): 10 | return self.account.extra_data.get('picture') 11 | 12 | def to_str(self): 13 | name = '{0} {1}'.format(self.account.extra_data.get('givenName', ''), 14 | self.account.extra_data.get('familyName', '')) 15 | if name.strip() != '': 16 | return name 17 | return super(FeedlyAccount, self).to_str() 18 | 19 | 20 | class FeedlyProvider(OAuth2Provider): 21 | id = str('feedly') 22 | name = 'Feedly' 23 | package = 'allauth.socialaccount.providers.feedly' 24 | account_class = FeedlyAccount 25 | 26 | def get_default_scope(self): 27 | return ['https://cloud.feedly.com/subscriptions'] 28 | 29 | def extract_uid(self, data): 30 | return str(data['id']) 31 | 32 | def extract_common_fields(self, data): 33 | return dict(email=data.get('email'), 34 | last_name=data.get('familyName'), 35 | first_name=data.get('givenName')) 36 | 37 | providers.registry.register(FeedlyProvider) 38 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/orcid/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | from .provider import OrcidProvider 7 | 8 | 9 | class OrcidOAuth2Adapter(OAuth2Adapter): 10 | provider_id = OrcidProvider.id 11 | # ORCID Public API (not Member API): 12 | # http://support.orcid.org/knowledgebase/articles/335483-the-public- 13 | # client-orcid-api 14 | authorize_url = 'https://orcid.org/oauth/authorize' 15 | access_token_url = 'https://pub.orcid.org/oauth/token' 16 | profile_url = 'https://pub.orcid.org/v1.1/%s/orcid-profile' 17 | 18 | def complete_login(self, request, app, token, **kwargs): 19 | resp = requests.get(self.profile_url % kwargs['response']['orcid'], 20 | params={'access_token': token.token}, 21 | headers={'accept': 'application/orcid+json'}) 22 | extra_data = resp.json() 23 | return self.get_provider().sociallogin_from_response(request, 24 | extra_data) 25 | 26 | 27 | oauth2_login = OAuth2LoginView.adapter_view(OrcidOAuth2Adapter) 28 | oauth2_callback = OAuth2CallbackView.adapter_view(OrcidOAuth2Adapter) -------------------------------------------------------------------------------- /allauth/account/templatetags/account.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | 3 | from allauth.account.utils import user_display 4 | 5 | register = template.Library() 6 | 7 | class UserDisplayNode(template.Node): 8 | 9 | def __init__(self, user, as_var=None): 10 | self.user_var = template.Variable(user) 11 | self.as_var = as_var 12 | 13 | def render(self, context): 14 | user = self.user_var.resolve(context) 15 | 16 | display = user_display(user) 17 | 18 | if self.as_var: 19 | context[self.as_var] = display 20 | return "" 21 | return display 22 | 23 | 24 | @register.tag(name="user_display") 25 | def do_user_display(parser, token): 26 | """ 27 | Example usage:: 28 | 29 | {% user_display user %} 30 | 31 | or if you need to use in a {% blocktrans %}:: 32 | 33 | {% user_display user as user_display %} 34 | {% blocktrans %}{{ user_display }} has sent you a gift.{% endblocktrans %} 35 | 36 | """ 37 | bits = token.split_contents() 38 | if len(bits) == 2: 39 | user = bits[1] 40 | as_var = None 41 | elif len(bits) == 4: 42 | user = bits[1] 43 | as_var = bits[3] 44 | else: 45 | raise template.TemplateSyntaxError("'%s' takes either two or four arguments" % bits[0]) 46 | 47 | return UserDisplayNode(user, as_var) 48 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/xing/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth.provider import OAuthProvider 4 | 5 | 6 | class XingAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return self.account.extra_data.get('permalink') 9 | 10 | def get_avatar_url(self): 11 | return self.account.extra_data.get( 12 | 'photo_urls', {}).get('large') 13 | 14 | def to_str(self): 15 | dflt = super(XingAccount, self).to_str() 16 | first_name = self.account.extra_data.get('first_name', '') 17 | last_name = self.account.extra_data.get('last_name', '') 18 | name = ' '.join([first_name, last_name]).strip() 19 | return name or dflt 20 | 21 | 22 | class XingProvider(OAuthProvider): 23 | id = 'xing' 24 | name = 'Xing' 25 | package = 'allauth.socialaccount.providers.xing' 26 | account_class = XingAccount 27 | 28 | def extract_uid(self, data): 29 | return data['id'] 30 | 31 | def extract_common_fields(self, data): 32 | return dict(email=data.get('active_email'), 33 | username=data.get('page_name'), 34 | first_name=data.get('first_name'), 35 | last_name=data.get('last_name')) 36 | 37 | providers.registry.register(XingProvider) 38 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/spotify/tests.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from allauth.socialaccount.tests import create_oauth2_tests 5 | from allauth.tests import MockedResponse 6 | from allauth.socialaccount.providers import registry 7 | 8 | from .provider import SpotifyOAuth2Provider 9 | 10 | 11 | class SpotifyOAuth2Tests(create_oauth2_tests(registry.by_id( 12 | SpotifyOAuth2Provider.id))): 13 | def get_mocked_response(self): 14 | return MockedResponse(200, """{ 15 | "birthdate": "1937-06-01", 16 | "country": "SE", 17 | "display_name": "JM Wizzler", 18 | "email": "email@example.com", 19 | "external_urls": { 20 | "spotify": "https://open.spotify.com/user/wizzler" 21 | }, 22 | "followers" : { 23 | "href" : null, 24 | "total" : 3829 25 | }, 26 | "href": "https://api.spotify.com/v1/users/wizzler", 27 | "id": "wizzler", 28 | "images": [ 29 | { 30 | "height": null, 31 | "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-frc3/t1.0-1/1970403_10152215092574354_1798272330_n.jpg", 32 | "width": null 33 | } 34 | ], 35 | "product": "premium", 36 | "type": "user", 37 | "uri": "spotify:user:wizzler" 38 | }""") 39 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/xing/views.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from allauth.socialaccount.providers.oauth.client import OAuth 4 | from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, 5 | OAuthLoginView, 6 | OAuthCallbackView) 7 | 8 | from .provider import XingProvider 9 | 10 | 11 | class XingAPI(OAuth): 12 | url = 'https://api.xing.com/v1/users/me.json' 13 | 14 | def get_user_info(self): 15 | user = json.loads(self.query(self.url)) 16 | return user 17 | 18 | 19 | class XingOAuthAdapter(OAuthAdapter): 20 | provider_id = XingProvider.id 21 | request_token_url = 'https://api.xing.com/v1/request_token' 22 | access_token_url = 'https://api.xing.com/v1/access_token' 23 | authorize_url = 'https://www.xing.com/v1/authorize' 24 | 25 | def complete_login(self, request, app, token, response): 26 | client = XingAPI(request, app.client_id, app.secret, 27 | self.request_token_url) 28 | extra_data = client.get_user_info()['users'][0] 29 | return self.get_provider().sociallogin_from_response(request, 30 | extra_data) 31 | 32 | oauth_login = OAuthLoginView.adapter_view(XingOAuthAdapter) 33 | oauth_callback = OAuthCallbackView.adapter_view(XingOAuthAdapter) 34 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/coinbase/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import CoinbaseProvider 6 | 7 | class CoinbaseTests(create_oauth2_tests(registry.by_id(CoinbaseProvider.id))): 8 | def get_mocked_response(self): 9 | return MockedResponse(200, """ 10 | { 11 | "users": [ 12 | { 13 | "user": { 14 | "id": "512db383f8182bd24d000001", 15 | "name": "User One", 16 | "email": "user1@example.com", 17 | "time_zone": "Pacific Time (US & Canada)", 18 | "native_currency": "USD", 19 | "balance": { 20 | "amount": "49.76000000", 21 | "currency": "BTC" 22 | }, 23 | "merchant": { 24 | "company_name": "Company Name, Inc.", 25 | "logo": { 26 | "small": "http://smalllogo.example", 27 | "medium": "http://mediumlogo.example", 28 | "url": "http://logo.example" 29 | } 30 | }, 31 | "buy_level": 1, 32 | "sell_level": 1, 33 | "buy_limit": { 34 | "amount": "10.00000000", 35 | "currency": "BTC" 36 | }, 37 | "sell_limit": { 38 | "amount": "100.00000000", 39 | "currency": "BTC" 40 | } 41 | } 42 | } 43 | ] 44 | } 45 | """) 46 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/stackexchange/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class StackExchangeAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return self.account.extra_data.get('html_url') 9 | 10 | def get_avatar_url(self): 11 | return self.account.extra_data.get('avatar_url') 12 | 13 | def to_str(self): 14 | dflt = super(StackExchangeAccount, self).to_str() 15 | return self.account.extra_data.get('name', dflt) 16 | 17 | 18 | class StackExchangeProvider(OAuth2Provider): 19 | id = 'stackexchange' 20 | name = 'Stack Exchange' 21 | package = 'allauth.socialaccount.providers.stackexchange' 22 | account_class = StackExchangeAccount 23 | 24 | def get_site(self): 25 | settings = self.get_settings() 26 | return settings.get('SITE', 'stackoverflow') 27 | 28 | def extract_uid(self, data): 29 | # `user_id` varies if you use the same account for 30 | # e.g. StackOverflow and ServerFault. Therefore, we pick 31 | # `account_id`. 32 | uid = str(data['account_id']) 33 | return uid 34 | 35 | def extract_common_fields(self, data): 36 | return dict(username=data.get('display_name')) 37 | 38 | 39 | providers.registry.register(StackExchangeProvider) 40 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/tumblr/views.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from allauth.socialaccount.providers.oauth.client import OAuth 4 | from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, 5 | OAuthLoginView, 6 | OAuthCallbackView) 7 | 8 | from .provider import TumblrProvider 9 | 10 | 11 | class TumblrAPI(OAuth): 12 | url = 'http://api.tumblr.com/v2/user/info' 13 | 14 | def get_user_info(self): 15 | data = json.loads(self.query(self.url)) 16 | return data['response']['user'] 17 | 18 | 19 | class TumblrOAuthAdapter(OAuthAdapter): 20 | provider_id = TumblrProvider.id 21 | request_token_url = 'https://www.tumblr.com/oauth/request_token' 22 | access_token_url = 'https://www.tumblr.com/oauth/access_token' 23 | authorize_url = 'https://www.tumblr.com/oauth/authorize' 24 | 25 | def complete_login(self, request, app, token, response): 26 | client = TumblrAPI(request, app.client_id, app.secret, 27 | self.request_token_url) 28 | extra_data = client.get_user_info() 29 | return self.get_provider().sociallogin_from_response(request, 30 | extra_data) 31 | 32 | 33 | oauth_login = OAuthLoginView.adapter_view(TumblrOAuthAdapter) 34 | oauth_callback = OAuthCallbackView.adapter_view(TumblrOAuthAdapter) 35 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/amazon/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 3 | OAuth2LoginView, 4 | OAuth2CallbackView) 5 | 6 | from .provider import AmazonProvider 7 | 8 | 9 | class AmazonOAuth2Adapter(OAuth2Adapter): 10 | provider_id = AmazonProvider.id 11 | access_token_url = 'https://api.amazon.com/auth/o2/token' 12 | authorize_url = 'http://www.amazon.com/ap/oa' 13 | profile_url = 'https://www.amazon.com/ap/user/profile' 14 | supports_state = False 15 | redirect_uri_protocol = 'https' 16 | 17 | def complete_login(self, request, app, token, **kwargs): 18 | response = requests.get( 19 | self.profile_url, 20 | params={'access_token': token}) 21 | extra_data = response.json() 22 | if 'Profile' in extra_data: 23 | extra_data = { 24 | 'user_id': extra_data['Profile']['CustomerId'], 25 | 'name': extra_data['Profile']['Name'], 26 | 'email': extra_data['Profile']['PrimaryEmail'] 27 | } 28 | return self.get_provider().sociallogin_from_response( 29 | request, 30 | extra_data) 31 | 32 | 33 | oauth2_login = OAuth2LoginView.adapter_view(AmazonOAuth2Adapter) 34 | oauth2_callback = OAuth2CallbackView.adapter_view(AmazonOAuth2Adapter) 35 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/stackexchange/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | from allauth.socialaccount.providers import registry 7 | 8 | from .provider import StackExchangeProvider 9 | 10 | 11 | class StackExchangeOAuth2Adapter(OAuth2Adapter): 12 | provider_id = StackExchangeProvider.id 13 | access_token_url = 'https://stackexchange.com/oauth/access_token' 14 | authorize_url = 'https://stackexchange.com/oauth' 15 | profile_url = 'https://api.stackexchange.com/2.1/me' 16 | 17 | def complete_login(self, request, app, token, **kwargs): 18 | provider = registry.by_id(app.provider) 19 | site = provider.get_site() 20 | resp = requests.get(self.profile_url, 21 | params={'access_token': token.token, 22 | 'key': app.key, 23 | 'site': site}) 24 | extra_data = resp.json()['items'][0] 25 | return self.get_provider().sociallogin_from_response(request, 26 | extra_data) 27 | 28 | 29 | oauth2_login = OAuth2LoginView.adapter_view(StackExchangeOAuth2Adapter) 30 | oauth2_callback = OAuth2CallbackView.adapter_view(StackExchangeOAuth2Adapter) 31 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/vimeo/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import VimeoProvider 6 | 7 | class VimeoTests(create_oauth_tests(registry.by_id(VimeoProvider.id))): 8 | def get_mocked_response(self): 9 | return [MockedResponse(200, """ 10 | {"generated_in":"0.0137","stat":"ok","person":{"created_on":"2013-04-08 14:24:47","id":"17574504","is_contact":"0","is_plus":"0","is_pro":"0","is_staff":"0","is_subscribed_to":"0","username":"user17574504","display_name":"Raymond Penners","location":"","url":[""],"bio":"","number_of_contacts":"0","number_of_uploads":"0","number_of_likes":"0","number_of_videos":"0","number_of_videos_appears_in":"0","number_of_albums":"0","number_of_channels":"0","number_of_groups":"0","profileurl":"http:\\/\\/vimeo.com\\/user17574504","videosurl":"http:\\/\\/vimeo.com\\/user17574504\\/videos","portraits":{"portrait":[{"height":"30","width":"30","_content":"http:\\/\\/a.vimeocdn.com\\/images_v6\\/portraits\\/portrait_30_yellow.png"},{"height":"75","width":"75","_content":"http:\\/\\/a.vimeocdn.com\\/images_v6\\/portraits\\/portrait_75_yellow.png"},{"height":"100","width":"100","_content":"http:\\/\\/a.vimeocdn.com\\/images_v6\\/portraits\\/portrait_100_yellow.png"},{"height":"300","width":"300","_content":"http:\\/\\/a.vimeocdn.com\\/images_v6\\/portraits\\/portrait_300_yellow.png"}]}}} 11 | """)] 12 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/vimeo/views.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from allauth.socialaccount.providers.oauth.client import OAuth 4 | from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, 5 | OAuthLoginView, 6 | OAuthCallbackView) 7 | from .provider import VimeoProvider 8 | 9 | 10 | class VimeoAPI(OAuth): 11 | url = 'http://vimeo.com/api/rest/v2?method=vimeo.people.getInfo' 12 | 13 | def get_user_info(self): 14 | url = self.url 15 | data = json.loads(self.query(url, params=dict(format='json'))) 16 | return data['person'] 17 | 18 | 19 | class VimeoOAuthAdapter(OAuthAdapter): 20 | provider_id = VimeoProvider.id 21 | request_token_url = 'https://vimeo.com/oauth/request_token' 22 | access_token_url = 'https://vimeo.com/oauth/access_token' 23 | authorize_url = 'https://vimeo.com/oauth/authorize' 24 | 25 | def complete_login(self, request, app, token, response): 26 | client = VimeoAPI(request, app.client_id, app.secret, 27 | self.request_token_url) 28 | extra_data = client.get_user_info() 29 | return self.get_provider().sociallogin_from_response(request, 30 | extra_data) 31 | 32 | 33 | oauth_login = OAuthLoginView.adapter_view(VimeoOAuthAdapter) 34 | oauth_callback = OAuthCallbackView.adapter_view(VimeoOAuthAdapter) 35 | -------------------------------------------------------------------------------- /example/example/templates/bootstrap/allauth/account/login.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load bootstrap %} 5 | {% load account %} 6 | 7 | {% block head_title %}{% trans "Sign In" %}{% endblock %} 8 | 9 | 10 | {% block content %} 11 | 12 |{% blocktrans with site.name as site_name %}Please sign in with one 16 | of your existing third party accounts. Or, sign up 17 | for a {{ site_name }} account and sign in 18 | below:{% endblocktrans %}
19 | 20 | 29 | 30 | {% include "socialaccount/snippets/login_extra.html" %} 31 | 32 | {% endif %} 33 | 34 | 46 | 47 | {% endblock %} 48 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/foursquare/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | 7 | from .provider import FoursquareProvider 8 | 9 | 10 | class FoursquareOAuth2Adapter(OAuth2Adapter): 11 | provider_id = FoursquareProvider.id 12 | access_token_url = 'https://foursquare.com/oauth2/access_token' 13 | # Issue ?? -- this one authenticates over and over again... 14 | # authorize_url = 'https://foursquare.com/oauth2/authorize' 15 | authorize_url = 'https://foursquare.com/oauth2/authenticate' 16 | profile_url = 'https://api.foursquare.com/v2/users/self' 17 | 18 | def complete_login(self, request, app, token, **kwargs): 19 | # Foursquare needs a version number for their API requests as documented here https://developer.foursquare.com/overview/versioning 20 | resp = requests.get(self.profile_url, 21 | params={'oauth_token': token.token, 'v': '20140116'}) 22 | extra_data = resp.json()['response']['user'] 23 | return self.get_provider().sociallogin_from_response(request, 24 | extra_data) 25 | 26 | 27 | oauth2_login = OAuth2LoginView.adapter_view(FoursquareOAuth2Adapter) 28 | oauth2_callback = OAuth2CallbackView.adapter_view(FoursquareOAuth2Adapter) 29 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/soundcloud/tests.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount.tests import create_oauth2_tests 2 | from allauth.tests import MockedResponse 3 | from allauth.socialaccount.providers import registry 4 | 5 | from .provider import SoundCloudProvider 6 | 7 | class SoundCloudTests(create_oauth2_tests(registry.by_id(SoundCloudProvider.id))): 8 | def get_mocked_response(self): 9 | return MockedResponse(200, """ 10 | { 11 | "website": null, 12 | "myspace_name": null, 13 | "public_favorites_count": 0, 14 | "followings_count": 1, 15 | "full_name": "", 16 | "id": 22341947, 17 | "city": null, 18 | "track_count": 0, 19 | "playlist_count": 0, 20 | "discogs_name": null, 21 | "private_tracks_count": 0, 22 | "followers_count": 0, 23 | "online": true, 24 | "username": "user187631676", 25 | "description": null, 26 | "kind": "user", 27 | "website_title": null, 28 | "primary_email_confirmed": false, 29 | "permalink_url": "http://soundcloud.com/user187631676", 30 | "private_playlists_count": 0, 31 | "permalink": "user187631676", 32 | "country": null, 33 | "uri": "https://api.soundcloud.com/users/22341947", 34 | "avatar_url": "https://a1.sndcdn.com/images/default_avatar_large.png?4b4189b", 35 | "plan": "Free" 36 | }""") 37 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/dropbox/views.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from allauth.socialaccount.providers.oauth.client import OAuth 4 | from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, 5 | OAuthLoginView, 6 | OAuthCallbackView) 7 | 8 | from .provider import DropboxProvider 9 | 10 | 11 | class DropboxAPI(OAuth): 12 | """ 13 | Verifying twitter credentials 14 | """ 15 | url = 'https://api.dropbox.com/1/account/info' 16 | 17 | def get_user_info(self): 18 | user = json.loads(self.query(self.url)) 19 | return user 20 | 21 | 22 | class DropboxOAuthAdapter(OAuthAdapter): 23 | provider_id = DropboxProvider.id 24 | request_token_url = 'https://api.dropbox.com/1/oauth/request_token' 25 | access_token_url = 'https://api.dropbox.com/1/oauth/access_token' 26 | authorize_url = 'https://www.dropbox.com/1/oauth/authorize' 27 | 28 | def complete_login(self, request, app, token, response): 29 | client = DropboxAPI(request, app.client_id, app.secret, 30 | self.request_token_url) 31 | extra_data = client.get_user_info() 32 | return self.get_provider().sociallogin_from_response(request, 33 | extra_data) 34 | 35 | 36 | oauth_login = OAuthLoginView.adapter_view(DropboxOAuthAdapter) 37 | oauth_callback = OAuthCallbackView.adapter_view(DropboxOAuthAdapter) 38 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/evernote/views.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from datetime import datetime 3 | 4 | from allauth.socialaccount import app_settings 5 | from allauth.socialaccount.providers.oauth.views import (OAuthAdapter, 6 | OAuthCallbackView, 7 | OAuthLoginView) 8 | 9 | from .provider import EvernoteProvider 10 | 11 | 12 | class EvernoteOAuthAdapter(OAuthAdapter): 13 | provider_id = EvernoteProvider.id 14 | settings = app_settings.PROVIDERS.get(provider_id, {}) 15 | request_token_url = 'https://%s/oauth' % (settings.get( 16 | 'EVERNOTE_HOSTNAME', 17 | 'sandbox.evernote.com')) 18 | access_token_url = 'https://%s/oauth' % (settings.get( 19 | 'EVERNOTE_HOSTNAME', 20 | 'sandbox.evernote.com')) 21 | authorize_url = 'https://%s/OAuth.action' % (settings.get( 22 | 'EVERNOTE_HOSTNAME', 23 | 'sandbox.evernote.com')) 24 | 25 | def complete_login(self, request, app, token, response): 26 | token.expires_at = datetime.fromtimestamp( 27 | int(response['edam_expires']) / 1000.0) 28 | extra_data = response 29 | return self.get_provider().sociallogin_from_response(request, 30 | extra_data) 31 | 32 | 33 | oauth_login = OAuthLoginView.adapter_view(EvernoteOAuthAdapter) 34 | oauth_callback = OAuthCallbackView.adapter_view(EvernoteOAuthAdapter) 35 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/mailru/views.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from hashlib import md5 3 | from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, 4 | OAuth2LoginView, 5 | OAuth2CallbackView) 6 | 7 | from .provider import MailRuProvider 8 | 9 | 10 | class MailRuOAuth2Adapter(OAuth2Adapter): 11 | provider_id = MailRuProvider.id 12 | access_token_url = 'https://connect.mail.ru/oauth/token' 13 | authorize_url = 'https://connect.mail.ru/oauth/authorize' 14 | profile_url = 'http://www.appsmail.ru/platform/api' 15 | 16 | def complete_login(self, request, app, token, **kwargs): 17 | uid = kwargs['response']['x_mailru_vid'] 18 | data = {'method': 'users.getInfo', 19 | 'app_id': app.client_id, 20 | 'secure': '1', 21 | 'uids': uid} 22 | param_list = sorted(list(item + '=' + data[item] for item in data)) 23 | data['sig'] = md5( 24 | (''.join(param_list) + app.secret).encode('utf-8') 25 | ).hexdigest() 26 | response = requests.get(self.profile_url, params=data) 27 | extra_data = response.json()[0] 28 | return self.get_provider().sociallogin_from_response(request, 29 | extra_data) 30 | 31 | 32 | oauth2_login = OAuth2LoginView.adapter_view(MailRuOAuth2Adapter) 33 | oauth2_callback = OAuth2CallbackView.adapter_view(MailRuOAuth2Adapter) 34 | -------------------------------------------------------------------------------- /allauth/templates/account/login.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load account %} 5 | 6 | {% block head_title %}{% trans "Sign In" %}{% endblock %} 7 | 8 | {% block content %} 9 | 10 |{% blocktrans with site.name as site_name %}Please sign in with one 14 | of your existing third party accounts. Or, sign up 15 | for a {{ site_name }} account and sign in below:{% endblocktrans %}
16 | 17 | 26 | 27 | {% include "socialaccount/snippets/login_extra.html" %} 28 | 29 | {% else %} 30 |{% blocktrans %}If you have not created an account yet, then please 31 | sign up first.{% endblocktrans %}
32 | {% endif %} 33 | 34 | 43 | 44 | {% endblock %} 45 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/mailru/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class MailRuAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return self.account.extra_data.get('link') 9 | 10 | def get_avatar_url(self): 11 | ret = None 12 | if self.account.extra_data.get('has_pic'): 13 | pic_big_url = self.account.extra_data.get('pic_big') 14 | pic_small_url = self.account.extra_data.get('pic_small') 15 | if pic_big_url: 16 | return pic_big_url 17 | elif pic_small_url: 18 | return pic_small_url 19 | else: 20 | return ret 21 | 22 | def to_str(self): 23 | dflt = super(MailRuAccount, self).to_str() 24 | return self.account.extra_data.get('name', dflt) 25 | 26 | 27 | class MailRuProvider(OAuth2Provider): 28 | id = 'mailru' 29 | name = 'Mail.RU' 30 | package = 'allauth.socialaccount.providers.mailru' 31 | account_class = MailRuAccount 32 | 33 | def extract_uid(self, data): 34 | return data['uid'] 35 | 36 | def extract_common_fields(self, data): 37 | return dict(email=data.get('email'), 38 | last_name=data.get('last_name'), 39 | username=data.get('nick'), 40 | first_name=data.get('first_name')) 41 | 42 | 43 | providers.registry.register(MailRuProvider) 44 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/windowslive/provider.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from allauth.socialaccount import providers 4 | from allauth.socialaccount.providers.base import ProviderAccount 5 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 6 | 7 | 8 | class WindowsLiveAccount(ProviderAccount): 9 | 10 | def to_str(self): 11 | name = '{0} {1}'.format(self.account.extra_data.get('first_name', ''), 12 | self.account.extra_data.get('last_name', '')) 13 | if name.strip() != '': 14 | return name 15 | return super(WindowsLiveAccount, self).to_str() 16 | 17 | 18 | class WindowsLiveProvider(OAuth2Provider): 19 | id = str('windowslive') 20 | name = 'Live' 21 | package = 'allauth.socialaccount.providers.windowslive' 22 | account_class = WindowsLiveAccount 23 | 24 | def get_default_scope(self): 25 | """ 26 | Doc on scopes available at 27 | http://msdn.microsoft.com/en-us/library/dn631845.aspx 28 | """ 29 | return ['wl.basic', 'wl.emails'] 30 | 31 | def extract_uid(self, data): 32 | return str(data['id']) 33 | 34 | def extract_common_fields(self, data): 35 | try: 36 | email = data.get('emails').get('preferred') 37 | except: 38 | email = None 39 | 40 | return dict(email=email, 41 | last_name=data.get('last_name'), 42 | first_name=data.get('first_name')) 43 | 44 | 45 | providers.registry.register(WindowsLiveProvider) 46 | -------------------------------------------------------------------------------- /example/example/templates/uniform/allauth/account/login.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load uni_form_tags %} 5 | {% load account %} 6 | 7 | {% block head_title %}{% trans "Sign In" %}{% endblock %} 8 | 9 | 10 | {% block content %} 11 | 12 |{% blocktrans with site.name as site_name %}Please sign in with one 16 | of your existing third party accounts. Or, sign up 17 | for a {{site_name}} account and sign in 18 | below:{% endblocktrans %}
19 | 20 | 29 | 30 | {% include "socialaccount/snippets/login_extra.html" %} 31 | 32 | {% endif %} 33 | 34 | 48 | 49 | {% endblock %} 50 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/odnoklassniki/provider.py: -------------------------------------------------------------------------------- 1 | from allauth.socialaccount import providers 2 | from allauth.socialaccount.providers.base import ProviderAccount 3 | from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider 4 | 5 | 6 | class OdnoklassnikiAccount(ProviderAccount): 7 | def get_profile_url(self): 8 | return self.account.extra_data.get('link') 9 | 10 | def get_avatar_url(self): 11 | ret = None 12 | pic_big_url = self.account.extra_data.get('pic1024x768') 13 | pic_medium_url = self.account.extra_data.get('pic640x480') 14 | pic_small_url = self.account.extra_data.get('pic190x190') 15 | if pic_big_url: 16 | return pic_big_url 17 | elif pic_medium_url: 18 | return pic_medium_url 19 | elif pic_small_url: 20 | return pic_small_url 21 | else: 22 | return ret 23 | 24 | def to_str(self): 25 | dflt = super(OdnoklassnikiAccount, self).to_str() 26 | return self.account.extra_data.get('name', dflt) 27 | 28 | 29 | class OdnoklassnikiProvider(OAuth2Provider): 30 | id = 'odnoklassniki' 31 | name = 'Odnoklassniki' 32 | package = 'allauth.socialaccount.providers.odnoklassniki' 33 | account_class = OdnoklassnikiAccount 34 | 35 | def extract_uid(self, data): 36 | return data['uid'] 37 | 38 | def extract_common_fields(self, data): 39 | return dict(last_name=data.get('last_name'), 40 | first_name=data.get('first_name')) 41 | 42 | 43 | providers.registry.register(OdnoklassnikiProvider) 44 | -------------------------------------------------------------------------------- /allauth/socialaccount/providers/openid/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import models, migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ] 11 | 12 | operations = [ 13 | migrations.CreateModel( 14 | name='OpenIDNonce', 15 | fields=[ 16 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 17 | ('server_url', models.CharField(max_length=255)), 18 | ('timestamp', models.IntegerField()), 19 | ('salt', models.CharField(max_length=255)), 20 | ('date_created', models.DateTimeField(auto_now_add=True)), 21 | ], 22 | options={ 23 | }, 24 | bases=(models.Model,), 25 | ), 26 | migrations.CreateModel( 27 | name='OpenIDStore', 28 | fields=[ 29 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 30 | ('server_url', models.CharField(max_length=255)), 31 | ('handle', models.CharField(max_length=255)), 32 | ('secret', models.TextField()), 33 | ('issued', models.IntegerField()), 34 | ('lifetime', models.IntegerField()), 35 | ('assoc_type', models.TextField()), 36 | ], 37 | options={ 38 | }, 39 | bases=(models.Model,), 40 | ), 41 | ] 42 | -------------------------------------------------------------------------------- /example/README.rst: -------------------------------------------------------------------------------- 1 | =============================== 2 | Running the example application 3 | =============================== 4 | 5 | Assuming you use virtualenv, follow these steps to download and run the 6 | django-allauth example application in this directory: 7 | 8 | :: 9 | 10 | $ git clone git://github.com/pennersr/django-allauth.git 11 | $ cd django-allauth/example 12 | $ virtualenv venv 13 | $ . venv/bin/activate 14 | $ pip install -r requirements.txt 15 | 16 | Now we need to create the database tables and an admin user. 17 | On Django 1.6 and below, run the following and when prompted to create a 18 | superuser choose yes and follow the instructions: 19 | 20 | :: 21 | 22 | $ python manage.py syncdb --migrate 23 | 24 | On Django 1.7 and above: 25 | 26 | :: 27 | 28 | $ python manage.py migrate 29 | $ python manage.py createsuperuser 30 | 31 | 32 | Now you need to run the Django development server: 33 | 34 | :: 35 | 36 | $ python manage.py runserver 37 | 38 | You should then be able to open your browser on http://127.0.0.1:8000 and 39 | see a page with links to sign in or sign up. 40 | 41 | Example Bootstrap templates 42 | --------------------------- 43 | 44 | There are templates in the ``templates/bootstrap/allauth/account/`` that can 45 | be used with Twitter's `Bootstrap