Using PyPPP with a Django ProjectΒΆ

Once you’ve installed PyPPP and want to use it in your Django applications, do the following;

  1. Add 'pyppp.django' to the 'INSTALLED_APPS' setting of your Django project.

  2. Add 'pyppp.django.backends.PPPBackend' to AUTHENTICATION_BACKENDS in your project’s settings.py:

    AUTHENTICATION_BACKENDS = (
            'django.contrib.auth.backends.ModelBackend',
            'pyppp.django.backends.PPPBackend',
    )
    
  3. Change 'LOGIN_URL' to '/ppp/login/' to your settings.py.

  4. Change 'LOGOUT_URL' to '/ppp/logout/' to your settings.py.

  5. Run manage.py syncdb so that Django will create the post tables.

  6. Add the URLs to your project’s urls.py:

    urlpatterns = patterns('',
            ...
            url(r'^ppp/', include('pyppp.django.urls')),
            ...
    )
    

Once you have installed and added PyPPP to your Django project, you can use the url /ppp/card/ to grab the current card. Login using PPP at: /ppp/login/, and logout at /ppp/logout/.