From dff7717b0e76b19ef93985c1ba7cc4ccce5a2346 Mon Sep 17 00:00:00 2001 From: sosokker Date: Sat, 18 Nov 2023 22:04:32 +0700 Subject: [PATCH] Add Overview page / Set up static path --- core/settings.py | 16 +- core/urls.py | 22 +- inventory/urls.py | 6 + inventory/views.py | 5 +- templates/inventory/index.html | 421 +++++++++++++++++++++++++++++++++ 5 files changed, 449 insertions(+), 21 deletions(-) create mode 100644 inventory/urls.py create mode 100644 templates/inventory/index.html diff --git a/core/settings.py b/core/settings.py index c4e24c6..73bbdad 100644 --- a/core/settings.py +++ b/core/settings.py @@ -9,9 +9,9 @@ https://docs.djangoproject.com/en/4.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.2/ref/settings/ """ +import os from pathlib import Path - from decouple import config, Csv # Build paths inside the project like this: BASE_DIR / 'subdir'. @@ -53,7 +53,7 @@ ROOT_URLCONF = 'core.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [BASE_DIR / "templates"], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -118,9 +118,19 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.2/howto/static-files/ -STATIC_URL = 'static/' +STATIC_URL = 'staticfiles/' +STATIC_ROOT = os.path.join(BASE_DIR, 'collected_static') + +MEDIA_URL = 'mediafiles/' +MEDIA_ROOT = os.path.join(BASE_DIR, 'staticfiles/mediafiles') # Default primary key field type # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'staticfiles'), +] + +LOGIN_REDIRECT_URL = "/" \ No newline at end of file diff --git a/core/urls.py b/core/urls.py index 3b2f61e..92808d6 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,22 +1,10 @@ -""" -URL configuration for core project. - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/4.2/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: path('', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.urls import include, path - 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 +from django.views.generic.base import RedirectView urlpatterns = [ path('admin/', admin.site.urls), + path("accounts/", include("django.contrib.auth.urls")), # new + path('dashboard/', include('inventory.urls'), name='dashboard'), + path('', RedirectView.as_view(url='/dashboard/')), ] diff --git a/inventory/urls.py b/inventory/urls.py new file mode 100644 index 0000000..647ec66 --- /dev/null +++ b/inventory/urls.py @@ -0,0 +1,6 @@ +from django.urls import path, include +from inventory.views import test + +urlpatterns = [ + path('overview/', test, name='overview'), +] diff --git a/inventory/views.py b/inventory/views.py index 91ea44a..413d02d 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -1,3 +1,6 @@ from django.shortcuts import render +from django.contrib.auth.decorators import login_required -# Create your views here. +@login_required +def test(request): + return render(request, 'inventory/index.html') \ No newline at end of file diff --git a/templates/inventory/index.html b/templates/inventory/index.html new file mode 100644 index 0000000..e2c6475 --- /dev/null +++ b/templates/inventory/index.html @@ -0,0 +1,421 @@ + + + +{% load static %} + + + + + + + + + Inventory Management System + + + + + + + + + + + + + + + +
+ + + + + + +
+ + +
+ + + + + + +
+ + +
+

Overview

+
+ + +
+ + +
+
+
+
+
+
+ Earnings (Monthly)
+
$40,000
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
+ Earnings (Annual)
+
$215,000
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
Tasks +
+
+
+
50%
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
+ Pending Requests
+
18
+
+
+ +
+
+
+
+
+
+ +
+ + +
+ + +
+
+
Warehouse Stock Level
+
+
+

Server Migration 20%

+
+
+
+

Sales Tracking 40%

+
+
+
+

Customer Database 60%

+
+
+
+

Payout Details 80%

+
+
+
+

Account Setup Complete!

+
+
+
+
+
+
+
+
+ +
+ + + +
+
+ +
+
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file