diff --git a/core/urls.py b/core/urls.py new file mode 100644 index 0000000..4a60485 --- /dev/null +++ b/core/urls.py @@ -0,0 +1,14 @@ +from django.urls import path +from django.conf import settings + +from .views import ( + CustomerDashboardView, + BaseTestView, +) + +urlpatterns = [ + path('manager/dashboard/', CustomerDashboardView.as_view(), name='dashboard'), +] + +if settings.DEBUG: + urlpatterns.append(path('test/base/', BaseTestView.as_view(), name='base')) \ No newline at end of file diff --git a/core/views.py b/core/views.py index 91ea44a..e69de29 100644 --- a/core/views.py +++ b/core/views.py @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. diff --git a/core/views/__init__.py b/core/views/__init__.py new file mode 100644 index 0000000..6513df2 --- /dev/null +++ b/core/views/__init__.py @@ -0,0 +1,2 @@ +from .test import BaseTestView +from .customers import CustomerDashboardView \ No newline at end of file diff --git a/core/views/customers.py b/core/views/customers.py new file mode 100644 index 0000000..426687f --- /dev/null +++ b/core/views/customers.py @@ -0,0 +1,10 @@ +from django.views.generic import TemplateView + +class CustomerDashboardView(TemplateView): + template_name = 'manager/customer/dashboard.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['app_title'] = "Restoroo" + context['page_title'] = "Dashboard" + return context \ No newline at end of file diff --git a/core/views/test.py b/core/views/test.py new file mode 100644 index 0000000..623585d --- /dev/null +++ b/core/views/test.py @@ -0,0 +1,4 @@ +from django.views.generic import TemplateView + +class BaseTestView(TemplateView): + template_name = 'manager/base.html' \ No newline at end of file diff --git a/frontend b/frontend index e117a67..c21adda 160000 --- a/frontend +++ b/frontend @@ -1 +1 @@ -Subproject commit e117a67e55ec78cbee83e9fd6ea799982a3cb22e +Subproject commit c21addaf262b948bf828b8bfc129160277c5dd8b diff --git a/restoroo/settings.py b/restoroo/settings.py index daac2db..59578fa 100644 --- a/restoroo/settings.py +++ b/restoroo/settings.py @@ -75,19 +75,23 @@ WSGI_APPLICATION = 'restoroo.wsgi.application' if "MySQL" in CONFIG_FILE.config: DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.mysql', + 'ENGINE': 'django.contrib.gis.db.backends.mysql', 'NAME': CONFIG_FILE.config.get("MySQL", "Database"), 'USER': CONFIG_FILE.config.get("MySQL", "Username"), 'PASSWORD': CONFIG_FILE.config.get("MySQL", "Password"), 'HOST': CONFIG_FILE.config.get("MySQL", "Host", fallback="localhost"), - 'PORT': CONFIG_FILE.config.getint("MySQL", "Port", fallback=3306) + 'PORT': CONFIG_FILE.config.getint("MySQL", "Port", fallback=3306), + 'OPTIONS': { + 'charset': 'utf8mb4', + 'sql_mode': 'traditional', + } } } else: DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', + 'ENGINE': 'django.contrib.gis.db.backends.spatialite', 'NAME': BASE_DIR / 'db.sqlite3', } } diff --git a/restoroo/urls.py b/restoroo/urls.py index ecefb60..7ae711f 100644 --- a/restoroo/urls.py +++ b/restoroo/urls.py @@ -14,7 +14,8 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin -from django.urls import path +from django.urls import path, include urlpatterns = [ + path('', include('core.urls')), ]