Skip to content

Instantly share code, notes, and snippets.

@bielfrontera
bielfrontera / backends.py
Created February 4, 2022 17:57
Custom django authentication backend and middleware to extend the REMOTE_USER authentication of django.contrib.auth (see https://docs.djangoproject.com/en/3.2/howto/auth-remote-user/ )
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.auth.backends import RemoteUserBackend
class RemoteExtendedUserBackend(RemoteUserBackend):
"""
This backend can be used in conjunction with the ``RemoteUserMiddleware``
to handle authentication outside Django and update local user with external information
(name, email and groups).
@bielfrontera
bielfrontera / backbone-forms-editor-bbox.js
Last active August 29, 2015 14:17
boundingbox field for backbone-forms
;
(function(Form) {
/**
* BoundingBox editor
*
*/
Form.editors.BoundingBox = Form.editors.Base.extend({
events: {},