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.1.tar.gz (5.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.0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_epfl_misc-2.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.4 CPython/3.12.11 Linux/6.11.0-1018-azure

File hashes

Hashes for django_epfl_misc-2.0.1.tar.gz
Algorithm Hash digest
SHA256 fbc6649664076838b47ac6914a3997c5ec026c2df9ef8cabbb49b3461da68c20
MD5 77f1516f8ffb967141218c4fae92f622
BLAKE2b-256 9a251965073f93d746076526f9d8dd02c0f339a7c8667ceb8d18b1fe847be342

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for django_epfl_misc-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f73391c9fe326408feb4362c4260bf087458634f89739eb296a427238e1971b5
MD5 159b2499cb29d96806b89049fafe3d95
BLAKE2b-256 7c6019c8d2702c280288f230065ecd5b040865441144c162945192ea072059e8

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