Skip to main content

Library provides customization of AnonymousUser in Django

Project description


.. figure::

Library provides customization of AnonymousUser.

Works with Python >= 2.6, >= 3.2, Django >= 1.5, >= 2.0.


.. code:: bash

pip install django-custom-anonymous


Add to settings:

.. code:: python

AUTH_ANONYMOUS_MODEL = 'your_app.module.CustomAnonymousUser'

Add to middlewares:

.. code:: python


Create your own anonymous (for example):

.. code:: python

from django.contrib.auth.models import AnonymousUser as DjangoAnonymousUser
class CustomAnonymousUser(DjangoAnonymousUser):
    ip = None

    def __init__(self, request):
        self.ip = request.META.get('REMOTE_ADDR')
        super(AnonymousUser, self).__init__()

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-custom-anonymous-0.5.0.tar.gz (2.4 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page