To enable Django OpenID authentication, I choose django-openid-auth. But when I deploy to dotcloud, there’s a ‘404’ as welcome message :p
My guess is the google openid server requests back long-length headers, which exceeds the default uwsgi buffer size (4096).There is a related issue about it. Although I didn’t find any “block size” in logs, but it seems worth a try. So I follow the documentation, modify my dotcloud.yml as:
1 2 3 4 |
www: type: python config: uwsgi_buffer_size: 8192 |
and destroy the running server and deploy a new one (just as the document told me). Now the django service runs with OpenID authentication. 🙂
Bonus: to enable openid-auth for Django, add the following lines to:
urls.py
1 2 3 4 |
urlpatterns = patterns('', # ... url(r'^openid/', include('django_openid_auth.urls')), ) |
settings.py:
INSTALLED_APPS = (
# ...
'django_openid_auth',
#
)
AUTHENTICATION_BACKENDS = (
'django_openid_auth.auth.OpenIDBackend',
'django.contrib.auth.backends.ModelBackend',
)
# OpenID
OPENID_CREATE_USERS = True
OPENID_UPDATE_DETAILS_FROM_SREG = True
LOGIN_URL = '/openid/login/'
LOGIN_REDIRECT_URL = '/'
OPENID_SSO_SERVER_URL = 'https://www.google.com/accounts/o8/id'