diff --git a/backend/api/__pycache__/models.cpython-310.pyc b/backend/api/__pycache__/models.cpython-310.pyc index 959576b..441fdb8 100644 Binary files a/backend/api/__pycache__/models.cpython-310.pyc and b/backend/api/__pycache__/models.cpython-310.pyc differ diff --git a/backend/api/__pycache__/views.cpython-310.pyc b/backend/api/__pycache__/views.cpython-310.pyc index 231eb24..8f66c5e 100644 Binary files a/backend/api/__pycache__/views.cpython-310.pyc and b/backend/api/__pycache__/views.cpython-310.pyc differ diff --git a/backend/api/models.py b/backend/api/models.py index f5e91bc..a05ee4d 100644 --- a/backend/api/models.py +++ b/backend/api/models.py @@ -2,8 +2,10 @@ # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True -# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior -# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table +# * Make sure each ForeignKey and OneToOneField has `on_delete` +# * set to the desired behavior +# * Remove `managed = False` lines if you wish to allow Django +# * to create, modify, and delete the table # Feel free to rename the models, but don't rename db_table values or field names. from django.db import models @@ -42,7 +44,8 @@ class Meta: class MedicationLog(models.Model): log_id = models.AutoField(primary_key=True) user = models.ForeignKey('Users', models.DO_NOTHING, blank=True, null=True) - medication = models.ForeignKey(MedicationInfo, models.DO_NOTHING, blank=True, null=True) + medication = models.ForeignKey(MedicationInfo, models.DO_NOTHING, blank=True, + null=True) date = models.DateField() time = models.TimeField() time_zone = models.CharField(max_length=5) diff --git a/backend/api/static/images/hai.gif b/backend/api/static/images/hai.gif new file mode 100644 index 0000000..9713d7d Binary files /dev/null and b/backend/api/static/images/hai.gif differ diff --git a/backend/api/views.py b/backend/api/views.py index 812c38d..c04380d 100644 --- a/backend/api/views.py +++ b/backend/api/views.py @@ -2,10 +2,12 @@ from django.shortcuts import render from django.http import HttpResponse +from django.conf import settings +import os # Create your views here. def test_page(request): return HttpResponse('This is a test page to verify if the django setup works') def api_home(request): - return HttpResponse('API Landing page') \ No newline at end of file + return render(request, os.path.join(settings.FRONTEND_DIR, 'api_home.html')) \ No newline at end of file diff --git a/backend/med_reminder/__pycache__/settings.cpython-310.pyc b/backend/med_reminder/__pycache__/settings.cpython-310.pyc index c25d0fd..fe3d7cf 100644 Binary files a/backend/med_reminder/__pycache__/settings.cpython-310.pyc and b/backend/med_reminder/__pycache__/settings.cpython-310.pyc differ diff --git a/backend/med_reminder/__pycache__/urls.cpython-310.pyc b/backend/med_reminder/__pycache__/urls.cpython-310.pyc index 2af2665..57b8376 100644 Binary files a/backend/med_reminder/__pycache__/urls.cpython-310.pyc and b/backend/med_reminder/__pycache__/urls.cpython-310.pyc differ diff --git a/backend/med_reminder/settings.py b/backend/med_reminder/settings.py index 60a4c83..855f328 100644 --- a/backend/med_reminder/settings.py +++ b/backend/med_reminder/settings.py @@ -16,7 +16,8 @@ # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent - +FRONTEND_DIR = os.path.join(BASE_DIR, '..', 'frontend') +print(FRONTEND_DIR) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ @@ -63,7 +64,10 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [ + FRONTEND_DIR, + os.path.join(FRONTEND_DIR, 'lib'), + ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -132,7 +136,12 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.0/howto/static-files/ -STATIC_URL = 'static/' +STATIC_URL = '/static/' + +# Additional directories to find static files +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'api/static'), +] # Default primary key field type # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field diff --git a/backend/med_reminder/urls.py b/backend/med_reminder/urls.py index bf47174..493c104 100644 --- a/backend/med_reminder/urls.py +++ b/backend/med_reminder/urls.py @@ -19,5 +19,5 @@ urlpatterns = [ path('admin/', admin.site.urls), - path('api/', include('api.api_urls')) + path('', include('api.api_urls')) ]