Git Product home page Git Product logo

django-appointment's Introduction

Django Appointment ๐Ÿ“ฆ

Tests Published on PyPi Current Release Version pypi Version PyPi downloads codecov License GitHub commit activity GitHub last commit GitHub issues GitHub pull requests GitHub contributors

โš ๏ธ IMPORTANT: If upgrading from a version before 2.x.x, please note significant database changes were introduced in version 2.0.0. Please read the migration guide before updating. Version 3.x.x introduces the ability to send email reminders for appointments using Django Q for efficient task scheduling. It also allows clients to reschedule appointments if it is allowed by admins.

Django-Appointment is a Django app engineered for managing appointment scheduling with ease and flexibility. It enables users to define custom configurations for time slots, lead time, and finish time, or use the default values provided. This app proficiently manages conflicts and availability for appointments, ensuring a seamless user experience.

For a detailed walkthrough and live example of the system, please refer to this tutorial.

Detailed documentation can be found in the docs' directory. For changes and migration information, please refer to the release notes here and here.

Features โœจ

  1. Customizable time slots, lead time, and finish time.
  2. Competent handling of appointment conflicts and availability.
  3. Seamless integration with the Django admin interface for appointment management.
  4. Custom admin interface for managing appointment/staff member editing, creation, availability, and conflicts.
  5. User-friendly interface for viewing available time slots and scheduling appointments.
  6. Ability to send email notifications to clients upon scheduling an appointment and email reminders for appointments, leveraging Django Q for task scheduling and efficiency.

Key features introduced in previous versions.

Added Features and Bug Fixes in version 3.x.x

See the release notes. For older version, see their release notes.

Quick Start ๐Ÿš€

  1. Add "appointment" (& "django_q" if you want to enable email reminders) to your INSTALLED_APPS setting like so:

    INSTALLED_APPS = [
        # other apps
        'appointment',
        'django_q',
    ]
  2. 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')),
    ]
  3. In your Django's settings.py, append the following:

    AUTH_USER_MODEL = 'models.UserModel'  # Optional if you use Django's user model

    For instance, if you employ a custom user model called UserClient in an app named client, you would add it like:

    AUTH_USER_MODEL = 'client.UserClient'

    But if you're using the default Django user model (like most of us), there's no need to add this line since Django automatically sets it to:

    AUTH_USER_MODEL = 'auth.User'

    Ensure your create_user function includes the following arguments, even if they are not all used (in case you're using a custom user model with your own logic for creating users):

    def create_user(first_name, email, username, last_name=None, **extra_fields):
        pass

    This function will create a passwordless user. After doing so, a link to set the password will be sent to the user's email upon completing the appointment request.

    Another variable that is worth configuring is the website's name in your settings.py:

    APPOINTMENT_WEBSITE_NAME = 'Chocolates'

    It will be used in the footer of the emails sent to clients upon scheduling an appointment:

    <p>ยฎ 2023 {{ APPOINTMENT_WEBSITE_NAME }}. All Rights Reserved.</p>

    To be able to send email reminders after adding django_q to your INSTALLED_APPS, you must add this variable Q_CLUSTER in your Django's settings.py. If done, and users check the box to receive reminders, you and them will receive an email reminder 24 hours before the appointment.

    Here's a configuration example, that you can use without modification (if you don't want to do much research):

    Q_CLUSTER = {
       'name': 'DjangORM',
       'workers': 4,
       'timeout': 90,
       'retry': 120,
       'queue_limit': 50,
       'bulk': 10,
       'orm': 'default',
    }
  4. Next would be to run python manage.py migrate to create the appointment models.

  5. Start the Django Q cluster with python manage.py qcluster.

  6. 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).

  7. 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.

  8. Visit http://127.0.0.1:8000/appointment/request/<service_id>/ to view the available time slots and schedule an appointment.

Docker Support ๐Ÿณ

Django-Appointment now supports Docker, making it easier to set up, develop, and test.

Getting Started with Docker for Development or Local Testing

Using Django-Appointment with Docker is primarily intended for development purposes or local testing. This means you'll need to clone the project from the GitHub repository to get started.

Here's how you can set it up:

  1. Clone the Repository: Clone the Django-Appointment repository to your local machine:

    git clone https://github.com/adamspd/django-appointment.git

    or using SSH:

    git clone [email protected]:adamspd/django-appointment.git

    then go to the project's directory:

    cd django-appointment
  2. Prepare an .env File: Create an .env file in the root directory of your project with your configuration settings. You should include your email host user and password for Django's email functionality (if you want it to work):

    [email protected]
    EMAIL_HOST_PASSWORD=your_password
    

    Note: The .env file is used to store sensitive information and should not be committed to version control.

  3. Build and Run the Docker Containers: Run the following command to build and run the Docker containers:

    docker-compose up -d --build

    or

    docker compose up -d --build
  4. Make Migrations and Run: Create the migrations with the following command:

    docker-compose exec web python manage.py makemigrations appointment

    or

    docker compose exec web python manage.py makemigrations appointment

    Then, apply the migrations with the following command:

    docker-compose exec web python manage.py migrate

    or

    docker compose exec web python manage.py migrate
  5. Create a Superuser: After the containers are running, create a superuser to access the Django admin interface:

     docker-compose exec web python manage.py createsuperuser

    or

     docker compose exec web python manage.py createsuperuser
  6. Access the Application: Once the containers are running, you can access the application at localhost:8000. The Django admin interface is available at localhost:8000/admin. And from there, add the necessary configurations. Follow this documentation.

  7. Shut Down the Containers: When you're finished, you can shut down the containers with the following command:

    docker-compose down
    # docker compose down

    Note: I used the default database settings for the Docker container. If you want to use a different database, you can modify the Dockerfile and docker-compose.yml files to use your preferred database.

Customization ๐Ÿ”ง

  1. In your Django project's settings.py, you can override the default values for the appointment scheduler. More information regarding available configurations can be found in the documentation.
  2. Modify these values as needed for your application, and the app will adapt to the new settings.
  3. For further customization, you can extend the provided models, views, and templates or create your own.

Support ๐Ÿ’ฌ

For support or inquiries regarding the Appointment Scheduler app, please refer to the documentation in the "docs" directory or visit the GitHub repository for more information.

Contributing ๐Ÿค

Contributions are welcome! Please refer to the contributing guidelines for more information.

Code of Conduct ๐Ÿ“œ

Please refer to the code of conduct for more information.

Security policy ๐Ÿ”’

Please refer to the security policy for more information.

Notes ๐Ÿ“โš ๏ธ

I'm working on a testing website for the application that is not fully functional yet, no hard feelings. But you can check it out at https://django-appt.adamspierredavid.com/. Ideas are welcome here since I'm blocked on a few points.

About the Author

Adams Pierre David - Website

django-appointment's People

Contributors

adamspd avatar dependabot[bot] avatar nilbot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.