Using PyPPP with a Django ProjectΒΆ
Once you’ve installed PyPPP and want to use it in your Django applications, do the following;
Add
'pyppp.django'
to the'INSTALLED_APPS'
setting of your Django project.Add
'pyppp.django.backends.PPPBackend'
toAUTHENTICATION_BACKENDS
in your project’ssettings.py
:AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'pyppp.django.backends.PPPBackend', )Change
'LOGIN_URL'
to'/ppp/login/'
to yoursettings.py
.Change
'LOGOUT_URL'
to'/ppp/logout/'
to yoursettings.py
.Run
manage.py syncdb
so that Django will create the post tables.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/
.