Django app with common parts from web services
django-gravatar2>=1.4.0
django-widget-tweaks>=1.4.1
If NGID OAuth client will be used:
requests>=2.11.1,<=2.12
requests_oauthlib=0.7.0
TODO
git clone https://github.com/nextgis/webservices_commons nextgis_common
or
git submodule add https://github.com/nextgis/webservices_commons nextgis_common
Add to INSTALLED_APPS:
'widget_tweaks',
'django_gravatar',
'nextgis_common',
Client type: confidential
Authorization Grant Type: authorization-code
Redirect Uris: http://your_site_url/login/callback/
Skip authorization: True
Add to AUTHENTICATION_BACKENDS:
AUTHENTICATION_BACKENDS = (
...
...
'nextgis_common.ngid_auth.auth_backend.NgidBackend',
)
Set vars:
NGID_CLIENT_ID = 'you app id from my.nextgis.com'
NGID_CLIENT_SECRET = 'you app id from my.nextgis.com'
urlpatterns = [
...
...
url(r'', include('nextgis_common.ngid_auth.urls')),
]
manage.py migrate
For example:
<a href="{% url 'ngid_login' %}">{% trans 'Sign in'%}</a>
<a href="{% url 'ngid_logout' %}">{% trans 'Log out'%}</a>
TODO