Skip to main content

Template tags to quickly show real content instead of lorem ipsum.

Project description

Template tags to quickly show real content instead of misleading lorem ipsum. Useful to get a sense of real world content with fun local unicode characters.

Installation

pip install django-real-content

Add “real_content” to your INSTALLED_APPS setting and DRC_LANGUAGE setting (if none is set, english will be used).

INSTALLED_APPS = (
    ...
    'real_content',
)

DRC_LANGUAGE = 'hr'

Languages currently supported out of the box

de, en, hr, si

Usage:

Load django-real-content in your template.

{% load drc %}

random title

show random title

{% drc_title %}

show random title using h3 html tag

{% drc_title 3 %}

show random title using h3 html tag and with additional css class

{% drc_title 3 'custom_css_class' %}

show random title with additional css class

{% drc_title css_class='custom_css_class' %}

random paragraphs

show 1 random paragraph

{% drc_paragraphs %}

show 3 random paragraphs

{% drc_paragraphs 3 %}

show 3 random paragraphs with additional css class

{% drc_paragraphs 3 'custom_css_class' %}

show 1 random paragraph with additional css class

{% drc_paragraphs css_class='custom_css_class' %}

random images

show random image from lorempixel.com

{% drc_image %}

show random image from lorempixel.com which dimensions are 420x360

{% drc_image 420 360 %}

show random image from lorempixel.com which dimensions are 420x360 in category “cats” and grayscale

{% drc_image 420 360 category='sports' gray=True %}

Need more content?

Use management command drc_addcontent to collect titles and paragraphs from given url. If no language is provided, it will use the one given in settings.

python manage.py drc_addcontent -u http://www.24sata.hr/a-383985 -l hr

Content sources

Various localised news portals and local wikipedia in some cases.

TODO

  • add more languages in the package as standard (cz, fr, nl…)

  • tests

  • submit to pypi

Project details


Download files

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

Source Distribution

django-real-content-0.1.0.tar.gz (9.9 kB view details)

Uploaded Source

File details

Details for the file django-real-content-0.1.0.tar.gz.

File metadata

File hashes

Hashes for django-real-content-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1aff8a0e5ef167a3bd7f4975eb78282454383dbb8ed396cbb79e4c30c1134fb3
MD5 d4c3c72259ea6ce3762f120dfbcbfcf9
BLAKE2b-256 c55134aa8b7cc961b4db2bf3a576c6df1ecac3ce4d6ca5a8a38aef06a6d8b8b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page