This project has been archived by its maintainers, and is no longer receiving any updates.
django-socialprofile 1.2.1
django-socialprofile enables users to manage their user profile built by logging in via a social service such as Google, Twitter, or Facebook. It relies on python-socialauth.
Django Social Profile gives you an out-of-the-box way to let users create an account in your application using
Google, Twitter, or Facebook authentication.
Users can edit their profile, view other users’ profiles, and add multiple types of auth to the same profile.
Django Social Profile relies on omab’s excellent python-socialauth to do
the actual authentication with the backend providers. If you are just looking for the authentication piece, as opposed
to the UI for customers to use, that module will be all you need. If you are willing to spend a bit of time with the UI,
you can integrate any of the backends that python-socialauth provides (which is extensive).
This module is meant to be as quick to integrate as possible, and thus extensive customization will likely benefit from
a fork. That said, a number of options are available.
The idea is to let you have a working system for letting users create profiles with social auth, edit them, delete them,
and merge them, out of the box.
All the underlying bits to make this work come with python-socialauth, this project just pulls them together with a UI.
The socialprofile_demo app is included to quickly let you see how to get a working installation going.
The demo is built as a mobile app using jQueryMobile loaded from the jQuery CDN.
Take a look at the requirements.txt file in the socialprofile_demo directory for a quick way to use pip to install
all the needed dependencies:
$ pip install -r requirements.txt
The settings.py, and settings_local_template.py files have a working configuration you can crib from.
You’ll need to copy settings_local_template.py as settings_local.py and fill in your API keys.
The templates in the socialprofile/templates and socialprofile_demo/templates directories
give you a good idea of the kinds of things you will need to do if you want to provide a custom interface.
Configuration is minimal for socialprofile itself, more config is needed for python-socialauth. A quick guide to a basic setup
is below, take a look at the demo app for more details.
All of the configuration for python-socialauth applies to this module, although the supplied templates only cover
Google, Facebook, and Twitter. python-socialauth can handle a huge number of backends, you can customize as needed.
Facebook also allows you to request additional information beyond authentication. The default setup
assumes you are requesting the user’s email address. See below for how to note that in the API settings.
This project creates a SocialProfile object for each User that is registered via one of the social methods.
The data on this profile can be viewed and edited in the Django admin by editing the User object.
The SocialProfile data appears at the bottom of the User detail in the Django admin.
To do this, a custom User admin definition is created in admin.py, so if you have other things that override
the User admin, you’ll want to merge this customization in with that, or provide your own admin definition for SocialProfile.
The ‘socialprofile/select’ view provides a login modal that you can use to both force existing users to sign in
as well as to enable new users to select how they want to authenticate to the site.
If you have LOGIN_URL set to /socialprofile/select/, this will work automatically.
The default template has attributes to make this a nice modal using jQueryMobile, but the HTML is straightforward,
and a custom template should be simple to create.
The socialprofile/ view lets a user see their own profile. The default template checks to see if they profile is
indeed theirs, and displays an ‘edit’ button taking them to the socialprofile/edit/ view.
This view supports a ?returnTo= parameter to specify a URL path to return to once the user is done. The default template
uses this for the < Return button.
The socialprofile/view/<username> view lets a user see any profile. You may want to adjust the template to hide any
profile fields that should not be public.
This view supports a ?returnTo= parameter to specify a URL path to return to once the user is done. The default template
uses this for the < Return button.
The socialprofile/edit/ view lets a user edit their own profile. In typical Django fashion, a GET request to this view
will display the form, while a POST request to this view will try and save the changes.
This view supports a ?returnTo= parameter to specify a URL path to return to once the user is done. The default template
uses this for the Cancel and Done button. When the form returns to the Self Profile View, it passes returnTo.
A user can add an additional social authentication type to their existing profile. If they originally created their
profile using Google auth, then they could add Facebook and Twitter, enabling them to sign in with any of those services
and access the same account.
To do this, just have the customer log in with their new auth type, and python-socialauth will do the rest.
It is important to let customers remove their accounts, and the /socialprofile/delete view prompts them to ensure they
really want to delete their account before sending them to /socialprofile/delete/action?confirm=true.
You may want to provide your own function to do this, that perhaps only deactivates their account.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.