14
14
[ ![ GitHub contributors] ( https://img.shields.io/github/contributors/adamspd/django-appointment )] ( https://github.com/adamspd/django-appointment/graphs/contributors )
15
15
16
16
⚠️ ** IMPORTANT** : If upgrading from a version before 2.x.x, please note significant database changes were introduced in
17
- Version 2.0.0 introduces significant database changes . Please read
17
+ version 2.0.0. Please read
18
18
the [ migration guide] ( https://github.com/adamspd/django-appointment/tree/main/docs/migration_guides/v2_1_0.md ) before
19
19
updating. Version 3.x.x introduces the ability to send email reminders for appointments using Django Q for efficient
20
20
task scheduling. It also allows clients to reschedule appointments if it is allowed by admins.
21
21
22
22
Django-Appointment is a Django app engineered for managing appointment scheduling with ease and flexibility. It enables
23
- users to define custom configurations for time slots, lead time, and finish time, or utilize the default values
23
+ users to define custom configurations for time slots, lead time, and finish time, or use the default values
24
24
provided. This app proficiently manages conflicts and availability for appointments, ensuring a seamless user
25
25
experience.
26
26
@@ -40,7 +40,7 @@ and [here](https://github.com/adamspd/django-appointment/tree/main/docs/release_
40
40
3 . Seamless integration with the Django admin interface for appointment management.
41
41
4 . Custom admin interface for managing appointment/staff member editing, creation, availability, and conflicts.
42
42
5 . User-friendly interface for viewing available time slots and scheduling appointments.
43
- 6 . Capability to send email notifications to clients upon scheduling an appointment and email reminders for
43
+ 6 . Ability to send email notifications to clients upon scheduling an appointment and email reminders for
44
44
appointments, leveraging Django Q for task scheduling and efficiency.
45
45
46
46
## Key features introduced in previous versions.
@@ -50,13 +50,13 @@ and [here](https://github.com/adamspd/django-appointment/tree/main/docs/release_
50
50
51
51
## Added Features and Bug Fixes in version 3.x.x
52
52
53
- See the [ release notes] ( https://github.com/adamspd/django-appointment/releases/tag/v3.2.0 ) .
53
+ See the [ release notes] ( https://github.com/adamspd/django-appointment/releases/tag/v3.3.1 ) .
54
54
For older version,
55
55
see their [ release notes] ( https://github.com/adamspd/django-appointment/tree/main/docs/release_notes ) .
56
56
57
57
## Quick Start 🚀
58
58
59
- 1 . Add "appointment" to your ` INSTALLED_APPS ` setting like so:
59
+ 1 . Add "appointment" (& "django_q" if you want to enable email reminders) to your ` INSTALLED_APPS ` setting like so:
60
60
61
61
``` python
62
62
INSTALLED_APPS = [
@@ -66,7 +66,7 @@ see their [release notes](https://github.com/adamspd/django-appointment/tree/mai
66
66
]
67
67
```
68
68
69
- 2 . Incorporate the appointment URLconf in your project's ` urls.py ` like so :
69
+ 2 . Then, incorporate the appointment URLconf in your project's ` urls.py ` :
70
70
71
71
``` python
72
72
from django.urls import path, include
@@ -82,57 +82,61 @@ see their [release notes](https://github.com/adamspd/django-appointment/tree/mai
82
82
AUTH_USER_MODEL = ' models.UserModel' # Optional if you use Django's user model
83
83
```
84
84
85
- For instance, if you employ a custom user model:
85
+ For instance, if you employ a custom user model called ` UserClient ` in an app named ` client ` , you would add it like :
86
86
87
87
``` python
88
88
AUTH_USER_MODEL = ' client.UserClient'
89
89
```
90
90
91
- If you're utilizing the default Django user model, there's no need to add this line since Django automatically sets
92
- it to:
91
+ But if you're using the default Django user model (like most of us) , there's no need to add this line since Django
92
+ automatically sets it to:
93
93
94
94
``` python
95
95
AUTH_USER_MODEL = ' auth.User'
96
96
```
97
97
98
- Ensure your ` create_user ` function includes the following arguments, even if they are not all utilized:
98
+ Ensure your ` create_user ` function includes the following arguments, even if they are not all used (in case you're
99
+ using a custom user model with your own logic for creating users):
99
100
100
101
``` python
101
102
def create_user (first_name , email , username , last_name = None , ** extra_fields ):
102
103
pass
103
104
```
104
105
105
- This function will create a user with a password formatted as: f"{APPOINTMENT_WEBSITE_NAME}{current_year}"
106
+ This function will create a passwordless user.
107
+ After doing so, a link to set the password will be sent to the user's email upon completing the appointment request.
106
108
107
- For instance, if you append this to your ` settings.py ` :
109
+ Another variable that is worth configuring is the website's name in your ` settings.py ` :
108
110
109
111
``` python
110
112
APPOINTMENT_WEBSITE_NAME = ' Chocolates'
111
113
```
112
114
113
- And the current year is 2023, the password will be "Chocolates2023". If ` APPOINTMENT_WEBSITE_NAME ` is not provided,
114
- the default value is "Website", rendering the password as "Website2023".
115
-
116
- This name is also utilized in the footer of the emails sent to clients upon scheduling an appointment:
115
+ It will be used in the footer of the emails sent to clients upon scheduling an appointment:
117
116
118
117
``` html
119
118
<p >® 2023 {{ APPOINTMENT_WEBSITE_NAME }}. All Rights Reserved.</p >
120
119
```
121
120
122
- Configure ` Q_CLUSTER ` in your Django's ` settings.py ` to enable Django Q task scheduling:
121
+ To be able to send email reminders after adding ` django_q ` to your ` INSTALLED_APPS ` , you must add this variable
122
+ ` Q_CLUSTER ` in your Django's ` settings.py ` . If done, and users check the box to receive reminders, you and them
123
+ will receive an email reminder 24 hours before the appointment.
124
+
125
+ Here's a configuration example, that you can use without modification (if you don't want to do much research):
126
+
123
127
``` python
124
- Q_CLUSTER = {
125
- ' name' : ' DjangORM' ,
126
- ' workers' : 4 ,
127
- ' timeout' : 90 ,
128
- ' retry' : 120 ,
129
- ' queue_limit' : 50 ,
130
- ' bulk' : 10 ,
131
- ' orm' : ' default' ,
132
- }
133
- ```
128
+ Q_CLUSTER = {
129
+ ' name' : ' DjangORM' ,
130
+ ' workers' : 4 ,
131
+ ' timeout' : 90 ,
132
+ ' retry' : 120 ,
133
+ ' queue_limit' : 50 ,
134
+ ' bulk' : 10 ,
135
+ ' orm' : ' default' ,
136
+ }
137
+ ```
134
138
135
- 4 . Run `python manage.py migrate` to create the appointment models.
139
+ 4 . Next would be to run ` python manage.py migrate ` to create the appointment models.
136
140
137
141
5 . Start the Django Q cluster with ` python manage.py qcluster ` .
138
142
@@ -146,35 +150,37 @@ see their [release notes](https://github.com/adamspd/django-appointment/tree/mai
146
150
147
151
## Docker Support 🐳
148
152
149
- Django- Appointment now supports Docker, making it easier to set up, develop, and deploy. With Docker and Docker Compose,
150
- you can quickly get the project running in a consistent environment, streamline the development process, and simplify
151
- deployment across different platforms.
153
+ Django-Appointment now supports Docker, making it easier to set up, develop, and test.
152
154
153
155
### Getting Started with Docker for Development or Local Testing
154
156
155
- Using Django- Appointment with Docker is primarily intended for development purposes or local testing. This means you ' ll
156
- need to clone the project from the GitHub repository to get started.
157
+ Using Django-Appointment with Docker is primarily intended for ** development purposes** or ** local testing** .
158
+ This means you'll need to ___ clone the project from the GitHub repository ___ to get started.
157
159
158
- Here' s how you can set up Django-Appointment for local development or testing with Docker :
160
+ Here's how you can set it up :
159
161
160
162
1 . ** Clone the Repository** : Clone the Django-Appointment repository to your local machine:
161
163
162
164
``` bash
163
165
git clone https://github.com/adamspd/django-appointment.git
164
166
```
165
-
167
+
166
168
or using SSH:
167
169
``` bash
168
170
git clone
[email protected] :adamspd/django-appointment.git
169
171
```
170
172
171
- 2 . ** Prepare .env File** : Create an `.env` file in the root directory of your project with your configuration settings.
172
- You should include your email host user and password for Django' s email functionality:
173
+ 2 . ** Prepare an .env File** : Create an ` .env ` file in the root directory of your project with your configuration
174
+ settings.
175
+ You should include your email host user and password for Django's email functionality (if you want it to work):
173
176
174
177
``` plaintext
175
178
176
179
EMAIL_HOST_PASSWORD=your_password
177
180
```
181
+
182
+ > ** Note:** The ` .env ` file is used to store sensitive information and should not be committed to version control.
183
+
178
184
3 . ** Build and Run the Docker Containers** : Run the following command to build and run the Docker containers:
179
185
180
186
``` bash
@@ -201,9 +207,9 @@ Here's how you can set up Django-Appointment for local development or testing wi
201
207
docker-compose exec web python manage.py migrate
202
208
```
203
209
204
- > ** Note:** I use the default database settings for the Docker container. If you want to use a different database, you
205
- > can
206
- > modify the Dockerfile and docker - compose.yml files to use your preferred database.
210
+ > **Note:** I used the default database settings for the Docker container.
211
+ > If you want to use a different database, you can modify the Dockerfile and docker-compose.yml files to use your
212
+ > preferred database.
207
213
208
214
## Customization 🔧
209
215
0 commit comments