All Projects → PaesslerAG → Django Currentuser

PaesslerAG / Django Currentuser

Licence: bsd-3-clause
Conveniently store reference to request user on thread/db level.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Currentuser

Modern Django
Modern Django: A Guide on How to Deploy Django-based Web Applications in 2017
Stars: ✭ 662 (+697.59%)
Mutual labels:  django, pip
Django Rest Booking Api
A Restful api which allows you to book sports events or update existing odds.
Stars: ✭ 24 (-71.08%)
Mutual labels:  django, pip
Django Webpacker
A django compressor tool that bundles css, js files to a single css, js file with webpack and updates your html files with respective css, js file path.
Stars: ✭ 69 (-16.87%)
Mutual labels:  django, pip
Liquid dl
Liquid-dl is a simple tool for utlities such as FFMPEG, youtube-dl, and scdl. It provides a simple framework with simple point and click options allowing users to just click on what they need and use the bare minimum commands to get the results needed.
Stars: ✭ 78 (-6.02%)
Mutual labels:  django
Django Storage Swift
OpenStack Swift storage backend for Django
Stars: ✭ 78 (-6.02%)
Mutual labels:  django
Zazo
Pure Python Dependency Resolution
Stars: ✭ 80 (-3.61%)
Mutual labels:  pip
Pymarketstore
Python driver for MarketStore
Stars: ✭ 74 (-10.84%)
Mutual labels:  pip
Codingwithmitchblog Rest Api
A continuation of the CodingWithMitchBlog course. Adding a REST API using Django REST-framework
Stars: ✭ 78 (-6.02%)
Mutual labels:  django
Drf Autodocs
Ultimately automated DRF documentation rendering(UNMAINTAINED)
Stars: ✭ 82 (-1.2%)
Mutual labels:  django
Django Rest Framework Msgpack
MessagePack support for Django REST framework
Stars: ✭ 78 (-6.02%)
Mutual labels:  django
Djongo
Django and MongoDB database connector
Stars: ✭ 1,222 (+1372.29%)
Mutual labels:  django
Nuxx
Visual Docker composer for faster development. Discover, leverage, and launch community recipes.
Stars: ✭ 79 (-4.82%)
Mutual labels:  django
Django Notifications
GitHub notifications alike app for Django
Stars: ✭ 1,237 (+1390.36%)
Mutual labels:  django
Postmarker
Python client library for Postmark API
Stars: ✭ 79 (-4.82%)
Mutual labels:  django
Pets
Pets is a Django-based website that allows people to share photos and information about missing pets and pets available for adoption
Stars: ✭ 82 (-1.2%)
Mutual labels:  django
The Complete Guide To Drf And Vuejs
📢 Source Code from my Web Dev Course *The Complete Guide To Django REST Framework and Vue JS* (Lang: English & Italian)
Stars: ✭ 78 (-6.02%)
Mutual labels:  django
Archer
基于inception的自动化SQL操作平台,支持SQL执行、LDAP认证、发邮件、OSC、SQL查询、SQL优化建议、权限管理等功能,支持docker镜像
Stars: ✭ 1,239 (+1392.77%)
Mutual labels:  django
Django Poll App
Django poll app is a full featured polling app. You have to register in this app to show the polls and to vote. If you already voted you can not vote again. Only the owner of a poll can add poll , edit poll, update poll, delete poll , add choice, update choice, delete choice and end a poll. If a poll is ended it can not be voted. Ended poll only shows user the final result of the poll. There is a search option for polls. Also user can filter polls by name, publish date, and by number of voted. Pagination will work even after applying filter.
Stars: ✭ 78 (-6.02%)
Mutual labels:  django
Education Backend
Django backend for my info-business website
Stars: ✭ 79 (-4.82%)
Mutual labels:  django
Django Crash Starter
The Cookiecutter template for the Django Crash Course tutorial by Daniel and Audrey Feldroy.
Stars: ✭ 80 (-3.61%)
Mutual labels:  django

============================= django-currentuser

.. image:: https://travis-ci.org/PaesslerAG/django-currentuser.svg?branch=master :target: https://travis-ci.org/PaesslerAG/django-currentuser


.. contents:: Conveniently store reference to request user on thread/db level.


Quickstart

Install django-currentuser::

pip install django-currentuser

Add it to the middleware classes in your settings.py::

MIDDLEWARE = (
    ...,
    'django_currentuser.middleware.ThreadLocalUserMiddleware',
)

Then use it in a project::

from django_currentuser.middleware import (
    get_current_user, get_current_authenticated_user)

# As model field:
from django_currentuser.db.models import CurrentUserField
class Foo(models.Model):
    created_by = CurrentUserField()

Differences to django-cuser

Both libraries serve the same purpose, but be aware of these differences (as of django-cuser v.2017.3.16):

  • django-currentuser's CurrentUserField stores the reference to the request user at initialization of the model instance and still allows you to overwrite the value before saving. django-cuser sets the value in the pre_save handler of the field just before writing it to the database. Intermediate changes will be ignored.

  • django-cuser deletes the user reference from the thread after finishing a response and it will therefore no longer be available for testing purposes.

Release Notes

  • 0.5.1 - add support for Django 3.1 and Python 3.8

  • 0.5.0

    • add support for update on save (thank you @felubra)
    • no longer build on Python 3.5, deprecated
  • 0.4.3 - add support for Django 3.0

  • 0.4.2 - Minor fix for supported Django and Python versions

  • 0.4.0 - update supported versions

    • drop support for Python 3.4
    • drop support for Django 2.0
    • add support for Python 3.7
    • add support for Django 2.2
    • update tox3travis.py to not loose deployment feature
  • 0.3.4 - Use public Travis for packaging to remove dependency on outdated build system

  • 0.3.3 - drop Python 3.7 support due to build process problems

  • 0.3.1 - attempt to add Python 3.7 support

  • 0.3.0 - update supported versions according to https://www.djangoproject.com/download/#supported-versions and https://devguide.python.org/#status-of-python-branches

    • drop support for Python 3.2
  • 0.2.3 - support custom user model, drop Django 1.10 support

  • 0.2.2 - support Django 2.0

  • 0.2.1 - version fixes #9

    • support Django 1.11.x and not just 1.11.0
  • 0.2.0 - New middleclass format

    • Adapt to new object based middle class format of Django 1.10+
    • Drop support for deprecated Django versions 1.8 and 1.9
  • 0.1.1 - minor release

    • suppress warning for passed kwargs as long as they match the defaults (avoids them being printed during running tests when fields are cloned)
  • 0.1.0 - initial release

    • provides middleware + methods to set + retrieve reference of currently logged in user from thread
    • provides CurrentUserField that by default stores the currently logged in user
    • supports Django 1.10, 1.11 on python 2.7, 3.4, 3.5, and 3.6 - as per the official django docs <https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django>_

.. contributing start

Contributing

As an open source project, we welcome contributions.

The code lives on github <https://github.com/PaesslerAG/django-currentuser>_.

Reporting issues/improvements


Please open an `issue on github <https://github.com/PaesslerAG/django-currentuser/issues/>`_
or provide a `pull request <https://github.com/PaesslerAG/django-currentuser/pulls/>`_
whether for code or for the documentation.

For non-trivial changes, we kindly ask you to open an issue, as it might be rejected.
However, if the diff of a pull request better illustrates the point, feel free to make
it a pull request anyway.

Pull Requests
~~~~~~~~~~~~~

* for code changes

  * it must have tests covering the change. You might be asked to cover missing scenarios
  * the latest ``flake8`` will be run and shouldn't produce any warning
  * if the change is significant enough, documentation has to be provided

To trigger the packaging, run `make release` on the master branch with a changed
version number.

Setting up all Python versions

::

sudo apt-get -y install software-properties-common
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
for version in 3.6 3.7; do
  py=python$version
  sudo apt-get -y install ${py} ${py}-dev
done

Code of Conduct


As it is a Django extension, it follows
`Django's own Code of Conduct <https://www.djangoproject.com/conduct/>`_.
As there is no mailing list yet, please just email one of the main authors
(see ``setup.py`` file or `github contributors`_)


.. contributing end


.. _github contributors: https://github.com/PaesslerAG/django-currentuser/graphs/contributors
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].