0

I'm implementing an api in Django, and am looking to use basic authentication to identify users when they make api requests.

The documentation I've found so far seems incomplete, or doesn't seem to answer the correct question (the answers here, for example, seem to depend on having Apache handle the authentication).

Is there a standard, or default, implementation for http basic auth in Django?

Community
  • 1
  • 1
blueberryfields
  • 45,910
  • 28
  • 89
  • 168

2 Answers2

1

You should consider to look into https://bitbucket.org/jespern/django-piston/wiki/Home . There is everything you need to build an API, either REST with JSON or XML. Basic Authentication and even oauth2 is included.

optixx
  • 2,110
  • 3
  • 16
  • 16
1

Looks like basic auth is baked into the auth library that ships with Django, and works out of the box. django-piston, mentioned by optixx, appears to be a useful tool for adding an api to an existing django project (or creating an api-only project, even)

Community
  • 1
  • 1
blueberryfields
  • 45,910
  • 28
  • 89
  • 168