Coder Social home page Coder Social logo

django-clortho's Introduction

Deprecated. Please use Django Social Auth

pip install django-social-auth

INSTALL:

  1. python setup.py install or add the repository to your pip requirements file.

  2. Install facebook/python-sdk.

  3. Add 'clortho' to INSTALLED_APPS in settings.py

  4. Add 'clortho.auth_backends.FacebookBackend' to AUTHENTICATION_BACKENDS in settings.py.

  5. Add the following entry to your project-level urls.py

    url(r'^clortho/', include('clortho.urls')),

  6. Add the following settings to settings.py

    # Facebook app secret key.
    FACEBOOK_SECRET_KEY = 'value_here'
    # Facebook app id.
    FACEBOOK_APP_ID = 'value_here'
    # Will serve as username prefix.
    FACEBOOK_USER_NAMESPACE = 'fb-'
    # Name of url to redirect to after authentication. 
    CLORTHO_AUTH_REDIRECT = 'home' 
    
  7. Optionally, add 'clortho.context_processors.facebook_api_values' to your TEMPLATE_CONTEXT_PROCESSORS if you'd like a global FACEBOOK_APP_ID context variable for your Facebook JS.

  8. Follow the included file example_template.txt. Be sure to set the javascript variable FB_APP_ID (or use the FACEBOOK_APP_ID global context variable), as it should match the value of FACEBOOK_APP_ID you filled out earlier in settings.py. Future versions of django-clortho will contain a more simple and clean way of integrating the necessary javascript and markup. Please consult the Facebook Developer documentation for help.

  9. Once you have integrated your login and logout methods based on the above example, please run the following command in your projects base directory. After restarting your server, django-clortho will be available to use.

    python manage.py syncdb
    

TODO:

  • Add other social backends (Twitter, Google Oauth2, Yahoo OpenID, etc.)
  • Add convenience methods to model for easy API lookups.
  • Add methods to allow existing users to connect with various services.

Motivation

This project came to be while I started rewriting my 14 year old Ghostbusters fan site in Python. I wanted a simple pluggable app to tie into the latest Facebook and Twitter APIs and authentication schemes. Named after Vinz Clortho, Keymaster of Gozer, django-clortho will eventually provide OAuth 2.0-based authentication backends to Facebook Graph API and Twitter Oauth, among others.

django-clortho's People

Contributors

chadpaulson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

django-clortho's Issues

Login issue

Not sure what the problem is, but if I'm already logged into Facebook and I try to login to a site using this app, the auth popup opens and closes rapidly and nothing happens. It's only open for a split second, so I can't see what's going on, but the end result is that I don't get logged in.

If I log out of Facebook and try to login to my site using clortho, it works just fine. So the problem only manifests itself when I log out of Facebook and try to login to my site.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.