Closed sati-bodhi closed 4 months ago
Hi @sati-bodhi,
Thank you for bringing this to my attention and for trying out the package. I realize now that the documentation might not have been clear on how to access the main site of the package within your project. My apologies for any confusion this has caused.
The behaviour you're experiencing is actually by design, though it might not have been immediately obvious. The root URL (127.0.0.1:8000/
) is intentionally reserved for your project's own use. To access the features of the package, you should use the /appointment/
prefix in the URL (only when using it when installed in a project via pip install
command), as per the error message you encountered.
For example, to start exploring the package's capabilities, you can navigate to http://127.0.0.1:8000/appointment/...
after integrating it into your Django project.
Here are some specific URLs you can try to access various features (Note: If your project is set up with internationalization, you might need to add the language prefix, like en/
, to the URLs). Note once again that you have to add appointment/
after the /en
if you have installed the package on a project, but if you're trying it as is, use the URLs below:
http://127.0.0.1:8000/en/app-admin/appointments
http://127.0.0.1:8000/en/request/1/
where 1
is the ID of the service you're booking.http://127.0.0.1:8000/en/app-admin/user-profile/
http://127.0.0.1:8000/en/app-admin/add-day-off/1/
http://127.0.0.1:8000/en/app-admin/add-working-hours/1/
http://127.0.0.1:8000/en/app-admin/appointments/
The comprehensive list of accessible URLs and their functions can be found in our documentation here.
Additionally, I've created a brief video tutorial (without audio) to demonstrate how to access and utilize these features effectively. You can watch it here.
I hope this clears up any confusion and helps you make the most out of our package. If you have any further questions or need additional assistance, please don't hesitate to ask.
Best regards,
Adams
See how I used the package in this project: https://github.com/adamspd/crueltouch
Live site where I listed the service a client can make an appointment for: https://tchiiz.com/services/
To view all appointments (as an admin, post-login to Django admin):
http://127.0.0.1:8000/en/app-admin/appointments
To create an appointment (as a client, ensure services and staff availability are set up):
http://127.0.0.1:8000/en/request/1/
where1
is the ID of the service you're booking.To view a staff member's profile:
http://127.0.0.1:8000/en/app-admin/user-profile/
To schedule days-off for a staff member:
http://127.0.0.1:8000/en/app-admin/add-day-off/1/
To set working hours for a staff member:
http://127.0.0.1:8000/en/app-admin/add-working-hours/1/
To view a staff member's appointments in a calendar view:
http://127.0.0.1:8000/en/app-admin/appointments/
Neither of these URLs worked for me.
Can you advise how to integrate the App into an existing project? Git clone in the existing project folder is going to nest the App project folder within another project (which is probably not how django apps work.)
Hi @sati-bodhi,
I understand there's been some confusion regarding accessing the URLs after integrating the django-appointment package into your project. Let's clarify how Django's URL dispatcher works in conjunction with the package, so you can smoothly navigate through it.
When you incorporate django-appointment into your Django project, you decide how to route the URLs defined by the package within your application. This is determined by how you include the package's URLs in your project's urls.py
file. Here’s how it works:
If your urls.py
includes the line (as you said you added in your issue):
path("appointment/", include("appointment.urls")),
you're specifying that every URL from the django-appointment should be accessed by prefixing it with appointment/
. It's a way to namespace the package URLs within your project. This means, for every URL provided by django-appointment, you need to prepend appointment/
to it when accessing it.
For example, if you had set it up like this:
path("custom-link/", include("appointment.urls")),
then, you'd access the package's URLs by prefixing them with custom-link/
instead.
Given your current setup, here’s how you should modify the URLs I previously mentioned:
http://127.0.0.1:8000/en/appointment/app-admin/appointments
.http://127.0.0.1:8000/en/appointment/request/1/
where 1
is the service ID you wish to book.http://127.0.0.1:8000/en/appointment/app-admin/user-profile/
.http://127.0.0.1:8000/en/appointment/app-admin/add-day-off/1/
, where 1
is the staff member's ID.http://127.0.0.1:8000/en/appointment/app-admin/add-working-hours/1/
with the appropriate staff member's ID.Remember, the en/
prefix is used here to indicate the use of internationalization in your project. If your project does not use internationalization, or if you are accessing URLs in a different language, adjust accordingly.
In my earlier communication, I provided URLs without the appointment/
prefix, assuming you were directly experimenting with the repository rather than integrating the package into your project. This assumption led me to overlook the necessity of including the appointment/
prefix, which is essential when the package is installed and used within a Django project environment. This oversight was due to the fact that, in direct repository testing scenarios, namespace considerations like appending appointment/
or any custom namespace you choose (i.e custom-link/
as explain above) to URLs are not applicable. My apologies for any confusion this may have caused.
One more important point: for customization, please read this documentation, it may help in setting up the project.
I trust this explanation clarifies the URL structure for accessing the django-appointment package's features within your project. Should you have further questions or need additional guidance, please don't hesitate to reach out. Conversely, if this comment addresses your issue, I'd appreciate it if you could confirm its resolution in a comment and close the issue when convenient. Furthermore, if you find value in the project, consider starring it on GitHub—your support would be greatly appreciated.
Best regards,
Adams
Hi @sati-bodhi, is this issue still needed ? Thanks in advance for closing it if not needed anymore.
Describe the bug I run into a 404 error when running the server for the first time.
To Reproduce Steps to reproduce the behavior:
python manage.py runserver
Expected behavior Base url brings us to a landing page for making appointments.
Screenshots If applicable, add screenshots to help explain your problem.![image](https://github.com/adamspd/django-appointment/assets/7592695/f9186b11-57b2-4cef-b2dc-d33a81bee9d3)
Desktop (please complete the following information):
Additional context Add any other context about the problem here.
settings.py
urls.py
Can you fix the bug?