├── doctor ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-39.pyc │ │ ├── 0003_review.cpython-39.pyc │ │ ├── 0001_initial.cpython-39.pyc │ │ └── 0002_remove_doctor_available_time_doctor_available_time.cpython-39.pyc │ ├── 0002_remove_doctor_available_time_doctor_available_time.py │ ├── 0003_review.py │ └── 0001_initial.py ├── tests.py ├── images │ ├── 2.jpg │ └── 3.webp ├── __pycache__ │ ├── admin.cpython-39.pyc │ ├── apps.cpython-39.pyc │ ├── urls.cpython-39.pyc │ ├── views.cpython-39.pyc │ ├── models.cpython-39.pyc │ ├── __init__.cpython-39.pyc │ └── serializers.cpython-39.pyc ├── apps.py ├── admin.py ├── urls.py ├── serializers.py ├── models.py └── views.py ├── appointment ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-39.pyc │ │ ├── 0001_initial.cpython-39.pyc │ │ └── 0002_alter_appointment_time.cpython-39.pyc │ ├── 0002_alter_appointment_time.py │ └── 0001_initial.py ├── tests.py ├── __pycache__ │ ├── admin.cpython-39.pyc │ ├── apps.cpython-39.pyc │ ├── urls.cpython-39.pyc │ ├── views.cpython-39.pyc │ ├── models.cpython-39.pyc │ ├── __init__.cpython-39.pyc │ └── serializers.cpython-39.pyc ├── apps.py ├── urls.py ├── serializers.py ├── templates │ └── admin_email.html ├── views.py ├── models.py └── admin.py ├── contact_us ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-39.pyc │ │ ├── 0001_initial.cpython-39.pyc │ │ └── 0002_alter_contactus_options.cpython-39.pyc │ ├── 0002_alter_contactus_options.py │ └── 0001_initial.py ├── tests.py ├── __pycache__ │ ├── admin.cpython-39.pyc │ ├── apps.cpython-39.pyc │ ├── models.cpython-39.pyc │ ├── urls.cpython-39.pyc │ ├── views.cpython-39.pyc │ ├── __init__.cpython-39.pyc │ └── serializers.cpython-39.pyc ├── apps.py ├── admin.py ├── serializers.py ├── urls.py ├── views.py └── models.py ├── patient ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-39.pyc │ │ ├── 0001_initial.cpython-39.pyc │ │ └── 0002_alter_patient_user.cpython-39.pyc │ ├── 0002_alter_patient_user.py │ └── 0001_initial.py ├── tests.py ├── images │ ├── 1.jpg │ └── 2.jpg ├── __pycache__ │ ├── apps.cpython-39.pyc │ ├── urls.cpython-39.pyc │ ├── admin.cpython-39.pyc │ ├── models.cpython-39.pyc │ ├── views.cpython-39.pyc │ ├── __init__.cpython-39.pyc │ └── serializers.cpython-39.pyc ├── apps.py ├── templates │ └── confirm_email.html ├── models.py ├── admin.py ├── urls.py ├── serializers.py └── views.py ├── service ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-39.pyc │ │ └── 0001_initial.cpython-39.pyc │ └── 0001_initial.py ├── tests.py ├── images │ └── xray.jpg ├── __pycache__ │ ├── apps.cpython-39.pyc │ ├── urls.cpython-39.pyc │ ├── admin.cpython-39.pyc │ ├── models.cpython-39.pyc │ ├── views.cpython-39.pyc │ ├── __init__.cpython-39.pyc │ └── serializers.cpython-39.pyc ├── admin.py ├── apps.py ├── serializers.py ├── models.py ├── urls.py └── views.py ├── smart_care ├── __init__.py ├── __pycache__ │ ├── urls.cpython-39.pyc │ ├── views.cpython-39.pyc │ ├── wsgi.cpython-39.pyc │ ├── __init__.cpython-39.pyc │ ├── settings.cpython-39.pyc │ ├── __init__.cpython-310.pyc │ ├── serializers.cpython-39.pyc │ └── settings.cpython-310.pyc ├── serializers.py ├── views.py ├── asgi.py ├── wsgi.py ├── urls.py └── settings.py ├── .gitignore ├── db.sqlite3 ├── README.md ├── manage.py ├── LICENCE └── requirements.txt /doctor/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /appointment/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contact_us/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /patient/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /service/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /smart_care/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contact_us/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doctor/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /patient/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /service/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | smart_care/.env 2 | 3 | # -------------------------------------------------------------------------------- /appointment/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doctor/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /service/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/db.sqlite3 -------------------------------------------------------------------------------- /patient/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | # test 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /contact_us/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | # Test Case 3 | 4 | # Create your tests here. 5 | -------------------------------------------------------------------------------- /appointment/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | 5 | # test Case 6 | -------------------------------------------------------------------------------- /doctor/images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/images/2.jpg -------------------------------------------------------------------------------- /doctor/images/3.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/images/3.webp -------------------------------------------------------------------------------- /patient/images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/images/1.jpg -------------------------------------------------------------------------------- /patient/images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/images/2.jpg -------------------------------------------------------------------------------- /service/images/xray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/service/images/xray.jpg -------------------------------------------------------------------------------- /doctor/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /doctor/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /doctor/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /doctor/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /patient/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /patient/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /service/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/service/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /service/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/service/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /doctor/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /patient/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /patient/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /patient/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /service/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/service/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /service/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/service/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /service/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/service/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /appointment/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/appointment/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /appointment/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/appointment/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /appointment/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/appointment/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /appointment/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/appointment/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/contact_us/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/contact_us/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/contact_us/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/contact_us/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/contact_us/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /doctor/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /patient/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /service/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/service/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /smart_care/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/smart_care/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /smart_care/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/smart_care/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /smart_care/__pycache__/wsgi.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/smart_care/__pycache__/wsgi.cpython-39.pyc -------------------------------------------------------------------------------- /appointment/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/appointment/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/contact_us/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /doctor/__pycache__/serializers.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/__pycache__/serializers.cpython-39.pyc -------------------------------------------------------------------------------- /patient/__pycache__/serializers.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/__pycache__/serializers.cpython-39.pyc -------------------------------------------------------------------------------- /service/__pycache__/serializers.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/service/__pycache__/serializers.cpython-39.pyc -------------------------------------------------------------------------------- /smart_care/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/smart_care/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /smart_care/__pycache__/settings.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/smart_care/__pycache__/settings.cpython-39.pyc -------------------------------------------------------------------------------- /appointment/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/appointment/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/__pycache__/serializers.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/contact_us/__pycache__/serializers.cpython-39.pyc -------------------------------------------------------------------------------- /smart_care/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/smart_care/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /smart_care/__pycache__/serializers.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/smart_care/__pycache__/serializers.cpython-39.pyc -------------------------------------------------------------------------------- /smart_care/__pycache__/settings.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/smart_care/__pycache__/settings.cpython-310.pyc -------------------------------------------------------------------------------- /appointment/__pycache__/serializers.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/appointment/__pycache__/serializers.cpython-39.pyc -------------------------------------------------------------------------------- /doctor/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DoctorConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'doctor' 7 | -------------------------------------------------------------------------------- /doctor/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /patient/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /service/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/service/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /doctor/migrations/__pycache__/0003_review.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/migrations/__pycache__/0003_review.cpython-39.pyc -------------------------------------------------------------------------------- /service/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Service 3 | # Register your models here. 4 | 5 | admin.site.register(Service) 6 | 7 | # Admin Register Modal -------------------------------------------------------------------------------- /appointment/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/appointment/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/contact_us/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /doctor/migrations/__pycache__/0001_initial.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/migrations/__pycache__/0001_initial.cpython-39.pyc -------------------------------------------------------------------------------- /patient/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | # admin 3 | 4 | class PatientConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'patient' 7 | -------------------------------------------------------------------------------- /patient/migrations/__pycache__/0001_initial.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/migrations/__pycache__/0001_initial.cpython-39.pyc -------------------------------------------------------------------------------- /service/migrations/__pycache__/0001_initial.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/service/migrations/__pycache__/0001_initial.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/migrations/__pycache__/0001_initial.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/contact_us/migrations/__pycache__/0001_initial.cpython-39.pyc -------------------------------------------------------------------------------- /appointment/migrations/__pycache__/0001_initial.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/appointment/migrations/__pycache__/0001_initial.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | # Apps py 4 | class ContactUsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'contact_us' 7 | -------------------------------------------------------------------------------- /patient/migrations/__pycache__/0002_alter_patient_user.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/patient/migrations/__pycache__/0002_alter_patient_user.cpython-39.pyc -------------------------------------------------------------------------------- /appointment/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | # apps config Appionment 4 | class AppointmentConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'appointment' 7 | -------------------------------------------------------------------------------- /appointment/migrations/__pycache__/0002_alter_appointment_time.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/appointment/migrations/__pycache__/0002_alter_appointment_time.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/migrations/__pycache__/0002_alter_contactus_options.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/contact_us/migrations/__pycache__/0002_alter_contactus_options.cpython-39.pyc -------------------------------------------------------------------------------- /service/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | # Django Models Big Auto Field 3 | # apps py 4 | class ServiceConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'service' 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hazrat Ali 2 | 3 | # Sofaware Engineer 4 | 5 | # Smart Care 6 | 7 | This is a hospital management system API made with django rest framework where a patient can register, login, take appointment, register through email validation. 8 | 9 | 10 | -------------------------------------------------------------------------------- /service/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from . import models 3 | 4 | class ServiceSerializer(serializers.ModelSerializer): 5 | class Meta: 6 | model = models.Service 7 | fields = '__all__' 8 | # Service Serializers -------------------------------------------------------------------------------- /doctor/migrations/__pycache__/0002_remove_doctor_available_time_doctor_available_time.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hazrat-Ali9/Hospital-Management-Backend/HEAD/doctor/migrations/__pycache__/0002_remove_doctor_available_time_doctor_available_time.cpython-39.pyc -------------------------------------------------------------------------------- /contact_us/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ContactUs 3 | # Register your models here. 4 | 5 | 6 | class ContactModelAdmin(admin.ModelAdmin): 7 | list_display = ['name', 'phone', 'problem'] 8 | admin.site.register(ContactUs, ContactModelAdmin) -------------------------------------------------------------------------------- /contact_us/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from . import models 3 | 4 | class ContactUsSerializer(serializers.ModelSerializer): 5 | class Meta: 6 | model = models.ContactUs 7 | fields = '__all__' 8 | 9 | # Serilizer -------------------------------------------------------------------------------- /service/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | # charfield Modal 3 | # Create your models here. 4 | class Service(models.Model): 5 | name = models.CharField(max_length = 20) 6 | description = models.TextField() 7 | image = models.ImageField(upload_to="service/images/") -------------------------------------------------------------------------------- /patient/templates/confirm_email.html: -------------------------------------------------------------------------------- 1 |
2 |

Thanks for creating an account on our platform.

3 |

click the below link to verify your account

4 | 5 |

6 | Confirmation Link : {{confirm_link}} 7 |

8 |
-------------------------------------------------------------------------------- /service/urls.py: -------------------------------------------------------------------------------- 1 | from rest_framework.routers import DefaultRouter 2 | from django.urls import path, include 3 | from . import views 4 | router = DefaultRouter() # amader router 5 | 6 | router.register('', views.ServiceViewset) # router er antena 7 | urlpatterns = [ 8 | path('', include(router.urls)), 9 | ] -------------------------------------------------------------------------------- /smart_care/serializers.py: -------------------------------------------------------------------------------- 1 | 2 | from rest_framework import serializers 3 | from django.contrib.auth.models import User 4 | 5 | class UserSerializer(serializers.ModelSerializer): 6 | class Meta: 7 | model = User 8 | fields = ['id','username','first_name', 'last_name', 'email', 'is_superuser'] -------------------------------------------------------------------------------- /service/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from rest_framework import viewsets 3 | from . import models 4 | from . import serializers 5 | # Service View 6 | class ServiceViewset(viewsets.ModelViewSet): 7 | queryset = models.Service.objects.all() 8 | serializer_class = serializers.ServiceSerializer -------------------------------------------------------------------------------- /smart_care/views.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.models import User 2 | 3 | from rest_framework import viewsets 4 | from . import serializers 5 | 6 | class UserViewSet(viewsets.ModelViewSet): 7 | queryset = User.objects.all() 8 | serializer_class = serializers.UserSerializer 9 | # Smart Care 10 | -------------------------------------------------------------------------------- /contact_us/urls.py: -------------------------------------------------------------------------------- 1 | from rest_framework.routers import DefaultRouter 2 | from django.urls import path, include 3 | from . import views 4 | router = DefaultRouter() # amader router 5 | 6 | router.register('', views.ContactusViewset) # router er antena 7 | urlpatterns = [ 8 | path('', include(router.urls)), 9 | ] 10 | 11 | # Urls -------------------------------------------------------------------------------- /appointment/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import include, path 2 | from rest_framework import routers 3 | from . import views 4 | 5 | router = routers.DefaultRouter() # wifi toiri korlam 6 | router.register('', views.AppointmentViewSet) # ekta entena toiri korlam 7 | 8 | urlpatterns = [ 9 | path('', include(router.urls)), 10 | ] 11 | 12 | # Urls Py Django 13 | 14 | -------------------------------------------------------------------------------- /contact_us/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from rest_framework import viewsets 3 | # Create your views here. 4 | from . import models 5 | from . import serializers 6 | 7 | class ContactusViewset(viewsets.ModelViewSet): 8 | queryset = models.ContactUs.objects.all() 9 | serializer_class = serializers.ContactUsSerializer 10 | 11 | # Contact View Set -------------------------------------------------------------------------------- /contact_us/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | class ContactUs(models.Model): 5 | name = models.CharField(max_length = 30) 6 | phone = models.CharField(max_length = 12) 7 | problem = models.TextField() 8 | 9 | def __str__(self): 10 | return self.name 11 | class Meta: 12 | verbose_name_plural = "Contact Us" 13 | 14 | # modals -------------------------------------------------------------------------------- /appointment/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from . import models 3 | # Appoinment Serializer 4 | class AppointmentSerializer(serializers.ModelSerializer): 5 | time = serializers.StringRelatedField(many=False) 6 | patient = serializers.StringRelatedField(many=False) 7 | doctor = serializers.StringRelatedField(many=False) 8 | class Meta: 9 | model = models.Appointment 10 | fields = '__all__' 11 | -------------------------------------------------------------------------------- /patient/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | # models 4 | # Create your models here. 5 | class Patient(models.Model): 6 | user = models.OneToOneField(User, on_delete = models.CASCADE) 7 | image = models.ImageField(upload_to='patient/images/') 8 | mobile_no = models.CharField(max_length = 12) 9 | 10 | def __str__(self): 11 | return f"{self.user.first_name} {self.user.last_name}" -------------------------------------------------------------------------------- /appointment/templates/admin_email.html: -------------------------------------------------------------------------------- 1 |
2 |

Hello {{user.first_name}} {{user.last_name}}

3 |

Hope you are doing well. You requested for an online appointment with {{doctor.user.first_name}} {{doctor.user.last_name}}

4 |

Your doctor is available to meet with you. Join the below link as soon as possible

5 |

Meet link : {{doctor.meet_link}}

6 |

Thanks

7 |

SmartCare

8 |
-------------------------------------------------------------------------------- /contact_us/migrations/0002_alter_contactus_options.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.2.4 on 2023-12-26 16:12 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('contact_us', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterModelOptions( 14 | name='contactus', 15 | options={'verbose_name_plural': 'Contact Us'}, 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /smart_care/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for smart_care project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'smart_care.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /patient/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from . import models 3 | # Patient admin 4 | # Register your models here. 5 | class PatientAdmin(admin.ModelAdmin): 6 | list_display = ['first_name','last_name','mobile_no', 'image'] 7 | 8 | def first_name(self,obj): 9 | return obj.user.first_name 10 | 11 | def last_name(self,obj): 12 | return obj.user.last_name 13 | 14 | # admin patient Modal 15 | admin.site.register(models.Patient, PatientAdmin) -------------------------------------------------------------------------------- /smart_care/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for smart_care project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'smart_care.settings') 15 | 16 | application = get_wsgi_application() 17 | 18 | # wsgi django cors 19 | -------------------------------------------------------------------------------- /doctor/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | from . import models 5 | 6 | admin.site.register(models.AvailableTime) 7 | 8 | class SpecializationAdmin(admin.ModelAdmin): 9 | prepopulated_fields = {'slug': ('name',), } 10 | class DesignationAdmin(admin.ModelAdmin): 11 | prepopulated_fields = {'slug': ('name',), } 12 | 13 | admin.site.register(models.Specialization, SpecializationAdmin) 14 | admin.site.register(models.Designation, DesignationAdmin) 15 | admin.site.register(models.Doctor) 16 | admin.site.register(models.Review) 17 | 18 | 19 | # Register Modal -------------------------------------------------------------------------------- /patient/urls.py: -------------------------------------------------------------------------------- 1 | from rest_framework.routers import DefaultRouter 2 | from django.urls import path, include 3 | from . import views 4 | router = DefaultRouter() # amader router 5 | 6 | router.register('list', views.PatientViewset) # router er antena 7 | urlpatterns = [ 8 | path('', include(router.urls)), 9 | path('register/', views.UserRegistrationApiView.as_view(), name='register'), 10 | path('login/', views.UserLoginApiView.as_view(), name='login'), 11 | path('logout/', views.UserLogoutView.as_view(), name='logout'), 12 | path('active///', views.activate, name = 'activate'), 13 | ] -------------------------------------------------------------------------------- /doctor/urls.py: -------------------------------------------------------------------------------- 1 | from rest_framework.routers import DefaultRouter 2 | from django.urls import path, include 3 | from . import views 4 | router = DefaultRouter() # amader router 5 | 6 | router.register('list', views.DoctorViewset) # router er antena 7 | router.register('specialization', views.SpecializationViewset) # router er antena 8 | router.register('available_time', views.AvailableTimeViewset) # router er antena 9 | router.register('designation', views.DesignationViewset) # router er antena 10 | router.register('reviews', views.ReviewViewset) # router er antena 11 | 12 | urlpatterns = [ 13 | path('', include(router.urls)), 14 | ] -------------------------------------------------------------------------------- /appointment/migrations/0002_alter_appointment_time.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.2.4 on 2024-01-01 03:22 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('doctor', '0003_review'), 11 | ('appointment', '0001_initial'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='appointment', 17 | name='time', 18 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doctor.availabletime'), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /doctor/migrations/0002_remove_doctor_available_time_doctor_available_time.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.2.4 on 2023-12-26 11:49 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('doctor', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='doctor', 15 | name='available_time', 16 | ), 17 | migrations.AddField( 18 | model_name='doctor', 19 | name='available_time', 20 | field=models.ManyToManyField(to='doctor.availabletime'), 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /patient/migrations/0002_alter_patient_user.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.2.4 on 2023-12-26 10:42 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 12 | ('patient', '0001_initial'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AlterField( 17 | model_name='patient', 18 | name='user', 19 | field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /contact_us/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.2.4 on 2023-12-26 10:25 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='ContactUs', 16 | fields=[ 17 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('name', models.CharField(max_length=30)), 19 | ('phone', models.CharField(max_length=12)), 20 | ('problem', models.TextField()), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /service/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.2.4 on 2023-12-26 10:16 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Service', 16 | fields=[ 17 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('name', models.CharField(max_length=20)), 19 | ('description', models.TextField()), 20 | ('image', models.ImageField(upload_to='service/images/')), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /appointment/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from rest_framework import viewsets 3 | from . import models 4 | from . import serializers 5 | # Create your views here. 6 | class AppointmentViewSet(viewsets.ModelViewSet): 7 | queryset = models.Appointment.objects.all() 8 | serializer_class = serializers.AppointmentSerializer 9 | 10 | # Custom Query Kortechi 11 | def get_queryset(self): 12 | queryset = super().get_queryset() # 7 no line ke niye aslam ba patient ke inherit korlam 13 | print(self.request.query_params) 14 | patient_id = self.request.query_params.get('patient_id') 15 | if patient_id: 16 | queryset = queryset.filter(patient_id=patient_id) 17 | return queryset 18 | 19 | # Model View Set -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | # Manage py 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'smart_care.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | 24 | # Manage Py 25 | -------------------------------------------------------------------------------- /patient/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.2.4 on 2023-12-26 10:39 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Patient', 19 | fields=[ 20 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('image', models.ImageField(upload_to='patient/images/')), 22 | ('mobile_no', models.CharField(max_length=12)), 23 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 24 | ], 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /appointment/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from patient.models import Patient 3 | from doctor.models import Doctor, AvailableTime 4 | # Create your models here. 5 | 6 | APPOINTMENT_STATUS = [ 7 | ('Completed', 'Completed'), 8 | ('Pending', 'Pending'), 9 | ('Running', 'Running'), 10 | ] 11 | 12 | # Appionment Type 13 | 14 | APPOINTMENT_TYPES = [ 15 | ('Offline', 'Offline'), 16 | ('Online', 'Online'), 17 | ] 18 | class Appointment(models.Model): 19 | patient = models.ForeignKey(Patient, on_delete = models.CASCADE) 20 | doctor = models.ForeignKey(Doctor, on_delete = models.CASCADE) 21 | appointment_types = models.CharField(choices = APPOINTMENT_TYPES, max_length = 10) 22 | appointment_status = models.CharField(choices = APPOINTMENT_STATUS, max_length = 10, default = "Pending") 23 | symptom = models.TextField() 24 | time = models.ForeignKey(AvailableTime, on_delete = models.CASCADE) 25 | cancel = models.BooleanField(default = False) 26 | 27 | def __str__(self): 28 | return f"Doctor : {self.doctor.user.first_name} , Patient : {self.patient.user.first_name}" 29 | -------------------------------------------------------------------------------- /doctor/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from . import models 3 | 4 | class DoctorSerializer(serializers.ModelSerializer): 5 | user = serializers.StringRelatedField(many=False) 6 | designation = serializers.StringRelatedField(many=True) 7 | specialization = serializers.StringRelatedField(many=True) 8 | available_time = serializers.StringRelatedField(many=True) 9 | class Meta: 10 | model = models.Doctor 11 | fields = '__all__' 12 | class SpecializationSerializer(serializers.ModelSerializer): 13 | class Meta: 14 | model = models.Specialization 15 | fields = '__all__' 16 | 17 | class DesignationSerializer(serializers.ModelSerializer): 18 | class Meta: 19 | model = models.Designation 20 | fields = '__all__' 21 | 22 | class AvailableTimeSerializer(serializers.ModelSerializer): 23 | class Meta: 24 | model = models.AvailableTime 25 | fields = '__all__' 26 | 27 | class ReviewSerializer(serializers.ModelSerializer): 28 | class Meta: 29 | model = models.Review 30 | fields = '__all__' 31 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Hazrat Ali 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /doctor/migrations/0003_review.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.2.4 on 2023-12-26 16:12 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('patient', '0002_alter_patient_user'), 11 | ('doctor', '0002_remove_doctor_available_time_doctor_available_time'), 12 | ] 13 | 14 | operations = [ 15 | migrations.CreateModel( 16 | name='Review', 17 | fields=[ 18 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 19 | ('body', models.TextField()), 20 | ('created', models.DateTimeField(auto_now_add=True)), 21 | ('rating', models.CharField(choices=[('⭐', '⭐'), ('⭐⭐', '⭐⭐'), ('⭐⭐⭐', '⭐⭐⭐'), ('⭐⭐⭐⭐', '⭐⭐⭐⭐'), ('⭐⭐⭐⭐⭐', '⭐⭐⭐⭐⭐')], max_length=10)), 22 | ('doctor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doctor.doctor')), 23 | ('reviewer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='patient.patient')), 24 | ], 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /appointment/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from . import models 3 | from django.core.mail import EmailMultiAlternatives 4 | from django.template.loader import render_to_string 5 | # Register your models here. 6 | 7 | class AppointmentAdmin(admin.ModelAdmin): 8 | list_display = ['doctor_name', 'patient_name', 'appointment_types', 'appointment_status', 'symptom', 'time', 'cancel'] 9 | def patient_name(self,obj): 10 | return obj.patient.user.first_name 11 | 12 | def doctor_name(self,obj): 13 | return obj.doctor.user.first_name 14 | 15 | def save_model(self, request, obj, form, change): 16 | obj.save() 17 | if obj.appointment_status == "Running" and obj.appointment_types == "Online": 18 | email_subject = "Your Online Appointment is Running" 19 | email_body = render_to_string('admin_email.html', {'user' : obj.patient.user, 'doctor' : obj.doctor}) 20 | 21 | email = EmailMultiAlternatives(email_subject , '', to=[obj.patient.user.email]) 22 | email.attach_alternative(email_body, "text/html") 23 | email.send() 24 | 25 | admin.site.register(models.Appointment, AppointmentAdmin) 26 | 27 | 28 | # Admin Appiontment -------------------------------------------------------------------------------- /appointment/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.2.4 on 2023-12-26 16:38 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | initial = True 10 | 11 | dependencies = [ 12 | ('doctor', '0003_review'), 13 | ('patient', '0002_alter_patient_user'), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Appointment', 19 | fields=[ 20 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('appointment_types', models.CharField(choices=[('Offline', 'Offline'), ('Online', 'Online')], max_length=10)), 22 | ('appointment_status', models.CharField(choices=[('Completed', 'Completed'), ('Pending', 'Pending'), ('Running', 'Running')], default='Pending', max_length=10)), 23 | ('symptom', models.TextField()), 24 | ('cancel', models.BooleanField(default=False)), 25 | ('doctor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doctor.doctor')), 26 | ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='patient.patient')), 27 | ('time', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='doctor.availabletime')), 28 | ], 29 | ), 30 | ] 31 | -------------------------------------------------------------------------------- /smart_care/urls.py: -------------------------------------------------------------------------------- 1 | """ 2 | URL configuration for smart_care project. 3 | 4 | The `urlpatterns` list routes URLs to views. For more information please see: 5 | https://docs.djangoproject.com/en/4.2/topics/http/urls/ 6 | Examples: 7 | Function views 8 | 1. Add an import: from my_app import views 9 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 10 | Class-based views 11 | 1. Add an import: from other_app.views import Home 12 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 13 | Including another URLconf 14 | 1. Import the include() function: from django.urls import include, path 15 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 16 | """ 17 | from django.contrib import admin 18 | from django.urls import path, include 19 | from django.conf import settings 20 | from django.conf.urls.static import static 21 | from rest_framework.routers import DefaultRouter 22 | from . views import UserViewSet 23 | router = DefaultRouter() 24 | router.register('users', UserViewSet) 25 | urlpatterns = [ 26 | path('', include(router.urls)), 27 | path('admin/', admin.site.urls), 28 | path('contact_us/', include('contact_us.urls')), 29 | path('services/', include('service.urls')), 30 | path('patient/', include('patient.urls')), 31 | path('doctor/', include('doctor.urls')), 32 | path('appointment/', include('appointment.urls')), 33 | ] 34 | 35 | 36 | urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) 37 | -------------------------------------------------------------------------------- /patient/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from . import models 3 | from django.contrib.auth.models import User 4 | class PatientSerializer(serializers.ModelSerializer): 5 | user = serializers.StringRelatedField(many=False) 6 | class Meta: 7 | model = models.Patient 8 | fields = '__all__' 9 | # Serializers. 10 | class RegistrationSerializer(serializers.ModelSerializer): 11 | confirm_password = serializers.CharField(required = True) 12 | class Meta: 13 | model = User 14 | fields = ['username', 'first_name', 'last_name', 'email', 'password', 'confirm_password'] 15 | 16 | def save(self): 17 | username = self.validated_data['username'] 18 | first_name = self.validated_data['first_name'] 19 | last_name = self.validated_data['last_name'] 20 | email = self.validated_data['email'] 21 | password = self.validated_data['password'] 22 | password2 = self.validated_data['confirm_password'] 23 | 24 | if password != password2: 25 | raise serializers.ValidationError({'error' : "Password Doesn't Mactched"}) 26 | if User.objects.filter(email=email).exists(): 27 | raise serializers.ValidationError({'error' : "Email Already exists"}) 28 | account = User(username = username, email=email, first_name = first_name, last_name = last_name) 29 | print(account) 30 | account.set_password(password) 31 | account.is_active = False 32 | account.save() 33 | return account 34 | 35 | 36 | class UserLoginSerializer(serializers.Serializer): 37 | username = serializers.CharField(required = True) 38 | password = serializers.CharField(required = True) -------------------------------------------------------------------------------- /doctor/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | from patient.models import Patient 4 | # Create your models here. 5 | 6 | class Specialization(models.Model): 7 | name = models.CharField(max_length = 30) 8 | slug = models.SlugField(max_length = 40) 9 | def __str__(self): 10 | return self.name 11 | class Designation(models.Model): 12 | name = models.CharField(max_length = 30) 13 | slug = models.SlugField(max_length = 40) 14 | def __str__(self): 15 | return self.name 16 | class AvailableTime(models.Model): 17 | name = models.CharField(max_length = 100) 18 | 19 | def __str__(self): 20 | return self.name 21 | 22 | 23 | # one to many --> many part e kintu foreign key add kortam 24 | class Doctor(models.Model): 25 | user = models.OneToOneField(User, on_delete = models.CASCADE) 26 | image = models.ImageField(upload_to="doctor/images/") 27 | designation = models.ManyToManyField(Designation) 28 | specialization = models.ManyToManyField(Specialization) 29 | available_time = models.ManyToManyField(AvailableTime) 30 | fee = models.IntegerField() 31 | meet_link = models.CharField(max_length = 100) 32 | 33 | def __str__(self): 34 | return f"{self.user.first_name} {self.user.last_name}" 35 | 36 | 37 | STAR_CHOICES = [ 38 | ('⭐', '⭐'), 39 | ('⭐⭐', '⭐⭐'), 40 | ('⭐⭐⭐', '⭐⭐⭐'), 41 | ('⭐⭐⭐⭐', '⭐⭐⭐⭐'), 42 | ('⭐⭐⭐⭐⭐', '⭐⭐⭐⭐⭐'), 43 | ] 44 | class Review(models.Model): 45 | reviewer = models.ForeignKey(Patient, on_delete = models.CASCADE) 46 | doctor = models.ForeignKey(Doctor, on_delete = models.CASCADE) 47 | body = models.TextField() 48 | created = models.DateTimeField(auto_now_add = True) 49 | rating = models.CharField(choices = STAR_CHOICES, max_length = 10) 50 | 51 | def __str__(self): 52 | return f"Patient : {self.reviewer.user.first_name} ; Doctor {self.doctor.user.first_name}" -------------------------------------------------------------------------------- /doctor/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from rest_framework import viewsets 3 | from . import models 4 | from . import serializers 5 | from rest_framework import filters, pagination 6 | from rest_framework.permissions import IsAuthenticated,IsAuthenticatedOrReadOnly 7 | from rest_framework.permissions import BasePermission 8 | 9 | class SpecializationViewset(viewsets.ModelViewSet): 10 | queryset = models.Specialization.objects.all() 11 | serializer_class = serializers.SpecializationSerializer 12 | 13 | 14 | class DesignationViewset(viewsets.ModelViewSet): 15 | queryset = models.Designation.objects.all() 16 | serializer_class = serializers.DesignationSerializer 17 | 18 | 19 | class AvailableTimeForSpecificDoctor(filters.BaseFilterBackend): 20 | def filter_queryset(self, request, query_set, view): 21 | doctor_id = request.query_params.get("doctor_id") 22 | if doctor_id: 23 | return query_set.filter(doctor = doctor_id) 24 | return query_set 25 | 26 | class AvailableTimeViewset(viewsets.ModelViewSet): 27 | permission_classes = [IsAuthenticatedOrReadOnly] 28 | queryset = models.AvailableTime.objects.all() 29 | serializer_class = serializers.AvailableTimeSerializer 30 | filter_backends = [AvailableTimeForSpecificDoctor] 31 | 32 | class DoctorPagination(pagination.PageNumberPagination): 33 | page_size = 1 # items per page 34 | page_size_query_param = page_size 35 | max_page_size = 100 36 | 37 | class DoctorViewset(viewsets.ModelViewSet): 38 | queryset = models.Doctor.objects.all() 39 | serializer_class = serializers.DoctorSerializer 40 | filter_backends = [filters.SearchFilter] 41 | pagination_class = DoctorPagination 42 | search_fields = ['user__first_name', 'user__email', 'designation__name', 'specialization__name'] 43 | 44 | class ReviewViewset(viewsets.ModelViewSet): 45 | 46 | queryset = models.Review.objects.all() 47 | serializer_class = serializers.ReviewSerializer 48 | 49 | # Doctor Migration -------------------------------------------------------------------------------- /doctor/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.2.4 on 2023-12-26 11:39 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='AvailableTime', 19 | fields=[ 20 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('name', models.CharField(max_length=100)), 22 | ], 23 | ), 24 | migrations.CreateModel( 25 | name='Designation', 26 | fields=[ 27 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 28 | ('name', models.CharField(max_length=30)), 29 | ('slug', models.SlugField(max_length=40)), 30 | ], 31 | ), 32 | migrations.CreateModel( 33 | name='Specialization', 34 | fields=[ 35 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 36 | ('name', models.CharField(max_length=30)), 37 | ('slug', models.SlugField(max_length=40)), 38 | ], 39 | ), 40 | migrations.CreateModel( 41 | name='Doctor', 42 | fields=[ 43 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 44 | ('image', models.ImageField(upload_to='doctor/images/')), 45 | ('fee', models.IntegerField()), 46 | ('meet_link', models.CharField(max_length=100)), 47 | ('available_time', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doctor.availabletime')), 48 | ('designation', models.ManyToManyField(to='doctor.designation')), 49 | ('specialization', models.ManyToManyField(to='doctor.specialization')), 50 | ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 51 | ], 52 | ), 53 | ] 54 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | absl-py 2 | amqp 3 | anyascii 4 | arabic-reshaper 5 | asgiref 6 | asn1crypto 7 | astroid 8 | astunparse 9 | attrs 10 | autopep8 11 | backports.entry-points-selectable 12 | beautifulsoup4 13 | billiard 14 | cachetools 15 | celery 16 | certifi 17 | cffi 18 | chardet 19 | charset-normalizer 20 | click 21 | click-didyoumean 22 | click-plugins 23 | click-repl 24 | colorama 25 | comtypes 26 | contourpy 27 | crispy-bootstrap5 28 | cron-descriptor 29 | cryptography 30 | cssselect2 31 | cycler 32 | defusedxml 33 | diagram 34 | diff-match-patch 35 | dill 36 | distlib 37 | dj-database-url 38 | Django 39 | django-bootstrap-v5 40 | django-bootstrap4 41 | django-celery-beat 42 | django-cors-headers 43 | django-cors-middleware 44 | django-crispy-forms 45 | django-email 46 | django-environ 47 | django-filter 48 | django-import-export 49 | django-modelcluster 50 | django-taggit 51 | django-timezone-field 52 | django-treebeard 53 | django-widget-tweaks 54 | djangorestframework 55 | docopt 56 | draftjs-exporter 57 | EasyProcess 58 | entrypoint2 59 | et-xmlfile 60 | face-recognition-models 61 | filelock 62 | Flask 63 | flatbuffers 64 | fonttools 65 | freetype-py 66 | gast 67 | ghs 68 | google-auth 69 | google-auth-oauthlib 70 | google-pasta 71 | graphviz 72 | grpcio 73 | gunicorn 74 | h5py 75 | halo 76 | html5lib 77 | idna 78 | importlib-metadata 79 | iniconfig 80 | isort 81 | itsdangerous 82 | Jinja2 83 | joblib 84 | keras 85 | Keras-Preprocessing 86 | keyboard 87 | kiwisolver 88 | kombu 89 | l18n 90 | lazy-object-proxy 91 | libclang 92 | log-symbols 93 | lxml 94 | Markdown 95 | MarkupPy 96 | MarkupSafe 97 | matplotlib 98 | mccabe 99 | MouseInfo 100 | mss 101 | notify2 102 | numpy 103 | oauthlib 104 | odfpy 105 | opencv-python 106 | openpyxl 107 | opt-einsum 108 | oscrypto 109 | packaging 110 | pandas 111 | Pillow 112 | pipenv 113 | pipreqs 114 | platformdirs 115 | pluggy 116 | ppt2pdf 117 | prompt-toolkit 118 | protobuf 119 | psycopg2 120 | psycopg2-binary 121 | py 122 | pyasn1 123 | pyasn1-modules 124 | PyAutoGUI 125 | pycairo 126 | pycodestyle 127 | pycparser 128 | pyfiglet 129 | PyGetWindow 130 | Pygments 131 | pyHanko 132 | pyhanko-certvalidator 133 | PyInquirer 134 | pyjokes 135 | pylint 136 | PyMsgBox 137 | pyparsing 138 | pypdf 139 | PyPDF2 140 | pyperclip 141 | PyRect 142 | pyscreenshot 143 | PyScreeze 144 | pytest 145 | python-bidi 146 | python-crontab 147 | python-dateutil 148 | pytweening 149 | pytz 150 | PyYAML 151 | qrcode 152 | regex 153 | reportlab 154 | requests 155 | requests-oauthlib 156 | retry-requests 157 | rlPyCairo 158 | rsa 159 | scikit-learn 160 | scipy 161 | six 162 | soupsieve 163 | spinners 164 | sqlparse 165 | sslcommerz-lib 166 | stripe 167 | svglib 168 | tablib 169 | telepath 170 | tensorboard 171 | tensorboard-data-server 172 | tensorboard-plugin-wit 173 | tensorflow 174 | tensorflow-estimator 175 | tensorflow-io-gcs-filesystem 176 | termcolor 177 | threadpoolctl 178 | tinycss2 179 | tk 180 | toml 181 | tomli 182 | tomlkit 183 | topsis-jamesfallon 184 | TOPSIS-Yash-101803064 185 | typed-ast 186 | typing_extensions 187 | tzdata 188 | tzlocal 189 | uritools 190 | urllib3 191 | vine 192 | virtualenv 193 | virtualenv-clone 194 | wagtail 195 | wcwidth 196 | webencodings 197 | Werkzeug 198 | whitenoise 199 | Willow 200 | wrapt 201 | xhtml2pdf 202 | xlrd 203 | XlsxWriter 204 | xlwt 205 | yarg 206 | zipp 207 | clone the Repo And Run 208 | -------------------------------------------------------------------------------- /patient/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from rest_framework import viewsets 3 | from . import models 4 | from . import serializers 5 | from rest_framework.views import APIView 6 | from rest_framework.response import Response 7 | from django.contrib.auth.tokens import default_token_generator 8 | from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode 9 | from django.utils.encoding import force_bytes 10 | from django.contrib.auth.models import User 11 | from django.contrib.auth import authenticate, login, logout 12 | from rest_framework.authtoken.models import Token 13 | # for sending email 14 | from django.core.mail import EmailMultiAlternatives 15 | from django.template.loader import render_to_string 16 | from django.shortcuts import redirect 17 | 18 | 19 | class PatientViewset(viewsets.ModelViewSet): 20 | queryset = models.Patient.objects.all() 21 | serializer_class = serializers.PatientSerializer 22 | 23 | class UserRegistrationApiView(APIView): 24 | serializer_class = serializers.RegistrationSerializer 25 | 26 | def post(self, request): 27 | serializer = self.serializer_class(data=request.data) 28 | 29 | if serializer.is_valid(): 30 | user = serializer.save() 31 | print(user) 32 | token = default_token_generator.make_token(user) 33 | print("token ", token) 34 | uid = urlsafe_base64_encode(force_bytes(user.pk)) 35 | print("uid ", uid) 36 | confirm_link = f"https://smart-care.onrender.com/patient/active/{uid}/{token}" 37 | email_subject = "Confirm Your Email" 38 | email_body = render_to_string('confirm_email.html', {'confirm_link' : confirm_link}) 39 | 40 | email = EmailMultiAlternatives(email_subject , '', to=[user.email]) 41 | email.attach_alternative(email_body, "text/html") 42 | email.send() 43 | return Response("Check your mail for confirmation") 44 | return Response(serializer.errors) 45 | 46 | 47 | def activate(request, uid64, token): 48 | try: 49 | uid = urlsafe_base64_decode(uid64).decode() 50 | user = User._default_manager.get(pk=uid) 51 | except(User.DoesNotExist): 52 | user = None 53 | 54 | if user is not None and default_token_generator.check_token(user, token): 55 | user.is_active = True 56 | user.save() 57 | return redirect('login') 58 | else: 59 | return redirect('register') 60 | 61 | 62 | class UserLoginApiView(APIView): 63 | def post(self, request): 64 | serializer = serializers.UserLoginSerializer(data = self.request.data) 65 | if serializer.is_valid(): 66 | username = serializer.validated_data['username'] 67 | password = serializer.validated_data['password'] 68 | 69 | user = authenticate(username= username, password=password) 70 | 71 | if user: 72 | token, _ = Token.objects.get_or_create(user=user) 73 | print(token) 74 | print(_) 75 | login(request, user) 76 | return Response({'token' : token.key, 'user_id' : user.id}) 77 | else: 78 | return Response({'error' : "Invalid Credential"}) 79 | return Response(serializer.errors) 80 | 81 | class UserLogoutView(APIView): 82 | def get(self, request): 83 | request.user.auth_token.delete() 84 | logout(request) 85 | # return redirect('login') 86 | return Response({'success' : "logout successful"}) 87 | 88 | # Return View js 89 | 90 | -------------------------------------------------------------------------------- /smart_care/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for smart_care project. 3 | 4 | Generated by 'django-admin startproject' using Django 4.2.4. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.2/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/4.2/ref/settings/ 11 | """ 12 | 13 | from pathlib import Path 14 | import environ 15 | env = environ.Env() 16 | environ.Env.read_env() 17 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 18 | BASE_DIR = Path(__file__).resolve().parent.parent 19 | 20 | 21 | # Quick-start development settings - unsuitable for production 22 | # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ 23 | 24 | # SECURITY WARNING: keep the secret key used in production secret! 25 | SECRET_KEY = 'django-insecure-1=hr#+2i-jg4*w!q(+j16fkx&9d0j$b572*rdbh6)u&qpzmsd6' 26 | 27 | # SECURITY WARNING: don't run with debug turned on in production! 28 | DEBUG = True 29 | 30 | ALLOWED_HOSTS = ["*"] 31 | CSRF_TRUSTED_ORIGINS = ['https://smart-care.onrender.com','https://*.127.0.0.1'] 32 | 33 | # Application definition 34 | 35 | INSTALLED_APPS = [ 36 | 'corsheaders', 37 | 'django.contrib.admin', 38 | 'django.contrib.auth', 39 | 'django.contrib.contenttypes', 40 | 'django.contrib.sessions', 41 | 'django.contrib.messages', 42 | 'django.contrib.staticfiles', 43 | 'rest_framework', 44 | 'rest_framework.authtoken', 45 | 'django_filters', 46 | 'appointment', 47 | 'contact_us', 48 | 'doctor', 49 | 'patient', 50 | 'service', 51 | ] 52 | 53 | MIDDLEWARE = [ 54 | 'corsheaders.middleware.CorsMiddleware', 55 | 'django.middleware.security.SecurityMiddleware', 56 | 'django.contrib.sessions.middleware.SessionMiddleware', 57 | 'django.middleware.common.CommonMiddleware', 58 | 'django.middleware.csrf.CsrfViewMiddleware', 59 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 60 | 'django.contrib.messages.middleware.MessageMiddleware', 61 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 62 | ] 63 | 64 | ROOT_URLCONF = 'smart_care.urls' 65 | CORS_ORIGIN_ALLOW_ALL = True 66 | CSRF_TRUSTED_ORIGINS = ['https://smart-care.onrender.com'] 67 | 68 | TEMPLATES = [ 69 | { 70 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 71 | 'DIRS': [], 72 | 'APP_DIRS': True, 73 | 'OPTIONS': { 74 | 'context_processors': [ 75 | 'django.template.context_processors.debug', 76 | 'django.template.context_processors.request', 77 | 'django.contrib.auth.context_processors.auth', 78 | 'django.contrib.messages.context_processors.messages', 79 | ], 80 | }, 81 | }, 82 | ] 83 | 84 | WSGI_APPLICATION = 'smart_care.wsgi.application' 85 | 86 | 87 | # Database 88 | # https://docs.djangoproject.com/en/4.2/ref/settings/#databases 89 | 90 | DATABASES = { 91 | 'default': { 92 | 'ENGINE': 'django.db.backends.sqlite3', 93 | 'NAME': BASE_DIR / 'db.sqlite3', 94 | } 95 | } 96 | 97 | 98 | REST_FRAMEWORK = { 99 | 'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'], 100 | } 101 | 102 | # Password validation 103 | # https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators 104 | 105 | AUTH_PASSWORD_VALIDATORS = [ 106 | { 107 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 108 | }, 109 | { 110 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 111 | }, 112 | { 113 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 114 | }, 115 | { 116 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 117 | }, 118 | ] 119 | 120 | 121 | # Internationalization 122 | # https://docs.djangoproject.com/en/4.2/topics/i18n/ 123 | 124 | LANGUAGE_CODE = 'en-us' 125 | 126 | TIME_ZONE = 'UTC' 127 | 128 | USE_I18N = True 129 | 130 | USE_TZ = True 131 | 132 | 133 | # Static files (CSS, JavaScript, Images) 134 | # https://docs.djangoproject.com/en/4.2/howto/static-files/ 135 | 136 | STATIC_URL = 'static/' 137 | MEDIA_URL = '/media/' 138 | # Default primary key field type 139 | # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field 140 | 141 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 142 | 143 | EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' 144 | EMAIL_HOST = 'smtp.gmail.com' 145 | EMAIL_USE_TLS = True 146 | EMAIL_PORT = 587 147 | EMAIL_HOST_USER = env("EMAIL") 148 | EMAIL_HOST_PASSWORD = env("EMAIL_PASSWORD") 149 | --------------------------------------------------------------------------------