1
我的活塞應用程序工作正常,當我使用python manage.py runserver命令命令在本地運行,但在Apache返回如何調試django-piston應用程序?
urllib2.HTTPError: HTTP Error 403: FORBIDDEN
。我如何調試django-piston應用程序?
我的活塞應用程序工作正常,當我使用python manage.py runserver命令命令在本地運行,但在Apache返回如何調試django-piston應用程序?
urllib2.HTTPError: HTTP Error 403: FORBIDDEN
。我如何調試django-piston應用程序?
我通常調試活塞應用:
可以有條件地改變BasicAuthentication這樣的:
auth = {'authentication': WhateverYouAreUsingForAuthentication(realm="YourSite")}
if getattr(settings, "API_DEBUG", None):
from piston.authentication import HttpBasicAuthentication
auth = {'authentication': HttpBasicAuthentication(realm="Spling")}
some_handler = Resource(SomeHandler, **auth)
要通過使用捲曲的用戶名和密碼,使用-u
選項:
curl -u username:password http://localhost:8000/api/some/endpoint/
因此,在您的本地設置模塊,只要您想使用基本身份驗證,只需設置API_DEBUG=True
即可。
更新活塞到最新版本解決了這個問題,但它仍然不清楚如何調試活塞應用程序。 – Tom 2011-04-14 09:41:01