summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/django-csp/default.nix
blob: 6849e3cfb9bc473e8aa57ff0679df63ef86ee61e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  lib,
  fetchPypi,
  buildPythonPackage,

  # build-system
  setuptools,

  # dependencies
  django,

  # tests
  jinja2,
  pytest-django,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "django-csp";
  version = "4.0";
  pyproject = true;

  src = fetchPypi {
    inherit version;
    pname = "django_csp";
    hash = "sha256-snAQu3Ausgo9rTKReN8rYaK4LTOLcPvcE8OjvShxKDM=";
  };

  postPatch = ''
    sed -i "/addopts =/d" pyproject.toml
  '';

  build-system = [ setuptools ];

  dependencies = [ django ];

  nativeCheckInputs = [
    jinja2
    pytest-django
    pytestCheckHook
  ];

  meta = {
    description = "Adds Content-Security-Policy headers to Django";
    homepage = "https://github.com/mozilla/django-csp";
    license = lib.licenses.bsd3;
  };
}