django-piston


How to debug django-piston application?


My piston application works correctly when I run it locally with python manage.py runserver command but returns
urllib2.HTTPError: HTTP Error 403:
FORBIDDEN
under apache. How can I debug django-piston application?
I usually debug Piston apps by:
Setting my handlers to use Basic Authentication, even if I'm normally using something else.
Use curl to make requests
Use pdb (or ipdb) to set a breakpoint in my handler if desired.
You can conditionally change to BasicAuthentication like this:
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)
To pass a username and password using curl, use the -u option:
curl -u username:password http://localhost:8000/api/some/endpoint/
So in your local settings module, just set API_DEBUG=True whenever you want to use basic auth.

Related Links

How to debug django-piston application?

Categories

HOME
asp.net-web-api
wakanda
github-for-windows
hessian
pclxl
can
nsbundle
3d-reconstruction
tail
visual-studio-emulator
code-coverage
teechart
android-securityexception
jxl
xcodebuild
jsonpath
pybossa
azure-powershell
modbus-tcp
esoteric-languages
html5-appcache
smartclient
identity-management
swagger-2.0
gulp-watch
gmock
asymptotic-complexity
datastax-enterprise-graph
quantlib
xbox
joomla2.5
dynamic-jasper
getpixel
batching
openalpr
google-earth-engine
sessionstorage
metaprogramming
p4merge
doc
levenshtein-distance
rfc3339
dapper-simplecrud
ovf
clarifai
reindex
amq
context-switch
ngmaterial
excel-dna
mach-o
flac
offline.js
structuremap4
chromium-os
custom-lists
webjars
data-protection
design-principles
highland.js
terracotta
google-books
zen-cart
opserver
visual-sourcesafe-2005
eoferror
umlgraph
mass-assignment
punycode
angular-carousel
rcaller
winginx
jquery-slider
clickbank
process-explorer
jquery-1.9
pclzip
robotlegs
intersect
cakephp-1.2
saleslogix
pyunit
u2netdk
event-receiver
django-paypal
application-verifier
opml
feasibility
tui
cldc
sifr3

Resources

Encrypt Message