Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Lazy-Loading module for Django

Project Description

Django-Lazyloader is a simple Django app which helps displaying Django objects as either HTML or JSON.

Quick start

1. Add "lazyloader" to your INSTALLED_APPS setting like this::


2. Include the lazyloader URLconf in your project like this::

url(r'^lazyloader/', include('lazyloader.urls')),

3. Run `python migrate` to create the demo models.

4. Run `python loaddata lazyloader_initial.json` to load the initial data for the live demo.

5. Run `python collectstatic` to collect the static files of the live demo.

6. To allow your models to be displayed by Django-Lazyloader, define a VALID_LAZY_MODELS variable in your
file like this::


7. Create html templates and assign them to your models by adding a LAZY_TEMPLATES variable to your project's file like this::

'MyApp.MyModel': 'myapp/mylazytemplate.html',
'MyOtherApp.MyOtherModel': 'myotherapp/myotherlazytemplate.html'

8. Run the development server and visit http://localhost:8000/lazyloader/demo for the live demo.

9. To access your the first 10 entries of your model 'Myapp.MyModel' in the JSON format visit

10. To access your the first 10 entries of your model 'Myapp.MyModel' in the HTML format visit

11. To create custom queries you can add the get parameters 'column' and 'search_value' to your url:
This url will execute a django-query that looks like this::


12. The variable that is passed to the templates is called 'models' so if you want to iterate over the queryset in a
template you have to do it like this::

{% for model in models %}
{{ model.fieldname }}
{% endfor %}
Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-lazyloader-0.2.tar.gz (40.9 kB) Copy SHA256 Checksum SHA256 Source Mar 20, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting