Skip to content

Commit

Permalink
prepare 0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Dec 16, 2016
1 parent b61770e commit a97e0e6
Show file tree
Hide file tree
Showing 24 changed files with 218 additions and 60 deletions.
1 change: 0 additions & 1 deletion .coveragerc
@@ -1,6 +1,5 @@
[run]
omit =
src/dummy_thumbnails/tests/*
src/dummy_thumbnails/contrib/thumbnailers/django_imagekit/*
example/simple/settings/*
example/simple/wsgi.py
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -35,6 +35,3 @@ QUICK_START.rst
#/examples/simple/settings/__init__.py
/examples/simple/settings/local_settings.py
/src/dummy_thumbnails/static/dummy_thumbnails/images/various/
docs/dummy_thumbnails.contrib.thumbnailers.django_imagekit*
/src/dummy_thumbnails/contrib/thumbnailers/django_imagekit/*
/examples/simple/templates/home/django_imagekit.html
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -15,8 +15,16 @@ are used for versioning (schema follows below):
0.3.4 to 0.4).
- All backwards incompatible changes are mentioned in this document.

0.1.3
-----
2016-12-16

- Minor fixes/improvements.
- Added ``django-imagekit`` support.

0.1.2
-----
2016-12-15

- Minor fixes in docs and tests.
- Installable demo script added.
Expand Down
56 changes: 50 additions & 6 deletions README.rst
@@ -1,7 +1,8 @@
=======================
django-dummy-thumbnails
=======================
Dummy thumbnails for most popular Django thumbnail generators.
Dummy thumbnails for `most popular <Supported thumbnailers_>`_ Django
thumbnail generators.

There are times when you have a database of a Django site and you need to
quickly start it up to fix/develop, but then you realise that images are
Expand Down Expand Up @@ -81,11 +82,15 @@ Replace broken images with dummy ones
-------------------------------------
That's what it's all about - replacing the broken images with dummy ones.

.. note:: You should **never** use this in production. All the changes
mentioned above are supposed to be applied to **development**
settings only.

Supported thumbnailers
~~~~~~~~~~~~~~~~~~~~~~
A number of most popular image thumbnailers for Django is supported. If you
can't find your favourite thumbnailer, open an issue or consider making a
pull request.
Most popular image thumbnailers for Django (`django-imagekit`_,
`sorl-thumbnail`_ and `easy-thumbnails`_) are supported. If you can't find
your favourite thumbnailer, open an issue or consider making a pull request.

easy-thumbnails
^^^^^^^^^^^^^^^
Expand All @@ -94,7 +99,7 @@ Integration with `easy-thumbnails

Modify your settings in the following way:

(1) Add ``dummy_thumbnails`` to the ``INSTALLED_APPS``:
(1) Add ``easy_thumbnails`` and ``dummy_thumbnails`` to the ``INSTALLED_APPS``:

.. code-block:: python
Expand Down Expand Up @@ -138,7 +143,7 @@ Integration with `sorl-thumbnail

Modify your settings in the following way:

(1) Add ``sorl.thumbnail`` to the ``INSTALLED_APPS``:
(1) Add ``sorl.thumbnail`` and ``dummy_thumbnails`` to the ``INSTALLED_APPS``:

.. code-block:: python
Expand Down Expand Up @@ -181,6 +186,45 @@ Modify your settings in the following way:
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" />
{% endthumbnail %}

django-imagekit
^^^^^^^^^^^^^^^
Integration with `django-imagekit
<https://pypi.python.org/pypi/django-imagekit>`_.

Modify your settings in the following way:

(1) Add ``imagekit``, ``dummy_thumbnails`` and
``dummy_thumbnails.contrib.thumbnailers.django_imagekit.generatorlibrary``
to the ``INSTALLED_APPS``:

.. code-block:: python
INSTALLED_APPS = [
# ...
'imagekit',
'dummy_thumbnails',
'dummy_thumbnails.contrib.thumbnailers.django_imagekit.generatorlibrary',
# ...
]
(2) If you are using the included public domain images, don't forget to collect
the static files and create a symlink:

.. code-block:: sh
./manage.py collectstatic --noinput
./manage.py dummy_thumbnails_symlink_dummy_images
(3) Now the following would work:

.. code-block:: html

{% load imagekit %}

{% thumbnail '640x480' 'None1' %}
{% thumbnail '480x640' 'None2' %}
{% thumbnail '200x200' 'None3' %}

Demo
====
Run demo locally
Expand Down
6 changes: 3 additions & 3 deletions TODOS.rst
Expand Up @@ -9,16 +9,16 @@ on.

Must haves
----------
- ``django-imagekit`` integration.
+ ``django-imagekit`` integration.
+ Add installable demo.

Should haves
------------
- Finish the concept of ``image importers``. Implement import from flickr as
a proof of concept.

Could haves
-----------
- Finish the concept of ``image importers``. Implement import from flickr as
a proof of concept.

Would haves
-----------
22 changes: 22 additions & 0 deletions docs/dummy_thumbnails.contrib.thumbnailers.django_imagekit.rst
@@ -0,0 +1,22 @@
dummy_thumbnails.contrib.thumbnailers.django_imagekit package
=============================================================

Submodules
----------

dummy_thumbnails.contrib.thumbnailers.django_imagekit.generatorlibrary module
-----------------------------------------------------------------------------

.. automodule:: dummy_thumbnails.contrib.thumbnailers.django_imagekit.generatorlibrary
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: dummy_thumbnails.contrib.thumbnailers.django_imagekit
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/dummy_thumbnails.contrib.thumbnailers.rst
Expand Up @@ -6,6 +6,7 @@ Subpackages

.. toctree::

dummy_thumbnails.contrib.thumbnailers.django_imagekit
dummy_thumbnails.contrib.thumbnailers.easy_thumbnails
dummy_thumbnails.contrib.thumbnailers.sorl_thumbnail

Expand Down
56 changes: 50 additions & 6 deletions docs/index.rst
@@ -1,7 +1,8 @@
=======================
django-dummy-thumbnails
=======================
Dummy thumbnails for most popular Django thumbnail generators.
Dummy thumbnails for `most popular <Supported thumbnailers_>`_ Django
thumbnail generators.

There are times when you have a database of a Django site and you need to
quickly start it up to fix/develop, but then you realise that images are
Expand Down Expand Up @@ -81,11 +82,15 @@ Replace broken images with dummy ones
-------------------------------------
That's what it's all about - replacing the broken images with dummy ones.

.. note:: You should **never** use this in production. All the changes
mentioned above are supposed to be applied to **development**
settings only.

Supported thumbnailers
~~~~~~~~~~~~~~~~~~~~~~
A number of most popular image thumbnailers for Django is supported. If you
can't find your favourite thumbnailer, open an issue or consider making a
pull request.
Most popular image thumbnailers for Django (`django-imagekit`_,
`sorl-thumbnail`_ and `easy-thumbnails`_) are supported. If you can't find
your favourite thumbnailer, open an issue or consider making a pull request.

easy-thumbnails
^^^^^^^^^^^^^^^
Expand All @@ -94,7 +99,7 @@ Integration with `easy-thumbnails

Modify your settings in the following way:

(1) Add ``dummy_thumbnails`` to the ``INSTALLED_APPS``:
(1) Add ``easy_thumbnails`` and ``dummy_thumbnails`` to the ``INSTALLED_APPS``:

.. code-block:: python
Expand Down Expand Up @@ -138,7 +143,7 @@ Integration with `sorl-thumbnail

Modify your settings in the following way:

(1) Add ``sorl.thumbnail`` to the ``INSTALLED_APPS``:
(1) Add ``sorl.thumbnail`` and ``dummy_thumbnails`` to the ``INSTALLED_APPS``:

.. code-block:: python
Expand Down Expand Up @@ -181,6 +186,45 @@ Modify your settings in the following way:
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" />
{% endthumbnail %}

django-imagekit
^^^^^^^^^^^^^^^
Integration with `django-imagekit
<https://pypi.python.org/pypi/django-imagekit>`_.

Modify your settings in the following way:

(1) Add ``imagekit``, ``dummy_thumbnails`` and
``dummy_thumbnails.contrib.thumbnailers.django_imagekit.generatorlibrary``
to the ``INSTALLED_APPS``:

.. code-block:: python
INSTALLED_APPS = [
# ...
'imagekit',
'dummy_thumbnails',
'dummy_thumbnails.contrib.thumbnailers.django_imagekit.generatorlibrary',
# ...
]
(2) If you are using the included public domain images, don't forget to collect
the static files and create a symlink:

.. code-block:: sh
./manage.py collectstatic --noinput
./manage.py dummy_thumbnails_symlink_dummy_images
(3) Now the following would work:

.. code-block:: html

{% load imagekit %}

{% thumbnail '640x480' 'None1' %}
{% thumbnail '480x640' 'None2' %}
{% thumbnail '200x200' 'None3' %}

Demo
====
Run demo locally
Expand Down
1 change: 1 addition & 0 deletions examples/requirements/django_1_10.txt
Expand Up @@ -6,5 +6,6 @@ django-debug-toolbar==1.5
sqlparse==0.2.2
django-nine

django-imagekit==3.3
easy-thumbnails==2.3
sorl-thumbnail==12.4a1
1 change: 1 addition & 0 deletions examples/requirements/django_1_8.txt
Expand Up @@ -6,5 +6,6 @@ django-debug-toolbar==1.4
sqlparse==0.1.9
django-nine

django-imagekit==3.3
easy-thumbnails==2.3
sorl-thumbnail==12.4a1
1 change: 1 addition & 0 deletions examples/requirements/django_1_9.txt
Expand Up @@ -6,5 +6,6 @@ django-debug-toolbar==1.5
sqlparse==0.2.2
django-nine

django-imagekit==3.3
easy-thumbnails==2.3
sorl-thumbnail==12.4a1
4 changes: 2 additions & 2 deletions examples/simple/settings/base.py
Expand Up @@ -240,11 +240,11 @@
# What we want to test it with
'easy_thumbnails',
'sorl.thumbnail',
# 'imagekit',
'imagekit',

# django-dummy-thumbnails
'dummy_thumbnails',
# 'dummy_thumbnails.contrib.thumbnailers.easy_thumbnails.source_generators',
'dummy_thumbnails.contrib.thumbnailers.django_imagekit.generatorlibrary',

# Other project specific apps
# 'dummy_thumbnails.tests.foo', # Test app
Expand Down
6 changes: 6 additions & 0 deletions examples/simple/templates/home/base_site.html
@@ -0,0 +1,6 @@
{% extends "base.html" %}
{% load i18n %}

{% block nav-menu %}
{% include "home/nav_menu.html" %}
{% endblock nav-menu %}
15 changes: 15 additions & 0 deletions examples/simple/templates/home/django_imagekit.html
@@ -0,0 +1,15 @@
{% extends "home/base_site.html" %}
{% load i18n %}

{% load imagekit %}

{% block main-content %}

{% thumbnail '640x480' 'None1' %}
{% thumbnail '480x640' 'None2' %}
{% thumbnail '200x200' 'None3' %}

{% endblock main-content %}

{% block sidebar-content %}
{% endblock sidebar-content %}
12 changes: 1 addition & 11 deletions examples/simple/templates/home/easy_thumbnails.html
@@ -1,18 +1,8 @@
{% extends "base.html" %}
{% extends "home/base_site.html" %}
{% load i18n %}

{% load easy_thumbnails %}

{% block nav-menu %}
<ul class="button-group">

<li><a href="{% url 'easy-thumbnails' %}" class="button easy-thumbnails">{% trans "easy-thumbnails" %}</a></li>
<li><a href="{% url 'sorl-thumbnail' %}" class="button sorl-thumbnail">{% trans "sorl-thumbnail" %}</a></li>
<li><a href="{% url 'django-imagekit' %}" class="button django-imagekit">{% trans "django-imagekit" %}</a></li>

</ul>
{% endblock nav-menu %}

{% block main-content %}

<img src="{% thumbnail 'None1' 640x480 crop %}" alt="" class="thumbnail" />
Expand Down
@@ -1,12 +1,9 @@
{% extends "base.html" %}
{% load i18n %}

{% block nav-menu %}
<ul class="button-group">

<li><a href="{% url 'easy-thumbnails' %}" class="button easy-thumbnails">{% trans "easy-thumbnails" %}</a></li>
<li><a href="{% url 'sorl-thumbnail' %}" class="button sorl-thumbnail">{% trans "sorl-thumbnail" %}</a></li>
<li><a href="{% url 'django-imagekit' %}" class="button django-imagekit">{% trans "django-imagekit" %}</a></li>

</ul>
{% endblock nav-menu %}
12 changes: 1 addition & 11 deletions examples/simple/templates/home/sorl_thumbnail.html
@@ -1,18 +1,8 @@
{% extends "base.html" %}
{% extends "home/base_site.html" %}
{% load i18n %}

{% load sorl_thumbnail %}

{% block nav-menu %}
<ul class="button-group">

<li><a href="{% url 'easy-thumbnails' %}" class="button easy-thumbnails">{% trans "easy-thumbnails" %}</a></li>
<li><a href="{% url 'sorl-thumbnail' %}" class="button sorl-thumbnail">{% trans "sorl-thumbnail" %}</a></li>
<li><a href="{% url 'django-imagekit' %}" class="button django-imagekit">{% trans "django-imagekit" %}</a></li>

</ul>
{% endblock nav-menu %}

{% block main-content %}

{% thumbnail 'None1' "640x480" crop="center" as im %}
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/urls.py
Expand Up @@ -15,7 +15,7 @@
urlpatterns_args = [
url(r'^admin/', include(admin.site.urls)),

url(r'^$', TemplateView.as_view(template_name='home/base.html')),
url(r'^$', TemplateView.as_view(template_name='home/base_site.html')),
url(r'^easy-thumbnails/$',
TemplateView.as_view(template_name='home/easy_thumbnails.html'),
name='easy-thumbnails'),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -6,7 +6,7 @@
except:
readme = ''

version = '0.1.2'
version = '0.1.3'

install_requires = [
'six>=1.4.1',
Expand Down

0 comments on commit a97e0e6

Please sign in to comment.