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.7 or later
  • Django 2.2, 3.2, 4.2 or 5.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-2025 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-2.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for django-epfl-misc-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e1a28ccf4b397b2fc7e7a92259e22d4b8f1c9dc0c0d5da7e2a10331f4a59f971
MD5 c8ca01a3e3588615336a9dc2e6c193ed
BLAKE2b-256 d123518e63c8f2d087209181bb0d7def71d44c6296e555832610c894e2e4ebc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_epfl_misc-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7073a98567a4fb5fbe5b8c5280d134283ac75af793190273d4947e3c62424d5e
MD5 296ec598a968eba4f36153ce8278d904
BLAKE2b-256 3d4eeef1cb17e4311e79b830cd5b5b138463b0248322130b0e3fb22b535223f1

See more details on using hashes here.

Supported by

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