Email and Django Q Configuration 📧¶
Email Configuration 📧¶
The app needs a working email setup to send confirmations and reminders. Add this to your settings.py:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'your_smtp_host'
EMAIL_PORT = 587 # or 465 with EMAIL_USE_SSL
EMAIL_USE_TLS = True # or EMAIL_USE_SSL = True
EMAIL_HOST_USER = 'your_email@example.com'
EMAIL_HOST_PASSWORD = 'your_email_password'
# Optional: your website's name, shown at the top of the emails
APPOINTMENT_WEBSITE_NAME = 'Your Website Name'
To change the emails, see Custom templates: each
email can be overridden, with its subject and its plain-text part, and with DEBUG = True a superuser can preview them
all at app-admin/email-preview/.
Note: In production, keep secrets like the email password in environment variables (or another secure store), not in
settings.py.
Django Q Configuration ⏰¶
Django-Appointment uses Django Q to send reminder emails at the right time and to clean up abandoned booking requests every day. It's optional, but recommended.
Setting up Django Q¶
-
Install Django Q:
-
Add
django_qtoINSTALLED_APPSin yoursettings.py: -
Configure Django Q in your
settings.py: -
Create Django Q's tables:
-
Start the Django Q cluster, and keep it running alongside your server:
Note: Without Django Q, the app works normally, but reminder emails are not sent and old booking requests are only cleaned up when you run
python manage.py cleanup_appointment_requestsyourself.