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.2.0.tar.gz (6.1 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.2.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file django_epfl_misc-2.2.0.tar.gz.

File metadata

  • Download URL: django_epfl_misc-2.2.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.2 CPython/3.14.0 Linux/6.11.0-1018-azure

File hashes

Hashes for django_epfl_misc-2.2.0.tar.gz
Algorithm Hash digest
SHA256 7f6983d4d780211215cd7f6ef2532da8bda14fdb705d106349126f8a2155d025
MD5 8222d90b11aa7d534e4c1eae81b7aad4
BLAKE2b-256 c9f7309a893a938ea9795a089aadc661c5bc1784d20c76b19d33c8c87a50b980

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_epfl_misc-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.26.2 CPython/3.14.0 Linux/6.11.0-1018-azure

File hashes

Hashes for django_epfl_misc-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05d3762e2aeb2e306c12b4746d2f1fbb9176fb3d646fefa53cc19d0aeaf6c349
MD5 0cd6fb5df2481e15767455059ba0fa25
BLAKE2b-256 c271091c292329252c42de90de98b9fbf3541276a8d397d8fe247d7eaf8d80e8

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