From ebb48c1a420264eb53495682e2c12a5328e1189a Mon Sep 17 00:00:00 2001 From: Alexander Hosking Date: Sat, 25 Dec 2021 22:04:59 -0500 Subject: [PATCH] Adding functions for bills --- api/api/dashboard.py | 2 ++ api/api/settings.py | 6 +++--- api/bills/urls.py | 3 ++- api/bills/views.py | 4 +++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/api/api/dashboard.py b/api/api/dashboard.py index 9c5d4c7..d9352a1 100644 --- a/api/api/dashboard.py +++ b/api/api/dashboard.py @@ -4,6 +4,8 @@ from jet.dashboard.dashboard import Dashboard, AppIndexDashboard class CustomIndexDashboard(Dashboard): + # app_label = "api" + columns = 3 def init_with_context(self, context): diff --git a/api/api/settings.py b/api/api/settings.py index eda5890..1451c9c 100644 --- a/api/api/settings.py +++ b/api/api/settings.py @@ -29,7 +29,7 @@ SECRET_KEY = env("SECRET_KEY", default='django-insecure-7uajhmbt^@)mklk1ur=slkmn # SECURITY WARNING: don't run with debug turned on in production! DEBUG = env("DEBUG") -ALLOWED_HOSTS = ["127.0.0.1", "192.168.1.187", "192.168.1.23"] +ALLOWED_HOSTS = ["localhost", "127.0.0.1", "192.168.1.187", "192.168.1.23"] # Application definition @@ -172,5 +172,5 @@ JET_THEMES = [ ] # JET_INDEX_DASHBOARD = 'jet.dashboard.dashboard.DefaultIndexDashboard' -JET_APP_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard' -# JET_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard' \ No newline at end of file +# JET_APP_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard' +JET_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard' \ No newline at end of file diff --git a/api/bills/urls.py b/api/bills/urls.py index a36f0ff..99d30d7 100644 --- a/api/bills/urls.py +++ b/api/bills/urls.py @@ -8,5 +8,6 @@ from . import views urlpatterns = [ path('', views.index, name='index'), - path('admin/', admin.site.urls), + path('/', views.detail, name='detail') + # path('admin/', admin.site.urls), ] diff --git a/api/bills/views.py b/api/bills/views.py index 6e05d5c..9dc78ed 100644 --- a/api/bills/views.py +++ b/api/bills/views.py @@ -3,4 +3,6 @@ from django.http import HttpResponse def index(request): return HttpResponse("Let there be bills!") -# Create your views here. + +def detail(request, bill_id): + return HttpResponse("You're looking at Bill %s." % bill_id)