django-command-server
Django management.command is running a long live task, we make it a linux daemon server, so that you can start, stop, restart the task.
Install
pip install django-command-server
Usage
app/management/commands/helloserver.py
import djclick as click
from django_command_server import DjangoCommandServer
class HelloServer(DjangoCommandServer):
def main(self):
while True:
print("hello")
@click.group()
def main():
pass
hello_server = HelloServer()
hello_server.setup(main)
Notes:
- django_command_server is not a django application, do do NOT include it in django's INSTALLED_APPS.
- DjangoCommandServer setup takes a djclick.group(), so create an instance and pass it to setup.
- Implement your own server main.
Release
v0.1.0 2020/11/09
- First release.
v0.1.1 2020/11/09
- Add deps in requirements.txt.
v0.1.2 2023/09/18
- Doc update.
v0.1.3 2025/10/23
- Doc update.
Release files for django-command-server 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_command_server-0.1.3.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_command_server-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.4 kB
Release files / django_command_server-0.1.3.tar.gz
| Download URL | django_command_server-0.1.3.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a968ef235c4b5fed7a0ae35cec15870429cf88e66b2fc667579d1bc52a57c48d
|
|
BLAKE2b-256 checksum How to use checksums |
8bb7b1f02855b305be3c9e023953a96b7210824cee050189095667894dde162d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / django_command_server-0.1.3-py3-none-any.whl
| Download URL | django_command_server-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64d1255a64531f687f128e06e5cd9702279eedc8bc4f2016d9aa84b95b522721
|
|
BLAKE2b-256 checksum How to use checksums |
56ee9fa1c9667eaca4d5e6f128cbd6c515a42cb16f792aa07c0a3c73b75e0b95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|