Giter Site home page Giter Site logo

django-epfl-misc's Introduction

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.

django-epfl-misc's People

Contributors

obieler avatar williambelle avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-epfl-misc's Issues

AttributeError: 'EntryPoints' object has no attribute 'get'

py37-django32 run-test: commands[0] | flake8
  [1914] /home/runner/work/django-epfl-misc/django-epfl-misc$ /home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/bin/flake8
  Traceback (most recent call last):
    File "/home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/bin/flake8", line 8, in <module>
      sys.exit(main())
    File "/home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/lib/python3.7/site-packages/flake8/main/cli.py", line 22, in main
      app.run(argv)
    File "/home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/lib/python3.7/site-packages/flake8/main/application.py", line 363, in run
      self._run(argv)
    File "/home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/lib/python3.7/site-packages/flake8/main/application.py", line 350, in _run
      self.initialize(argv)
    File "/home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/lib/python3.7/site-packages/flake8/main/application.py", line 330, in initialize
      self.find_plugins(config_finder)
    File "/home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/lib/python3.7/site-packages/flake8/main/application.py", line 153, in find_plugins
      self.check_plugins = plugin_manager.Checkers(local_plugins.extension)
    File "/home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/lib/python3.7/site-packages/flake8/plugins/manager.py", line 357, in __init__
      self.namespace, local_plugins=local_plugins
    File "/home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/lib/python3.7/site-packages/flake8/plugins/manager.py", line 238, in __init__
      self._load_entrypoint_plugins()
    File "/home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/lib/python3.7/site-packages/flake8/plugins/manager.py", line 254, in _load_entrypoint_plugins
      eps = importlib_metadata.entry_points().get(self.namespace, ())
  AttributeError: 'EntryPoints' object has no attribute 'get'
  Error: ERROR: InvocationError for command /home/runner/work/django-epfl-misc/django-epfl-misc/.tox/py37-django32/bin/flake8 (exited with code 1)

Update codecov-action from v1 to v2

Description

Due to the deprecation of the underlying bash uploader, the Codecov GitHub Action has released v2 which will use the new uploader. You can learn more about our deprecation plan and the new uploader on our blog.

We will be restricting any updates to the v1 Action to security updates and hotfixes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.