@@ -17,60 +17,60 @@ Detailed documentation is in the ["docs"](docs/README.md) directory.
17
17
18
18
1 . Add "appointment" to your INSTALLED_APPS setting like this:
19
19
20
- ``` python
21
- INSTALLED_APPS = [
22
- ...
23
- ' appointment' ,
24
- ]
25
- ```
20
+ ``` python
21
+ INSTALLED_APPS = [
22
+ # other apps
23
+ ' appointment' ,
24
+ ]
25
+ ```
26
26
27
27
2 . Include the appointment URLconf in your project urls.py like this:
28
28
29
- ``` python
30
- from django.urls import path, include
31
-
32
- urlpatterns = [
33
- ...
34
- path(' appointment/' , include(' appointment.urls' )),
35
- ]
36
- ```
29
+ ``` python
30
+ from django.urls import path, include
31
+
32
+ urlpatterns = [
33
+ # other urls
34
+ path(' appointment/' , include(' appointment.urls' )),
35
+ ]
36
+ ```
37
37
38
38
3 . In your Django's settings.py, add the following:
39
39
40
- ``` python
41
- APPOINTMENT_CLIENT_MODEL = file .UserModel # Not optional (e.g. auth.User, or client.UserClient)
42
- ```
40
+ ``` python
41
+ APPOINTMENT_CLIENT_MODEL = models .UserModel # Not optional (e.g. auth.User, or client.UserClient)
42
+ ```
43
43
44
- for example if you use the default Django user model:
44
+ For example, if you use the default Django user model:
45
45
46
- ``` python
47
- APPOINTMENT_CLIENT_MODEL = auth.User
48
- ```
46
+ ``` python
47
+ APPOINTMENT_CLIENT_MODEL = auth.User
48
+ ```
49
49
50
- or if you use a custom user model:
50
+ Or, if you use a custom user model:
51
51
52
- ``` python
53
- APPOINTMENT_CLIENT_MODEL = client.UserClient
54
- ```
52
+ ``` python
53
+ APPOINTMENT_CLIENT_MODEL = client.UserClient
54
+ ```
55
55
56
- Now if you have a custom user model, in your function create_user, you have to have the following arguments even if you
57
- don't use all of them:
56
+ If you have a custom user model, make sure your create_user function includes the following arguments, even if you
57
+ don't use all of them:
58
58
59
- ``` python
60
- def create_user (first_name , email , username , ** extra_fields ):
61
- pass
62
- ```
59
+ ``` python
60
+ def create_user (first_name , email , username , ** extra_fields ):
61
+ pass
62
+ ```
63
63
64
- This will create a user with the password = f"{APPOINTMENT_WEBSITE_NAME}{current_year}"
64
+ This will create a user with a password in the format: f"{APPOINTMENT_WEBSITE_NAME}{current_year}"
65
65
66
- For example if you put in your settings.py:
66
+ For example, if you add this to your settings.py:
67
67
68
- ``` python
69
- APPOINTMENT_WEBSITE_NAME = ' Chocolates'
70
- ```
68
+ ``` python
69
+ APPOINTMENT_WEBSITE_NAME = ' Chocolates'
70
+ ```
71
71
72
- and the current year is 2023, the password will be "Chocolates2023" if you don't provide an APPOINTMENT_WEBSITE_NAME,
73
- the default value is "Website", so the password will be "Website2023".
72
+ And the current year is 2023, the password will be "Chocolates2023". If you don't provide an
73
+ APPOINTMENT_WEBSITE_NAME, the default value is "Website", so the password will be "Website2023".
74
74
75
75
4 . Run ` python manage.py migrate ` to create the appointment models.
76
76
@@ -90,18 +90,18 @@ the default value is "Website", so the password will be "Website2023".
90
90
91
91
1 . In your Django project's settings.py, you can override the default values for the appointment scheduler:
92
92
93
- ``` python
94
- # Default values
95
- APPOINTMENT_SLOT_DURATION = 30 # minutes
96
- APPOINTMENT_LEAD_TIME = (9 , 0 ) # (hour, minute) 24-hour format
97
- APPOINTMENT_FINISH_TIME = (16 , 30 ) # (hour, minute) 24-hour format
98
-
99
- # Additional configuration options
100
- APPOINTMENT_BASE_TEMPLATE = ' base_templates/base.html' # your base template
101
- APPOINTMENT_WEBSITE_NAME = ' Website'
102
- APPOINTMENT_PAYMENT_URL = None
103
- APPOINTMENT_THANK_YOU_URL = None
104
- ```
93
+ ``` python
94
+ # Default values
95
+ APPOINTMENT_SLOT_DURATION = 30 # minutes
96
+ APPOINTMENT_LEAD_TIME = (9 , 0 ) # (hour, minute) 24-hour format
97
+ APPOINTMENT_FINISH_TIME = (16 , 30 ) # (hour, minute) 24-hour format
98
+
99
+ # Additional configuration options
100
+ APPOINTMENT_BASE_TEMPLATE = ' base_templates/base.html' # your base template
101
+ APPOINTMENT_WEBSITE_NAME = ' Website'
102
+ APPOINTMENT_PAYMENT_URL = None # example of pattern 'payment:payment_linked
103
+ APPOINTMENT_THANK_YOU_URL = None # example of pattern 'payment:thank_you'
104
+ ```
105
105
106
106
2 . Modify these values as needed for your application, and the scheduler will adapt to the new settings.
107
107
0 commit comments