Skip to main content

A Django application with helper functions and utilities.

Project description

django-epfl-misc

Build Status Coverage Status PyPI version PyPI Python version

A Django application with helper functions and utilities.

Requirements

  • Python 3.6 or later
  • Django 2.2, 3.2 or 4.2

Installation

Installing from PyPI is as easy as doing:

pip install django-epfl-misc

Documentation

Auth

superuser_required_or_403()

from django_epflmisc.decorators import superuser_required_or_403

@superuser_required_or_403()
def my_view(request):
    # I can assume now that the view is only accessible as a superuser.

Cache

The cache system requires a small amount of setup. Namely, you have to tell it where your cached data should live – whether in a database, on the filesystem or directly in memory.

See Django's cache framework

cache_anonymous_user(timeout, cache="default")

from django_epflmisc.decorators import cache_anonymous_user

@cache_anonymous_user(60 * 15)
def my_view(request):
    # I can assume now that the view is cached for anonymous users.

License

The MIT License (MIT)

Copyright (c) 2021-2023 ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland.

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-epfl-misc-1.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

django_epfl_misc-1.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file django-epfl-misc-1.1.0.tar.gz.

File metadata

  • Download URL: django-epfl-misc-1.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for django-epfl-misc-1.1.0.tar.gz
Algorithm Hash digest
SHA256 2db29537f7473015b989920fea2b553a2c6e21d86ad95c6edfc7dd73d2ff327c
MD5 fdd8fabf876671a3999b0ff2142ca5a0
BLAKE2b-256 46093bc34502d3b75de46e39185c1e355ccfca7e235c2a79852d7a210fef3966

See more details on using hashes here.

File details

Details for the file django_epfl_misc-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_epfl_misc-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc8d7793482d0f9e10d809a26d3f59c9f23a054c70ee24f138fbf65aadd6c7e3
MD5 cc7eeb30b764e2e094aa33e9d9582256
BLAKE2b-256 0fab4911a4b00301c5f54a9b968cbc97438ac196e5c26a0c8d8dfac3fa8562f7

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