Commits

Artur Barseghyan committed 1ad6043 Draft

more docs and examples

Comments (0)

Files changed (4)

 2. Add 'eximagination' to `INSTALLED_APPS`
 
 >>> INSTALLED_APPS = (
->>> # ...
->>> 'eximagination',
->>> # ...
+>>>     # ...
+>>>     'eximagination',
+>>>     # ...
 >>> )
 
 3. Configure
 Usage example (in a Django template)
 =======================================
     {% load eximaginate %}
+
     <img src="{{ MEDIA_URL }}{% eximaginate 'http://www.google.com/intl/en/images/logo.gif' %}">
 
     or
 
     {% load eximaginate thumbnail %}
+
     {% eximaginate 'http://www.google.com/intl/en/images/logo.gif' as original %}
+    
     <img src="{% thumbnail original 100x100 %}">
 
     In both cases there are two additional context variables added:
+Example eximagination project
+===================================
+
+Install, configure, run...
+-----------------------------------
+
+$ pip install -r requirements.txt
+
+$ cp local_settings.example local_settings.py
+
+$ ./manage.py runserver
+
+Open http://localhost:8000/ in your browser to see the example page.

example/requirements.txt

 Django==1.5.1
 Jinja2==2.7
 MarkupSafe==0.18
+Pillow==2.1.0
 Pygments==1.6
 Sphinx==1.2b1
 argparse==1.2.1
 django-debug-toolbar==0.9.4
 docutils==0.10
+eximagination==0.5
 ipdb==0.7
 ipython==0.13.2
 sorl-thumbnail==3.2.5
 wsgiref==0.1.2
-Pillow==-2.1.0

src/eximagination/templatetags/eximaginate.py

 from django import template
 
 from eximagination.utils import _obtain_image
-from eximagination.settings import MEDIA_ROOT, MEDIA_URL, MEDIA_RELATIVE_ROOT, DEBUG
+from eximagination.settings import MEDIA_ROOT, MEDIA_RELATIVE_ROOT
 
 register = template.Library()