Installation

Requirements

Note for Python 3.4

Shall work with Python 3.4, but not tested in CI as black requires Python>=3.5.

Using PyPI

  1. Run
    • pip install django-constrainedfilefield, or
    • pip install django-constrainedfilefield[filetype] to ensure python-magic is installed.
  2. For windows, you must download the dll files and .magic file from pidydx/libmagicwin64 (32-bit version on gnuwin32.sourceforge.net), add them to C:\\Windows\\System32 (or to a folder in your PATH), and set MAGIC_FILE_PATH=”…” to the path of your .magic file in your settings.py. For more information about the files to download, go to the python-magic help page

Using the source code

  1. Make sure [Pandoc][] is installed
  2. Run ./pypi_packager.sh
  3. Run pip install dist/django_constrainedfilefield-x.y.z-[…].wheel, where x.y.z must be replaced by the actual version number and […] depends on your packaging configuration
  4. For windows, you must download the dll files and .magic file from pidydx/libmagicwin64 (32-bit version on gnuwin32.sourceforge.net), add them to C:\\Windows\\System32 (or to a folder in your PATH), and set MAGIC_FILE_PATH=”…” to the path of your .magic file in your settings.py. For more information about the files to download, go to the python-magic help page