[](https://badge.fury.io/py/django-ajax-auth)
Some simple AJAX authorisation endpoints for Django.
## Why?
I wanted a package to integrate AJAX authorisation with Django's
standard authorisation views. When a request is made via AJAX it
should be handled as such, and when a standard request is made the
login form should be rendered.
## Installation
`pip` is the easiest way to get the package:
```python
pip install django-ajax-auth
```
Add the package to your Django settings file:
```python
INSTALLED_APPS = [
'xauth',
...
]
```
Replace the standard authorisation URLs in your URL configuration:
```python
urlpatterns = [
url(r'^', include('xauth.login_ajax_urls'))
]
```
## Usage
Now you can either perform the usual non-AJAX GET and POST to login
as you would normally, or POST using `application/json` encoding to
login over AJAX.
```javascript
import $ from 'jquery'
$.ajax({
url: '/login',
method: 'POST',
contentType: 'application/json',
data: {
username: 'harry',
password: 'henderson123'
}
})
```
Sometimes you may wish to only allow AJAX logins, in which case set
`XAUTH_AJAX` to `True` in your settings file.
Metadata
Release files for django-ajax-auth 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-ajax-auth-0.1.1.tar.gz | 6.7 kB | Without provenance | Details for django-ajax-auth-0.1.1.tar.gz |
Release files / django-ajax-auth-0.1.1.tar.gz
| Download URL | django-ajax-auth-0.1.1.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67abb887c0eb29df95f72b871ec5dcb2d76601467cd9e436a00a072b309a7e6e
|
|
BLAKE2b-256 checksum How to use checksums |
bc05629b97ad92dc712a22c33c97bd8227cb2ac27b4a2a5be51b549c537e6abf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-ajax-auth 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.