To enable Django [OpenID][1] authentication, I choose [django-openid-auth][2]. But when I deploy to dotcloud, there’s a ‘404’ as welcome message :p
My guess is the [google openid server][3] requests back long-length headers, which exceeds the default uwsgi buffer size (4096).There is a [related issue][4] 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:
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][1] authentication. 🙂
Bonus: to enable openid-auth for Django, add the following lines to:
urls.py
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'
[1]: http://openid.net/
[2]: http://pypi.python.org/pypi/django-openid-auth
[3]: https://www.google.com/accounts/o8/id
[4]: http://answers.dotcloud.com/question/198/invalid-request-block-size-5572-max-4096skip-error "invalid request block size: 5572 (max 4096)...skip error"