django-remdow
=============
Simple Django app for static files (img files):
- Download external images
- To center images
- Lazy load images
Install
=======
```python
pip install django_remdow
```
Add `'django_remdow',` to `INSTALLED_APPS`:
```python
INSTALLED_APPS = [
...
'django_remdow',
...
]
```
Usage
=====
remdow app contains different filters and tags. You can activate them with line in your template:
```python
# example.html
{% load remdow %}
```
Download external images
------------------------
If you have model with HTML content which contains external images, you can download external images to local folder and receive static with help `nginx`:
Use filter `img_local`:
```python
{{ '<img src="http://placehold.it/350x150"><img src="http://placehold.it/350x150">'|img_local }}
```
This filter parse HTML code, finds `img` tag, parses urls and then downloads image to local folder, and finally, replaces img url to local url.
Lazy images
-----------
You can use `layzr.js` for lazy loading images.
Load lazy script:
```python
{% lazy_script_include %}
```
And use filter `img_lazy`:
```python
{{ '<img src="http://placehold.it/350x150">'|img_lazy }}
```
Center images with `Bootstrap`
------------------------------
Filter `img_center` centers all images
```python
{{ '<img src="http://placehold.it/350x150">'|img_center }}
```
Filter adds class `center-block` to all img tags
Image responsive with `Bootstrap`
---------------------------------
Filter `img-responsive` responsives all images
```python
{{ '<img src="http://placehold.it/350x150">'|img_responsive }}
```
Filter adds class `img-responsive` to all img tags
Raw data
{
"_id": null,
"home_page": "https://github.com/axsapronov/django-remdow",
"name": "django-remdow",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "django, static, templatetags, downloader",
"author": "Alexander Sapronov",
"author_email": "a@sapronov.me",
"download_url": "https://files.pythonhosted.org/packages/fc/c2/40295d9b93d8e9f904549915b33ac5636ab81cf5c0e05d96c5ac5cb90ca6/django-remdow-0.0.9.tar.gz",
"platform": null,
"description": "django-remdow\n=============\n\nSimple Django app for static files (img files):\n\n- Download external images\n- To center images\n- Lazy load images\n\nInstall\n=======\n\n```python\npip install django_remdow\n```\n\nAdd `'django_remdow',` to `INSTALLED_APPS`:\n\n```python\nINSTALLED_APPS = [\n ...\n 'django_remdow',\n ...\n]\n```\n\n\nUsage\n=====\n\nremdow app contains different filters and tags. You can activate them with line in your template:\n\n\n```python\n# example.html\n\n{% load remdow %}\n```\n\n\nDownload external images\n------------------------\n\nIf you have model with HTML content which contains external images, you can download external images to local folder and receive static with help `nginx`:\n\nUse filter `img_local`:\n\n```python\n{{ '<img src=\"http://placehold.it/350x150\"><img src=\"http://placehold.it/350x150\">'|img_local }}\n```\n\nThis filter parse HTML code, finds `img` tag, parses urls and then downloads image to local folder, and finally, replaces img url to local url.\n\nLazy images\n-----------\n\nYou can use `layzr.js` for lazy loading images.\n\nLoad lazy script:\n\n```python\n{% lazy_script_include %}\n```\n\nAnd use filter `img_lazy`:\n\n```python\n{{ '<img src=\"http://placehold.it/350x150\">'|img_lazy }}\n```\n\n\nCenter images with `Bootstrap`\n------------------------------\n\nFilter `img_center` centers all images\n\n```python\n{{ '<img src=\"http://placehold.it/350x150\">'|img_center }}\n```\n\nFilter adds class `center-block` to all img tags\n\n\nImage responsive with `Bootstrap`\n---------------------------------\n\nFilter `img-responsive` responsives all images\n\n```python\n{{ '<img src=\"http://placehold.it/350x150\">'|img_responsive }}\n```\n\nFilter adds class `img-responsive` to all img tags\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Django app for lazyload static files (img files)",
"version": "0.0.9",
"project_urls": {
"Homepage": "https://github.com/axsapronov/django-remdow"
},
"split_keywords": [
"django",
" static",
" templatetags",
" downloader"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "58bb1570c28914ba9e491d5ec82d7f095d64ea93e33e769d7e6d4d85877c0d9d",
"md5": "ceebfd458de65a83fd4227d570f8d72c",
"sha256": "32ffe76a2da3c1dbd716abc24d38a68bcb4eb01a1bfd8f92c028d157be3d3e62"
},
"downloads": -1,
"filename": "django_remdow-0.0.9-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "ceebfd458de65a83fd4227d570f8d72c",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4928,
"upload_time": "2024-03-23T08:18:48",
"upload_time_iso_8601": "2024-03-23T08:18:48.491330Z",
"url": "https://files.pythonhosted.org/packages/58/bb/1570c28914ba9e491d5ec82d7f095d64ea93e33e769d7e6d4d85877c0d9d/django_remdow-0.0.9-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fcc240295d9b93d8e9f904549915b33ac5636ab81cf5c0e05d96c5ac5cb90ca6",
"md5": "1fcc759b31683c01228184cfcbd599e5",
"sha256": "f6600e32296da29ca7716f8e572b5470fdfe1bbb702d815fc47b9b889e76ab24"
},
"downloads": -1,
"filename": "django-remdow-0.0.9.tar.gz",
"has_sig": false,
"md5_digest": "1fcc759b31683c01228184cfcbd599e5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4954,
"upload_time": "2024-03-23T08:18:50",
"upload_time_iso_8601": "2024-03-23T08:18:50.750587Z",
"url": "https://files.pythonhosted.org/packages/fc/c2/40295d9b93d8e9f904549915b33ac5636ab81cf5c0e05d96c5ac5cb90ca6/django-remdow-0.0.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-23 08:18:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "axsapronov",
"github_project": "django-remdow",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "django-remdow"
}