From 8e42d2102feb278df8b302fe5af6736a035d4e17 Mon Sep 17 00:00:00 2001 From: Camilo Nova Date: Mon, 6 Nov 2017 11:40:53 -0500 Subject: [PATCH] Improve docs --- docs/index.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 8d04c60..0604508 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -142,6 +142,30 @@ Note: Use later evaluated strings instead of direct classes for the field and wi 'MY_SELECT_KEY': ('yes', 'select yes or no', 'yes_no_null_select'), } +If you want to work with files you can use this configuration: + +.. code-block:: python + + CONSTANCE_ADDITIONAL_FIELDS = { + 'image_field': ['django.forms.ImageField', {}] + } + + CONSTANCE_CONFIG = { + 'LOGO_IMAGE': ('default.png', 'Company logo', 'image_field'), + } + +When used in a template you probably need to use: + +.. code-block:: html + + {% load static %} + + {% get_media_prefix as MEDIA_URL %} + + +Images are uploaded to MEDIA_ROOT. + + Ordered Fields in Django Admin ------------------------------