Quick Start 🚀
Install Django-Appointment in your project using pip:
pip install django-appointment
Optional:
pip install django_q2
Django Q is not necessary for the package to work, but it is used to sends email reminder. If you do not install Django Q, you will not be able to send email reminders when clients check the box to receive them.
Configuration
Add 'appointment' and 'django_q' to your INSTALLED_APPS setting like so:
INSTALLED_APPS = [ # other apps 'appointment', 'django_q', ]
Then, incorporate the appointment URLconf in your project's urls.py:
from django.urls import path, include urlpatterns = [ # other urls path('appointment/', include('appointment.urls')), ]
Add this variable Q_CLUSTER in your Django's settings.py (needed only if you want Django Q).
Q_CLUSTER = { 'name': 'DjangORM', 'workers': 4, 'timeout': 90, 'retry': 120, 'queue_limit': 50, 'bulk': 10, 'orm': 'default', }
Next steps to activate your setup:
- Create the migrations and run them by doing
python manage.py makemigrations appointment
and right after, runpython manage.py migrate
to create the appointment models. -
Start the Django Q cluster with
python manage.py qcluster
- Launch the development server and navigate to http://127.0.0.1:8000/admin/ to create appointments, manage configurations, and handle appointment conflicts (the admin app must be enabled).
- You must create at least one service before using the application on the admin page. If your service is free, input 0 as the price. If your service is paid, input the price in the price field. You may also provide a description for your service.
-
To request an appointment, navigate to http://127.0.0.1:8000/appointment/request/<service_id>/ where
service_id
is the ID of the service you want to request, most likely to be 1 if you have only one service.