semvec/pypi-packages huggingface dataset:
django-timesince-shortener 2020.7.1
django timesince replacement
License: Unlicense
Keywords: django timesince

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


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

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

#### Examples
```html
{% load timesince_shortener %}

{{ item.created_at|timesince_shortener }} ago
```

`timesince`|`timesince_shortener`
-|-
`1 hour 5 minutes ago`|`1 hour ago`
`1 year 2 months ago`|`1 year ago`

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-postgres-constraint-commands 2020.7.1
add/drop postgres constraints based on django models
License: Unlicense
Keywords: django postgres constraints

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


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

### Installation
```bash
$ [sudo] pip install django-postgres-constraint-commands
```

#### Pros
designed for Django projects with a large number of models:

+   no need `makemigrations` and `migrate`
+   no migration conflicts
+   integrity checks - drop and create constraints again
+   define tables with raw SQL (optional)

#### How it works
define models foreign and unique keys, run command

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

#### Examples
dev
```bash
$ python manage.py add_constraints # manage.py add_constraints app1 app2 ...
$ python manage.py drop_constraints # manage.py drop_constraints app1 app2 ...
```

prod
```bash
$ ssh user@hostname sudo docker run --env-file .env image python manage.py add_constraints
$ ssh user@hostname sudo docker run --env-file .env image python manage.py drop_constraints
```

`models.py`

```python
class Model1(models.Model):
    name = models.TextField(unique=True)
    obj = models.ForeignKey('Obj',related_name='+',on_delete=models.SET_NULL)

    class Meta:
        db_table = '<db_table>'
        managed=False

class Model2(models.Model):
    user = models.ForeignKey('User',related_name='+',on_delete=models.SET_NULL)
    obj = models.ForeignKey('Obj',related_name='+',on_delete=models.SET_NULL)

    class Meta:
        db_table = '<db_table>'
        managed=False
        unique_together = [('user', 'obj',)]
```

<p align="center">
    <a href="https://readme42.com/">readme42.com</a>
</p>
django-configurations-celery-app 2020.7.1
django-configurations Celery app
License: Unlicense
Keywords: django django-configurations celery

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


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

### Installation
```bash
$ [sudo] pip install django-configurations-celery-app
```

#### Examples
```python
from django_configurations_celery_app import app
```

```bash
$ celery -A django_configurations_celery_app worker -P gevent -c 20 -Q celery
```

P.S.: app source
```python
import os

from celery import Celery

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')

import configurations
configurations.setup()

app = Celery()
app.config_from_object('django.conf:settings')
```

#### Links
+   [django-configurations](https://github.com/jazzband/django-configurations)

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