semvec/pypi-packages huggingface dataset:
django-simpletask 0.3.7
Django application provides simple task model, admin, server services and client service.
License: MIT
Keywords: django abstract model,django simple task

# django-simpletask

Django application provides simple task model, admin, server services and client service.


## Install

```
pip install django-simpletask
```

## Usage

**pro/settings**

```
INSTALLED_APPS = [
    'django_db_lock',
    'django_simpletask',
]

DJANGO_SIMPLETASK_ACLKEY = "TsE9Jd3TrUtTA9wjGCLXoDqh891srpyo"

```

**Note:**

- Mostly you need a lock service, so we add django_db_lock in INSTALLED_APPS.
- Set DJANGO_SIMPLETASK_ACLKEY to your own aclkey. It will be used in task executor.

**app/models.py**

```
from django.db import models
from django_simpletask.models import SimpleTask

class Task1(SimpleTask):
    title = models.CharField(max_length=64)

    class Meta:
        permissions = [] + SimpleTask.Meta.permissions

    def do_task_main(self):
        return "done!"

class Task2(SimpleTask):
    title = models.CharField(max_length=64)

    class Meta:
        permissions = [] + SimpleTask.Meta.permissions

    def do_task_main(self):
        return "done!"
```


**Note:**

- Write your own task model based on SimpleTask.
- Add task reset permission.
- Implement you own do_task_main.

**app/admin.py**

```
from django.contrib import admin
from django_simpletask.admin import SimpleTaskAdmin
from .models import Task1
from .models import Task2


class TaskAdmin(SimpleTaskAdmin, admin.ModelAdmin):
    list_display = ["title"] + SimpleTaskAdmin.list_display


admin.site.register(Task1, TaskAdmin)
admin.site.register(Task2, TaskAdmin)

```

**Note:**

- Mostly we don't want to change anything inside task, so we set task fields readonly.

**task_executor.py**

```
from daemon_application.app import DaemonApplication
from django_simpletask.services import SimpleTaskService

class TaskExcutor(DaemonApplication):
    def main(self):
        service = SimpleTaskService("http://127.0.0.1:8000/example/task/services/", aclkey="TsE9Jd3TrUtTA9wjGCLXoDqh891srpyo")
        service.start()
        service.join()

app = TaskExcutor().get_controller()

if __name__ == "__main__":
    app()

```

**Note:**

- Add task_executor.py script.
- Set the server to your own url.
- Set the aclkey match the DJANGO_SIMPLETASK_ACLKEY setting.

## Release

### v0.1.0

- First release.
- Take from django-fastadmin. django-fastadmin should forcus on admin extensions, but NOT abstract models.

### v0.1.1

- Add SimpleTask.do_tasks.

### v0.1.2

- Add SimpleTask.serve and SimpleTask.serve_forever.

### v0.1.3

- Add idle_sleep_time parameter for SimpleTask.serve_forever.

### v0.1.6

- Add reset action.
- Add SimpleTask.force_finish.
- Add multi-threads serve.

### v0.2.2

- Long running service don't use database.
- Add aclkey check for simpletask apis.

### v0.2.8

- Add SimpleTaskServiceProxy and required views.
- Add get_ready_tasks_queryset to SimpleTaskViews.

### v0.2.9

- Add channel params.

### v0.3.5

- Bad response handler.
- Services changed a a lot.

### v0.3.6

- Doc update.

### v0.3.7

- Fix ugettext problem.
django-simple-publish-model 0.1.4
Django application provides simple publish/unpublish model and admin.
License: MIT
Keywords: django abstract model,django simple publish model

# django-simple-publish-model

Django application provides simple publish/unpublish model and admin.

## Install

```
pip install django-simple-publish-model
```


## Usage

**pro/settings.py**

```
INSTALLED_APPS = [
    ...
    'django_fastadmin',
    'django_simple_publish_model',
    ...
]
```

**app/models.py**

```

```

## Releases

### v0.1.0 2020/10/27

- First release.
- Take from django_fastadmin.

### v0.1.2 2021/04/08

- Add actions.

### v0.1.3 2023/09/14

- Doc update.

### v0.1.4 2023/09/22

- Fix ugettext problem.
django-redis-data-manager 0.1.8
A simple django application provide simple redis cache data manager functional.
License: MIT
Keywords: django simple application

# django-redis-data-manager

A simple django application provide simple redis cache data manager functional.


## Install

```
pip install django-redis-data-manager
```

- If you want to use guniocrn web server, install `gunicorn` it by yourself.
- If you want to use mysql database, install `mysqlclient` by yourself.

## Install Server Command

- manage-django-redis-data-manager

**Command Help**

```
C:\Workspace\redis-dataman>manage-django-redis-data-manager

Type 'manage-django-redis-data-manager help <subcommand>' for help on a specific subcommand.

Available subcommands:

[auth]
    changepassword
    createsuperuser

[contenttypes]
    remove_stale_contenttypes

[django]
    check
    compilemessages
    createcachetable
    dbshell
    diffsettings
    dumpdata
    flush
    inspectdb
    loaddata
    makemessages
    makemigrations
    migrate
    sendtestemail
    shell
    showmigrations
    sqlflush
    sqlmigrate
    sqlsequencereset
    squashmigrations
    startapp
    startproject
    test
    testserver

[django_server_controller]
    wsgi-server

[sessions]
    clearsessions

[staticfiles]
    collectstatic
    findstatic
    runserver
```

## Usage

- We will try to load your private settings from `django_redis_data_manager_project_local_settings.py` module.
- By default the admin site registered under path: `/admin/`. You can change it by set `ADMIN_SITE_URL=<your site path>` in `django_redis_data_manager_project_local_settings.py`.
- By default we try to use sqlite3 database. You can change it by set new `DATABASES` in `django_redis_data_manager_project_local_settings.py`.

## Releases

### v0.1.0

- First release.

### v0.1.1

- Add depends package in requirements.txt.

### v0.1.2

- Add `ADMIN_SITE_URL` to custom admin site register url.
- Add default WSGI_SERVER_ENGINE to `gunicorn`, and add the default `uwsg.conf.py` which will let the server listen on `16379` port to do service.

### v0.1.3

- Fix static link problem.

### v0.1.4

- Add django_safe_fields in app_requires.
- Setup fix.

### v0.1.5

- Show json in pretty way.

### v0.1.6

- Fix dependence package version problem.

### v0.1.7

- Doc update.

### v0.1.8

- Fix ugettext problem.