semvec/pypi-packages huggingface dataset:
exit 2020.12.3
register function to be executed at termination
License: Unlicense
Keywords: exit termination

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/exit.svg?maxAge=3600)](https://pypi.org/project/exit/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install exit
```

#### Features
+   better than `atexit.register`
+   `SIGKILL`, `SIGSTOP` or `os._exit()` not supported

#### Examples
```python
>>> import exit
>>> def on_exit():
    print("goodbye world")

>>> exit.register(on_exit)
```

#### Links
+   [How to always execute exit functions in Python](http://grodola.blogspot.com/2016/02/how-to-always-execute-exit-functions-in-py.html)

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
execdir 2020.12.3
run command from multiple directories
License: Unlicense
Keywords: execdir

<!--
https://readme42.com
-->



[![](https://img.shields.io/badge/OS-Unix-blue.svg?longCache=True)]()
[![](https://img.shields.io/pypi/v/execdir.svg?maxAge=3600)](https://pypi.org/project/execdir/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install execdir
```

```bash
$ [sudo] npm i -g execdir
```

#### How it works
1.  create list of directories
2.  run command

#### Config
`$XDG_CONFIG_HOME/execdir` by default - `~/.config/execdir`

```bash
$ export EXECDIR=~/Library/execdir
```

#### Examples
set directories
```bash
# ~/git/owner/repo
$ find ~/git -type d -maxdepth 2 | execdir set all
$ find ~/git -name "setup.py" -maxdepth 3 | sed 's#/[^/]*$##' | execdir set pypi
$ find ~/git -name "package.json" -maxdepth 3 | sed 's#/[^/]*$##' | execdir set npmjs
$ find ~/git -name ".travis.yml" -maxdepth 3 | sed 's#/[^/]*$##' | execdir set travis
```

run command
```bash
$ execdir run pypi python setup.py sdist upload
$ execdir run npmjs npm publish
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
exec-cache 2020.12.3
cache exec outputs
License: Unlicense
Keywords: cache exec

<!--
https://readme42.com
-->



[![](https://img.shields.io/badge/OS-Unix-blue.svg?longCache=True)]()
[![](https://img.shields.io/pypi/v/exec-cache.svg?maxAge=3600)](https://pypi.org/project/exec-cache/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install exec-cache
```

```bash
$ [sudo] npm i -g exec-cache
```

#### How it works
```bash
$EXEC_CACHE/<hash>.out
$EXEC_CACHE/<hash>.err
$EXEC_CACHE/<hash>.status
```

#### Config
`$EXEC_CACHE`, default is `$EXEC_CACHE/exec-cache`, e.g. `~/.cache/exec-cache`

```bash
$ export EXEC_CACHE="custom-path"
```

#### Examples
example #1: cache psql queries
```bash
$ value="$(exec-cache psql -At -c "SELECT ..." dbname)"
```

example #2: clear cache

```bash
$ export EXEC_CACHE=~/.cache/exec-cache/psql # custom folder
$ rm -fr "$EXEC_CACHE"
$ value="$(exec-cache psql -At -c "SELECT ..." dbname)"
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
env2json 2020.12.3
.env -> .env.json
License: Unlicense
Keywords: env json

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/env2json.svg?maxAge=3600)](https://pypi.org/project/env2json/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install env2json
```

#### Examples
`.env.dev`
```bash
DB_NAME=name
DB_USER=username
DB_HOST=127.0.0.1
DB_PORT=5432
```

```bash
$ python -m env2json .env.dev > .env.dev.json
```

`.env.dev.json`
```json
{
  "DB_HOST": "127.0.0.1",
  "DB_NAME": "name",
  "DB_PORT": "5432",
  "DB_USER": "username"
}
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
env-strip 2020.12.3
strip comments, blank lines and double quotes from env file
License: Unlicense
Keywords: env strip

<!--
https://readme42.com
-->



[![](https://img.shields.io/badge/OS-Unix-blue.svg?longCache=True)]()
[![](https://img.shields.io/pypi/v/env-strip.svg?maxAge=3600)](https://pypi.org/project/env-strip/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install env-strip
```

```bash
$ [sudo] npm i -g env-strip
```

#### Pros
+   Docker compatible environment file without comments, blank lines and double quotes

#### Examples
`.env`
```bash
SECRET_KEY="https://www.youtube.com/channel/UCTZUTvv_1Onm-f-533Hyurw"

# postgres settings:
DB_NAME="name" # comment
DB_USER="postgres" # comment
DB_HOST="127.0.0.1" # comment
DB_PORT=5432 # comment
```

```bash
$ env-strip .env
SECRET_KEY=https://www.youtube.com/channel/UCTZUTvv_1Onm-f-533Hyurw
DB_NAME=name
DB_USER=postgres
DB_HOST=127.0.0.1
DB_PORT=5432
```

stdin
```bash
$ find . \( -name .env.base -o -name ".env.prod.*" \) -exec cat {} \; | env-strip - > .env.prod
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
env-file 2020.12.3
.env file handler. required for django, docker, etc
License: Unlicense
Keywords: env

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/env-file.svg?maxAge=3600)](https://pypi.org/project/env-file/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install env-file
```

#### Examples
#### Examples

`.env`
```bash
DJANGO_SETTINGS_MODULE=project.settings
DB_NAME=dbname
DB_PASS=secret
```

```python
import env_file
env_file.load('.env')
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
elapsed 2020.12.3
elapsed time
License: Unlicense
Keywords: elapsed

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/elapsed.svg?maxAge=3600)](https://pypi.org/project/elapsed/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install elapsed
```

#### Features
+   accepts `datetime` or pid. `os.getcwd()` by default

#### Examples
`datetime` elapsed time
```python
>>> dt = datetime.datetime.now()
>>> time.sleep(2)
>>> elapsed.get(dt)
'00:02'
```

process  elapsed time by pid (`os.getpid()` by default)
```python
>>> import elapsed
>>> e = elapsed.get(1)
'02-16:30:38'
>>> e.days, e.hours, e.minutes, e.seconds
(2, 64, 3870, 232238)
```

`elapsed.seconds()`, `elapsed.minutes()`, `elapsed.hours()`, `elapsed.days()`
```python
>>> elapsed.seconds(1)
232238
>>> elapsed.minutes(1)
3870
>>> elapsed.hours(1)
64
>>> elapsed.days(1)
2
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
docker-upload-and-build 2020.12.3
upload sources to server and build docker image
License: Unlicense
Keywords: docker

<!--
https://readme42.com
-->



[![](https://img.shields.io/badge/OS-Unix-blue.svg?longCache=True)]()
[![](https://img.shields.io/pypi/v/docker-upload-and-build.svg?maxAge=3600)](https://pypi.org/project/docker-upload-and-build/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install docker-upload-and-build
```

```bash
$ [sudo] npm i -g docker-upload-and-build
```

#### Pros
+   upload sources to server and build docker image
+   no need docker hub and docker desktop

#### Features
+   `.dockerignore` as rsync `exclude-from` file (optional)

#### Examples
```bash
docker-upload-and-build user@hostname tag .
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-update-from-dict 2020.12.3
Update Django model from dictionary
License: Unlicense
Keywords: django update dict

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-update-from-dict.svg?maxAge=3600)](https://pypi.org/project/django-update-from-dict/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-update-from-dict
```

#### Examples
Mixin:
```python
from django.db import models
from django_update_from_dict import update_from_dict, UpdateFromDictMixin

class ClassName(UpdateFromDictMixin,models.Model):
    ...

instance = ClassName()
instance.update_from_dict(attrs,commit=True)
```

function:
```python
from django_update_from_dict import update_from_dict

update_from_dict(instance,attrs,commit=True)
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-traceback 2020.12.3
Traceback model and utils
License: Unlicense
Keywords: django traceback

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-traceback.svg?maxAge=3600)](https://pypi.org/project/django-traceback/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-traceback
```

#### Examples
```python
from django_traceback.utils import save_traceback
import requests
from apps.celery import celery_app

@celery_app.task
def task():
    try:
        r = requests.get('url')
    except (requests.exceptions.ConnectionError,...):
        save_traceback(__file__)
        # init task again
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-templates-variables 2020.12.3
Django templates variables settings
License: Unlicense
Keywords: django templates variables

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-templates-variables.svg?maxAge=3600)](https://pypi.org/project/django-templates-variables/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-templates-variables
```

##### `settings.py`
```python
INSTALLED_APPS+= [
    'django_templates_variables'
]

TEMPLATES = [
    {
        # …
        'OPTIONS': {
            'context_processors': [
                'django_templates_variables.context_processors.templates_variables',
            ],
        },
    },
]
```

#### Examples
`settings.py`
```python
TEMPLATES_VARIABLES = dict(
    settings = dict(
        DEBUG=DEBUG,
        VAR="VALUE"
    )
)
```

`template.html`:
```html
{% if settings.DEBUG %}
    {{ settings.VAR }}
{% endif %}
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-template-url-optional 2020.12.3
django url tag with optional arguments
License: Unlicense
Keywords: django template url

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-template-url-optional.svg?maxAge=3600)](https://pypi.org/project/django-template-url-optional/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-template-url-optional
```

#### Examples
`settings.py`
```python
INSTALLED_APPS = [
    ...
    'django_template_url_optional',
    ...
]
```


```html
{% load url_optional %}

<a href="{% url_optional 'item_list' variable %}">
<a href="{% url_optional 'item_list' %}">
```

`urls.py`
```python
urlpatterns = [
    path('<str:name>/', views.ItemListView.as_view(),name='item_list'),
    path('', views.ItemListView.as_view(),name='item_list'),
]
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-template-cli 2020.12.3
CLI tool to render django template files
License: Unlicense
Keywords: django template

<!--
https://readme42.com
-->



[![](https://img.shields.io/badge/OS-Unix-blue.svg?longCache=True)]()
[![](https://img.shields.io/pypi/v/django-template-cli.svg?maxAge=3600)](https://pypi.org/project/django-template-cli/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-template-cli
```

#### How it works
```
index.html
context.json (optional)
```

#### Examples
`index.html`:
```html
{% for v in values %}
{{ forloop.counter0 }}: {{ v }}
{% endfor %}
```

`context.json`:
```json
{
    "values": ["value1","value2","value3"]
}
```

```bash
$ django-template-cli index.html
0: value1

1: value2

2: value3
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-subcommands 2020.12.3
Django subcommands
License: Unlicense
Keywords: django subcommands

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-subcommands.svg?maxAge=3600)](https://pypi.org/project/django-subcommands/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-subcommands
```

#### Examples
`management/commands/command.py`
```python
from django.core.management.base import BaseCommand
import django_subcommands

class SubCommand1(BaseCommand):
    def handle(self, *args, **options):
        ...

class SubCommand2(BaseCommand):
    def handle(self, *args, **options):
        ...

class Command(django_subcommands.SubCommands):
    subcommands = {"subcommand1": SubCommand1,"subcommand2":SubCommand2}
```

```bash
$ python manage.py command subcommand1
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-storages-s3-env 2020.12.3
create env for django-storages S3
License: Unlicense
Keywords: django-storages s3 env

<!--
https://readme42.com
-->



[![](https://img.shields.io/badge/OS-Unix-blue.svg?longCache=True)]()
[![](https://img.shields.io/pypi/v/django-storages-s3-env.svg?maxAge=3600)](https://pypi.org/project/django-storages-s3-env/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-storages-s3-env
```

```bash
$ [sudo] npm i -g django-storages-s3-env
```

#### Pros
+   compatible with [django-storages S3 settings](https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html)
+   create env with one command

#### How it works
hard-coded environment variables names:
+   `AWS_STORAGE_BUCKET_NAME`
+   `AWS_STORAGE_USER`
+   `AWS_ACCESS_KEY_ID`
+   `AWS_SECRET_ACCESS_KEY`

#### Examples
`Makefile`, create env
```bash
MEDIA_BUCKET:=BUCKET_NAME
all:
    test -s .env.prod.media || storages-s3-create-env $(MEDIA_BUCKET) > .env.prod.media
```

#### Links
+   [django-storages](https://django-storages.readthedocs.io/en/latest/index.html)

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-static-s3 2020.12.3
django static/ S3
License: Unlicense
Keywords: django static s3

<!--
https://readme42.com
-->



[![](https://img.shields.io/badge/OS-Unix-blue.svg?longCache=True)]()
[![](https://img.shields.io/pypi/v/django-static-s3.svg?maxAge=3600)](https://pypi.org/project/django-static-s3/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-static-s3
```

```bash
$ [sudo] npm i -g django-static-s3
```

#### How it works
`static/` hard-coded folder

scripts:
+   create full-access user and credentials
+   upload `static/`

hard-coded environment variables names:
+   `AWS_S3_STATIC_BUCKET`
+   `AWS_S3_STATIC_USER`
+   `AWS_S3_STATIC_ACCESS_KEY_ID`
+   `AWS_S3_STATIC_SECRET_ACCESS_KEY`

#### Examples
`Makefile`, create env
```bash
STATIC_BUCKET:=BUCKET_NAME
all:
    test -s .env.s3.static || static-s3-create-env $(STATIC_BUCKET) > .env.s3.static
```

upload `static/` to S3 
```bash
export DJANGO_SETTINGS_MODULE=settings.dev
python manage.py collectstatic --no-input

set -o allexport
. .env.s3.static || exit

static-s3-upload
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-standalone-setup 2020.12.3
call django.setup() for standalone usage
License: Unlicense
Keywords: django standalone

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-standalone-setup.svg?maxAge=3600)](https://pypi.org/project/django-standalone-setup/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-standalone-setup
```

#### Features
calls `django.setup` once only

#### Config
```bash
$ export DJANGO_SETTINGS_MOULE='django_settings'
```

`site-package/django_settings.py`
```python
INSTALLED_APPS = [
    'your_app',
]
DATABASES = {
    'default': {
        ...
    }
}
```

#### Examples
`script.py`
```python
# !/usr/bin/env python
import django_standalone_setup # at the top of module
...
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-split-listview 2020.12.3
split Django ListView queryset
License: Unlicense
Keywords: django listview

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-split-listview.svg?maxAge=3600)](https://pypi.org/project/django-split-listview/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-split-listview
```

#### Examples
```python
from django_split_listview.views import SplitListView

class RepoListView(SplitListView):
    def get_queryset_base(self):
        return self.model.all()

    def get_queryset_filter_kwargs(self):
        if self.request.GET.get('type','') == 'fork':
            return {'fork':True}

    def get_queryset_only_fields(self):
        return ['id','name','stargazers_count','language']

    def get_queryset_order_by_fields(self):
        if self.request.GET.get('o','') == 'stars':
            return ['-stargazers_count']
        return ['-updated_at']
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-site-local-middleware 2020.12.3
adds .local:port to the site domain links for local development if settings.DEBUG is True
License: Unlicense
Keywords: django site middleware

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-site-local-middleware.svg?maxAge=3600)](https://pypi.org/project/django-site-local-middleware/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-site-local-middleware
```

#### Examples
`settings.py`

```python
DEBUG=True

MIDDLEWARE = [
    ...
    'django_site_local_middleware.middleware.SiteLocalMiddleware'
    ...
]
```

`/etc/hosts`
```
127.0.0.1   site.com.local
```


```bash
$ python manage.py runserver 0.0.0.0:8000
```

before|after
-|-
`<a href="http://site.com/">`|`<a href="http://site.com.local:8000/">`

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-site-id-middleware 2020.12.3
auto settings.SITE_ID middleware
License: Unlicense
Keywords: django site middleware

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-site-id-middleware.svg?maxAge=3600)](https://pypi.org/project/django-site-id-middleware/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-site-id-middleware
```

#### Cons
+   `django.contrib.syndication` not supported

#### Examples
`settings.py`

```python
MIDDLEWARE = [
    ...
    'django_site_id_middleware.middleware.SiteIdMiddleware'
    ...
]
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-schedule-daemon 2020.12.3
Django schedule daemon https://pypi.org/project/schedule/
License: Unlicense
Keywords: Django schedule daemon

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-schedule-daemon.svg?maxAge=3600)](https://pypi.org/project/django-schedule-daemon/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-schedule-daemon
```

##### `settings.py`
```python
INSTALLED_APPS+= ['django_schedule_daemon']
```

##### `.env`
```bash
DJANGO_SCHEDULE_MODULE=schedule_jobs
```

#### Examples
`schedule_jobs.py`
```python
import schedule

from django.core.management import call_command

schedule.every(5).seconds.do(lambda:call_command('test_command'))
```

```bash
python manage.py schedule_daemon
```

#### Links
+   [schedule](https://github.com/dbader/schedule)

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-s3-static 2020.12.3
store Django Static Files on Amazon S3
License: Unlicense
Keywords: django aws s3

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-s3-static.svg?maxAge=3600)](https://pypi.org/project/django-s3-static/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-s3-static
```

##### `settings.py`
```python
INSTALLED_APPS = [
    "django_s3_static",
]
```

`settings/dev.py`
```python
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
```

`settings/prod.py`
```python
AWS_STATIC_ACCESS_KEY_ID = os.getenv('AWS_STATIC_ACCESS_KEY_ID')
AWS_STATIC_SECRET_ACCESS_KEY = os.getenv('AWS_STATIC_SECRET_ACCESS_KEY')
AWS_STATIC_BUCKET = os.getenv('AWS_STATIC_BUCKET')

STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = "https://%s.s3.amazonaws.com/" % AWS_STATIC_BUCKET
```

#### Examples
```bash
$ python manage.py s3_static_create # create s3 bucket and policy
$ python manage.py s3_static_sync   # sync static folder with s3 bucket
```

```html
{% load static %}
<link rel="stylesheet" href="{% static "css/file.css" %}">
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-replace 2020.12.3
django replace filter
License: Unlicense

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-replace.svg?maxAge=3600)](https://pypi.org/project/django-replace/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-replace
```

#### Examples
`template.html`
```html
{% load replace %}

{{ value|replace:",search,replace" }}
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-remark42 2020.12.3
django remark42 comments
License: Unlicense
Keywords: django remark42 comments

<!--
https://readme42.com
-->


[![](https://img.shields.io/pypi/v/django-remark42.svg?maxAge=3600)](https://pypi.org/project/django-remark42/)
[![](https://img.shields.io/badge/License-Unlicense-blue.svg?longCache=True)](https://unlicense.org/)

### Installation
```bash
$ [sudo] pip install django-remark42
```

##### `settings.py`
```python
INSTALLED_APPS+= [
    'django_remark42'
]

REMARK42_HOST=os.getenv('REMARK42_HOST')
REMARK42_SITE_ID=os.getenv('REMARK42_SITE_ID')
# optional:
REMARK42_MAX_SHOWN_COMMENTS=os.getenv('REMARK42_MAX_SHOWN_COMMENTS') # 15 by default
REMARK42_THEME=os.getenv('REMARK42_THEME') # 'light' by default
```

#### Examples
```
{% load remark42 %}
```

comments:
```html
<div id="remark42"></div>

{% remark42_comments_script 'Page Title' %}
{% remark42_comments_script 'Page Title' max_shown_comments=10 theme='dark' %}
```

last comments:
```html
<div id="remark42"></div>

{% remark42_last_comments_script %}
```

counter:
```html
<div id="remark42"></div>

{% remark42_counter_script %}
```

#### Links
+   [github.com/umputun/remark](https://github.com/umputun/remark)

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>