bash
pip install django-schedule
python
INSTALLED_APPS = [
...
'schedule',
...
]
python
from django.db import models
from schedule.models import Event
class EmailTask(models.Model):
event = models.OneToOneField(Event, on_delete=models.CASCADE)
recipient = models.EmailField()
subject = models.CharField(max_length=100)
content = models.TextField()
python
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
...
path('admin/schedule/', include('schedule.urls')),
path('admin/', admin.site.urls),
...
]
bash
python manage.py makemigrations
python manage.py migrate
bash
python manage.py createsuperuser