Skip to main content

Simple helpers for writing Mxit apps with Django

Project description

Middleware for writing Mxit apps with Django.

django-mxit

MIDDLEWARE_CLASSES = (
    ...
    'mxit.middleware.RemoteUserMiddleware',
    ...
)


AUTHENTICATION_BACKENDS = (
    ...
    'django.contrib.auth.backends.RemoteUserBackend',
    ...
)

Hit it with the correct headers and you’ll be authenticated immediately:

$ curl -XGET 'http://localhost:8000/' \
    -H 'X-Device-User-Agent: user-agent' \
    -H 'X-Mxit-CONTACT: contact' \
    -H 'X-Mxit-USERID-R: userid-r' \
    -H 'X-Mxit-NICK: nick' \
    -H 'X-Mxit-LOCATION: za,south africa,,,ct,cape town,,,,' \
    -H 'X-Mxit-PROFILE: en,za,01-01-2013,,,' \
    -H 'X-Mxit-USER-INPUT: <b>foo</b>' \

{
  "username": "userid-r",
  "mxit": {
    "MXIT_NICK": "nick",
    "MXIT_PROFILE": {
      "gender": "",
      "date_of_birth": "01-01-2013",
      "tariff_plan": "",
      "country_code": "za",
      "language_code": "en"
    },
    "DEVICE_USER_AGENT": "user-agent",
    "MXIT_CONTACT": "contact",
    "MXIT_LOCATION": {
      "city": "cape town",
      "cell_id": "",
      "network_operator_id": "",
      "subdivision_code": "",
      "client_features_bitset": "",
      "country_code": "za",
      "subdivision_name": "",
      "country_name": "south africa",
      "city_code": "ct"
    },
    "MXIT_USER_INPUT": "<b>foo</b>",
    "MXIT_USERID_R": "userid-r"
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-mxit-0.0.1.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file django-mxit-0.0.1.tar.gz.

File metadata

  • Download URL: django-mxit-0.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-mxit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c043c310df916ecff55fb7e4e09f3f7481a38d7ab25d6ff193899291ddc99323
MD5 cfefbbc394857072bf9480a836dd8094
BLAKE2b-256 a43c89119b304f279f82ec764c2404491fbfdd2e016be1361cbc8ab3a7277b3a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page