Customizing Your Django Appointment Scheduler
Initial Setup
Append the following to your Django's settings.py to configure your user model:
AUTH_USER_MODEL = 'models.UserModel' # Optional if you use Django's user model
Example of using a custom user model called UserClient in an app named client:
AUTH_USER_MODEL = 'client.UserClient'
Using the default Django user model:
AUTH_USER_MODEL = 'auth.User'
Configure the create_user function to support your custom user model:
def create_user(first_name, email, username, last_name=None, **extra_fields):
pass
This function will create a passwordless user and send a link to set the password via email.
Set your website's name in your settings.py, which will be used in email footers:
APPOINTMENT_WEBSITE_NAME = 'Chocolates'
<p>® 2023 . All Rights Reserved.</p>
Essential Configurations
Here are the crucial configurations needed for the application to operate correctly:
APPOINTMENT_BASE_TEMPLATE = 'base_templates/base.html'
APPOINTMENT_ADMIN_BASE_TEMPLATE = 'base_templates/base.html' # optional
APPOINTMENT_WEBSITE_NAME = 'Website'
APPOINTMENT_PAYMENT_URL = None
APPOINTMENT_THANK_YOU_URL = None
APPOINTMENT_BUFFER_TIME = 0
APPOINTMENT_SLOT_DURATION = 30
APPOINTMENT_LEAD_TIME = (9, 0)
APPOINTMENT_FINISH_TIME = (16, 30)
Email Reminder Configuration
Configure Django Q for email reminders after adding it to your INSTALLED_APPS:
Q_CLUSTER = {
'name': 'DjangORM',
'workers': 4,
'timeout': 90,
'retry': 120,
'queue_limit': 50,
'bulk': 10,
'orm': 'default',
}
Start the Django Q cluster with the command:
python manage.py qcluster