Skip to content

Commit

Permalink
seperate matters of concern
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrrogers committed Nov 14, 2023
1 parent 30b0688 commit 2158d24
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 10 deletions.
File renamed without changes.
3 changes: 3 additions & 0 deletions server/api/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions server/api/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ApiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'api'
File renamed without changes.
3 changes: 3 additions & 0 deletions server/api/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions server/api/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.urls import path
from balancer_backend.views.chatgpt import views
from api.views.chatgpt import views

urlpatterns = [
path("chatgpt/extract_text/", views.extract_text, name="post_web_text"),
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.urls import path
from balancer_backend.views.jira import views
from api.views.jira import views

urlpatterns = [
path("jira/create_new_feedback/", views.create_new_feedback, name="create_new_feedback"),
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.urls import path
from balancer_backend.views.listDrugs import views
from api.views.listDrugs import views

urlpatterns = [
path("chatgpt/list_drugs", views.medication, name="listDrugs")
Expand Down
File renamed without changes.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.urls import path
from balancer_backend.views.risk import views
from api.views.risk import views

urlpatterns = [
path("chatgpt/risk", views.medication, name="risk")
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion server/balancer_backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
'django.contrib.staticfiles',
'registration',
'balancer_backend',
'user_management'
'user_management',
'api'
]

MIDDLEWARE = [
Expand Down
10 changes: 6 additions & 4 deletions server/balancer_backend/urls.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from django.contrib import admin
from user_management import urls as user_management_urls
from django.urls import path, include
import importlib

subfolders = ['auth', 'chatgpt', 'jira', 'listDrugs', 'listMeds', 'risk']
urls = ['chatgpt', 'jira', 'listDrugs', 'listMeds', 'risk']

urlpatterns = [
path("admin/", admin.site.urls),
path("api/", include(user_management_urls)),
]

for subfolder in subfolders:
url_module = importlib.import_module(f'balancer_backend.views.{subfolder}.urls')
urlpatterns += getattr(url_module, 'urlpatterns', [])
for url in urls:
url_module = importlib.import_module(f'api.views.{url}.urls')
urlpatterns += getattr(url_module, 'urlpatterns', [])
File renamed without changes.
2 changes: 1 addition & 1 deletion server/user_management/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from rest_framework.decorators import api_view
from django.http import JsonResponse
from django.contrib.auth.models import User
from balancer_backend.models.users.registrationprofile.models import RegistrationProfile
from .models import RegistrationProfile
import requests
import json
import os
Expand Down

0 comments on commit 2158d24

Please sign in to comment.