Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from fitodic/feature/modify_img_dir
Customize daguerre's directory path
- Loading branch information
Showing
7 changed files
with
202 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import daguerre.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('daguerre', '0003_auto_20160301_2342'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='adjustedimage', | ||
name='adjusted', | ||
field=models.ImageField(max_length=45, upload_to=daguerre.models.upload_to), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Custom settings | ||
=============== | ||
|
||
Adjust the image path | ||
+++++++++++++++++++++ | ||
|
||
The variations are stored under a hashed directory path that starts with the | ||
``dg`` directory by default (e.g. ``dg/ce/2b/7014c0bdbedea0e4f4bf.jpeg``). | ||
This setting can be modified in the project's settings by setting the | ||
``DAGUERRE_ADJUSTED_IMAGE_PATH`` variable. | ||
|
||
Example: | ||
|
||
.. code-block:: django | ||
# settings.py | ||
DAGUERRE_ADJUSTED_IMAGE_PATH = 'img' | ||
which would produce the following path: ``img/ce/2b/7014c0bdbedea0e4f4bf.jpeg`` | ||
|
||
|
||
.. WARNING:: | ||
The maximum length of the ``DAGUERRE_ADJUSTED_IMAGE_PATH`` string | ||
is 13 characters. If the string has more than 13 characters, it will | ||
gracefully fall back to the the default value, i.e. ``dg`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters