lol i dont know what i am doing
This commit is contained in:
1 parent
edb0f45871
commit
d40476ebc3
114 files changed
+22008
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
ASGI config for student_management_system project.
|
||||
|
||||
It exposes the ASGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'student_management_system.settings')
|
||||
|
||||
application = get_asgi_application()
|
||||
@@ -0,0 +1,161 @@
|
||||
JAZZMIN_SETTINGS = {
|
||||
# title of the window (Will default to current_admin_site.site_title if absent or None)
|
||||
"site_title": "Student Management System Admin",
|
||||
# Title on the login screen (19 chars max) (defaults to current_admin_site.site_header if absent or None)
|
||||
"site_header": "Student Management System",
|
||||
# Title on the brand (19 chars max) (defaults to current_admin_site.site_header if absent or None)
|
||||
"site_brand": "SMS",
|
||||
# Logo to use for your site, must be present in static files, used for brand on top left
|
||||
"site_logo": "/src/img/logo.png",
|
||||
# CSS classes that are applied to the logo above
|
||||
"site_logo_classes": "img-circle",
|
||||
# Relative path to a favicon for your site, will default to site_logo if absent (ideally 32x32 px)
|
||||
"site_icon": None,
|
||||
# Welcome text on the login screen
|
||||
"welcome_sign": "Welcome to the Student Management System",
|
||||
# Copyright on the footer
|
||||
"copyright": "ADDRSSS",
|
||||
# theme
|
||||
# The model admin to search from the search bar, search bar omitted if excluded
|
||||
# "search_model": "auth.User",
|
||||
# Field name on user model that contains avatar ImageField/URLField/Charfield or a callable that receives the user
|
||||
"user_avatar": None,
|
||||
"version": False,
|
||||
############
|
||||
# Top Menu #
|
||||
############
|
||||
# Links to put along the top menu
|
||||
"topmenu_links": [
|
||||
# Url that gets reversed (Permissions can be added)
|
||||
{"name": "Home", "url": "admin:index", "permissions": ["auth.view_user"]},
|
||||
# external url that opens in a new window (Permissions can be added)
|
||||
# {"name": "Support", "url": "https://github.com/farridav/django-jazzmin/issues", "new_window": True},
|
||||
# model admin to link to (Permissions checked against model)
|
||||
# {"model": "auth.User"},
|
||||
# App with dropdown menu to all its models pages (Permissions checked against models)
|
||||
# {"app": "books"},
|
||||
],
|
||||
#############
|
||||
# User Menu #
|
||||
#############
|
||||
# Additional links to include in the user menu on the top right ("app" url type is not allowed)
|
||||
# "usermenu_links": [
|
||||
# {"name": "Support", "url": "https://github.com/farridav/django-jazzmin/issues", "new_window": True},
|
||||
# {"model": "auth.user"}
|
||||
# ],
|
||||
#
|
||||
#############
|
||||
# Side Menu #
|
||||
#############
|
||||
# Whether to display the side menu
|
||||
"show_sidebar": True,
|
||||
# Whether to aut expand the menu
|
||||
"navigation_expanded": True,
|
||||
# Hide these apps when generating side menu e.g (auth)
|
||||
"hide_apps": [],
|
||||
# Hide these models when generating side menu (e.g auth.user)
|
||||
"hide_models": [],
|
||||
# List of apps (and/or models) to base side menu ordering off of (does not need to contain all apps/models)
|
||||
"order_with_respect_to": ["auth", "dashboard", "course"],
|
||||
"custom_links": {
|
||||
"courses": [
|
||||
{"name": "Manage Courses", "url": "add_course", "icon": "fas fa-book"}
|
||||
],
|
||||
"menu": [
|
||||
{
|
||||
"name": "Dashboard",
|
||||
"url": "admin:index",
|
||||
"icon": "fas fa-tachometer-alt",
|
||||
},
|
||||
{
|
||||
"name": "Courses",
|
||||
"icon": "fas fa-book",
|
||||
"children": [
|
||||
{
|
||||
"name": "Manage Courses",
|
||||
"url": "add_course",
|
||||
"icon": "fas fa-plus",
|
||||
},
|
||||
{"name": "Course List", "model": "app.course"},
|
||||
],
|
||||
},
|
||||
{"name": "Students", "icon": "fas fa-users", "models": ["app.student"]},
|
||||
{
|
||||
"name": "Teachers",
|
||||
"icon": "fas fa-chalkboard-teacher",
|
||||
"models": ["app.teacher"],
|
||||
},
|
||||
{"name": "Staff", "icon": "fas fa-user-tie", "models": ["app.staff"]},
|
||||
{
|
||||
"name": "Academics",
|
||||
"icon": "fas fa-graduation-cap",
|
||||
"children": [
|
||||
{"model": "app.subject"},
|
||||
{"model": "app.academicyear"},
|
||||
{"model": "app.result"},
|
||||
{"model": "app.attendance"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"name": "Library",
|
||||
"icon": "fas fa-book-reader",
|
||||
"models": ["app.library"],
|
||||
},
|
||||
{
|
||||
"name": "Certificates",
|
||||
"icon": "fas fa-certificate",
|
||||
"models": ["app.certificate"],
|
||||
},
|
||||
{
|
||||
"name": "News & Events",
|
||||
"icon": "fas fa-newspaper",
|
||||
"models": ["app.newsevent"],
|
||||
},
|
||||
],
|
||||
"app": [
|
||||
{
|
||||
"name": "Dashboard",
|
||||
"url": "dashboard",
|
||||
"icon": "fas fa-tachometer-alt",
|
||||
},
|
||||
# {
|
||||
# "name": "course",
|
||||
# "url": "add_course",
|
||||
# },
|
||||
],
|
||||
},
|
||||
#################
|
||||
# Related Modal #
|
||||
#################
|
||||
# Use modals instead of popups
|
||||
"related_modal_active": False,
|
||||
#############
|
||||
# UI Tweaks #
|
||||
#############
|
||||
# Relative paths to custom CSS/JS scripts (must be present in static files)
|
||||
"custom_css": None,
|
||||
"custom_js": None,
|
||||
# Whether to show the UI customizer on the sidebar
|
||||
"show_ui_builder": False,
|
||||
###############
|
||||
# Change view #
|
||||
###############
|
||||
# Render out the change view as a single form, or in tabs, current options are
|
||||
# - single
|
||||
# - horizontal_tabs (default)
|
||||
# - vertical_tabs
|
||||
# - collapsible
|
||||
# - carousel
|
||||
"changeform_format": "horizontal_tabs",
|
||||
# override change forms on a per modeladmin basis
|
||||
"changeform_format_overrides": {
|
||||
"auth.user": "horizontal_tabs",
|
||||
"auth.group": "vertical_tabs",
|
||||
},
|
||||
}
|
||||
|
||||
JAZZMIN_UI_TWEAKS = {
|
||||
# "footer_fixed": True,
|
||||
"theme": "lumen",
|
||||
# "dark_mode_theme": "cyborg",
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
"""
|
||||
Django settings for student_management_system project.
|
||||
|
||||
Generated by 'django-admin startproject' using Django 5.1.4.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.1/topics/settings/
|
||||
|
||||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/5.1/ref/settings/
|
||||
"""
|
||||
|
||||
import os
|
||||
from student_management_system.jazzmin import JAZZMIN_SETTINGS, JAZZMIN_UI_TWEAKS
|
||||
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = "django-insecure-4^0p#+b(zk1vavtg#+f)i$hog(!v(v4=bsf*d#-v=kic)3%kbx"
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ["*", "192.168.18.225"]
|
||||
|
||||
JAZZMIN_SETTINGS = JAZZMIN_SETTINGS
|
||||
JAZZMIN_UI_TWEAKS = JAZZMIN_UI_TWEAKS
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
"jazzmin",
|
||||
"django.contrib.admin",
|
||||
"django.contrib.auth",
|
||||
"django.contrib.contenttypes",
|
||||
"django.contrib.sessions",
|
||||
"django.contrib.messages",
|
||||
"django.contrib.staticfiles",
|
||||
"app",
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
"django.middleware.common.CommonMiddleware",
|
||||
"django.middleware.csrf.CsrfViewMiddleware",
|
||||
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||
"django.contrib.messages.middleware.MessageMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
]
|
||||
|
||||
ROOT_URLCONF = "student_management_system.urls"
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [os.path.join(BASE_DIR, "templates")],
|
||||
"APP_DIRS": True,
|
||||
"OPTIONS": {
|
||||
"context_processors": [
|
||||
"django.template.context_processors.debug",
|
||||
"django.template.context_processors.request",
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
WSGI_APPLICATION = "student_management_system.wsgi.application"
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.sqlite3",
|
||||
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
|
||||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
||||
},
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
||||
},
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
||||
},
|
||||
{
|
||||
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
||||
},
|
||||
]
|
||||
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/5.1/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = "en-us"
|
||||
|
||||
TIME_ZONE = "Asia/Kathmandu"
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/5.1/howto/static-files/
|
||||
|
||||
STATIC_URL = "static/"
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, "static"),
|
||||
]
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
|
||||
|
||||
STATICFILES_FINDERS = [
|
||||
"django.contrib.staticfiles.finders.FileSystemFinder",
|
||||
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
|
||||
]
|
||||
|
||||
MEDIA_URL = "/media/"
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||
@@ -0,0 +1,32 @@
|
||||
"""
|
||||
URL configuration for student_management_system project.
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
https://docs.djangoproject.com/en/5.1/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, include
|
||||
from django.views.generic import RedirectView
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
|
||||
urlpatterns = (
|
||||
[
|
||||
path("admin/", admin.site.urls),
|
||||
path("", RedirectView.as_view(url="/admin/", permanent=False)),
|
||||
path("", include("app.urls")),
|
||||
]
|
||||
+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
WSGI config for student_management_system project.
|
||||
|
||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'student_management_system.settings')
|
||||
|
||||
application = get_wsgi_application()
|
||||
Reference in new issue
Block a user