No project description provided
Project description
django-safe-filefield
=====================
.. image:: https://travis-ci.org/mixkorshun/django-safe-filefield.svg?branch=master
:alt: build status
:target: https://travis-ci.org/mixkorshun/django-safe-filefield
.. image:: https://codecov.io/gh/mixkorshun/django-safe-filefield/branch/master/graph/badge.svg
:alt: code coverage
:target: https://codecov.io/gh/mixkorshun/django-safe-filefield
.. image:: https://badge.fury.io/py/django-safe-filefield.svg
:alt: pypi
:target: https://pypi.python.org/pypi/django-safe-filefield
.. image:: https://img.shields.io/badge/code%20style-pep8-orange.svg
:alt: pep8
:target: https://www.python.org/dev/peps/pep-0008/
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
:alt: MIT
:target: https://opensource.org/licenses/MIT
Secure file field, which allows you to restrict uploaded file extensions.
It may be useful for user-uploaded files (attachments).
This package adds model and forms field. What this fields does:
* restricts allowed file extensions (for example: only *.pdf files)
* checks file extensions is correct for sent content-type
* checks sent content type is correct for file content (detects by `libmagic`)
Installation
------------
The package can be installed using:
.. code-block::
pip install django-parler
Add the following settings:
.. code-block:: python
INSTALLED_APPS += (
'safe_filefield',
)
.. note:: **django-safe-filefield** require `libmagic` to be installed.
Usage
-----
Simply add field to your model:
.. code-block:: python
from safe_filefield.models import SafeFileField
class MyModel(models.Model):
attachment = SafeFileField(
allowed_extensions=('.xls', '.xlsx', '.csv')
)
Or to directly to your form:
.. code-block:: python
from safe_filefield.forms import SafeFileField
class MyForm(forms.Model):
attachment = SafeFileField(
allowed_extensions=('.xls', '.xlsx', '.csv')
)
Contributing
------------
If you have any valuable contribution, suggestion or idea,
please let me know as well because I will look into it.
Pull requests are welcome.
=====================
.. image:: https://travis-ci.org/mixkorshun/django-safe-filefield.svg?branch=master
:alt: build status
:target: https://travis-ci.org/mixkorshun/django-safe-filefield
.. image:: https://codecov.io/gh/mixkorshun/django-safe-filefield/branch/master/graph/badge.svg
:alt: code coverage
:target: https://codecov.io/gh/mixkorshun/django-safe-filefield
.. image:: https://badge.fury.io/py/django-safe-filefield.svg
:alt: pypi
:target: https://pypi.python.org/pypi/django-safe-filefield
.. image:: https://img.shields.io/badge/code%20style-pep8-orange.svg
:alt: pep8
:target: https://www.python.org/dev/peps/pep-0008/
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
:alt: MIT
:target: https://opensource.org/licenses/MIT
Secure file field, which allows you to restrict uploaded file extensions.
It may be useful for user-uploaded files (attachments).
This package adds model and forms field. What this fields does:
* restricts allowed file extensions (for example: only *.pdf files)
* checks file extensions is correct for sent content-type
* checks sent content type is correct for file content (detects by `libmagic`)
Installation
------------
The package can be installed using:
.. code-block::
pip install django-parler
Add the following settings:
.. code-block:: python
INSTALLED_APPS += (
'safe_filefield',
)
.. note:: **django-safe-filefield** require `libmagic` to be installed.
Usage
-----
Simply add field to your model:
.. code-block:: python
from safe_filefield.models import SafeFileField
class MyModel(models.Model):
attachment = SafeFileField(
allowed_extensions=('.xls', '.xlsx', '.csv')
)
Or to directly to your form:
.. code-block:: python
from safe_filefield.forms import SafeFileField
class MyForm(forms.Model):
attachment = SafeFileField(
allowed_extensions=('.xls', '.xlsx', '.csv')
)
Contributing
------------
If you have any valuable contribution, suggestion or idea,
please let me know as well because I will look into it.
Pull requests are welcome.
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
Built Distribution
Close
Hashes for django-safe-filefield-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fe4dde686656f5b0d204339848cdad006ebe82ac39e4245a99e1c0a0e285449 |
|
MD5 | 763138661d1b10ec8743db3cfbf17f50 |
|
BLAKE2b-256 | e905cd07fc12bc0260fe79ae466a3dbcf7fd15d0518ac61a41896c1d4fd420e2 |
Close
Hashes for django_safe_filefield-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8064b3e1cc4d2bde16ba2f142349469b1b96a8821c3e4daf816f13adfaf3c25 |
|
MD5 | c14a162666b623270957e8f76e24e2e3 |
|
BLAKE2b-256 | 8eb30904c5adfe264c40acb850477511a69947ca839e1294ee9f3413c7e40ccd |