The quickest way to setup async tasks with Django.
Project description
Django Quick Queue
Django Quick Queue is a fast and simple way to use async tasks in Django. This package has a limited use case. If you are looking for a more complex async task systems you should try Django Q, Celery, or Huey. Quick Queue is meant to give you the simplest method to started executing small asynchronous tasks.
Installation
1. Install Package
pip install quickq
2. Add Base URL to settings.py
QQ_BASE_URL = 'https://mysite.example.com'
3. Setup the view in your urls.py
from quickq import taskinator
urlpatterns = [
url(r'^taskinator/(\S+)$', taskinator, name="taskinator"),
...
]
4. Add the decorator to any function
from quickq import Task
@Task()
def send_approved (name, slug, email):
send_mail(
'Yay E-mail!',
message,
settings.DEFAULT_FROM_EMAIL,
[email],
fail_silently=False,
)
5. Execute your task as normal
send_email('Narf', 'narf-me', 'narf@aol.com')
How it Works
Your task is called
A PyJWT is generated.
The taskinator URL is called asynchronously.
Taskinator view executed
Decodes the JWT.
Excutes the original task function outside of the original request.
Limitations
Function arguments are converted to JSON so they must be JSON compatible.
Request time may be limited. If your webserver has a limitation on request time then that will also affect how long your tasks can execute since they are simply web requests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for quickq-17.8.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54055332623c2d33f0417ebfa1e3ae307a450fecf3fb91259d168bfcce277486 |
|
MD5 | 228424a8c2b143fd42f8e4fb284cef63 |
|
BLAKE2b-256 | 9508b9b3f29e93a9cce97f4f2870788303b3b5ee9f75399e22d894092f59a152 |