applications renamed to app

This commit is contained in:
Software Shinobi
2026-02-10 03:01:40 -05:00
parent 7c2b1dced1
commit 2218991ff6
10 changed files with 1577 additions and 7 deletions

6
app/__init__.py Normal file
View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
__VERSION__ = "1.6.28"
__RELEASE_DATE__ = "20-Jul-2023"
__AUTHOR__ = "Agus Makmun (Summon Agus)"
__AUTHOR_EMAIL__ = "summon.agus@gmail.com"

16
app/asgi.py Normal file
View File

@@ -0,0 +1,16 @@
"""
ASGI config for application 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/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
application = get_asgi_application()

165
app/settings.py Normal file
View File

@@ -0,0 +1,165 @@
"""
Django settings for card players unite project.
Generated by 'django-admin startproject' using Django 3.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '7!%*_%*0x9*#-k*1$b$^dax14hu2tazzrvk5tvj@#7vlg*h0ni'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['localhost']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'corsheaders',
'player',
'tournament',
]
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',
"corsheaders.middleware.CorsMiddleware",
]
CORS_ALLOWED_ORIGINS = [
"https://example.com",
"https://sub.example.com",
"http://localhost:8000",
"http://127.0.0.1:9000",
]
CORS_ORIGIN_ALLOW_ALL = True
ROOT_URLCONF = 'app.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [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 = 'app.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'maverickdb', 'USER': 'maverickdb', 'PASSWORD': 'maverickdb', 'HOST': 'card-players-unite-postgres', 'PORT': '5432', } }
# Password validation
# https://docs.djangoproject.com/en/3.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/3.1/topics/i18n/
##LANGUAGE_CODE = 'en-us'
##TIME_ZONE = 'UTC'
##USE_I18N = True
##USE_L10N = True
##USE_TZ = True
##########################################
LOGIN_REDIRECT_URL = "home"
LOGOUT_REDIRECT_URL = 'logout1'
#SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_COOKIE_AGE = 180 # 3 minutes. "1209600(2 weeks)" by default
#SESSION_SAVE_EVERY_REQUEST = True # "False" by default
##########################################
## https://www.w3schools.com/django/django_add_css_file_global.php
STATIC_URL = 'static/'
STATICFILES_DIRS = [
BASE_DIR / "static"
]
##########################################

21
app/urls.py Normal file
View File

@@ -0,0 +1,21 @@
from django.contrib import admin
from django.urls import path, include
from django.views.generic.base import TemplateView
from . import views
urlpatterns = [
path("", TemplateView.as_view(template_name="listing.html"), name="listing"),
path("home", TemplateView.as_view(template_name="home.html"), name="home"),
path('tournament/', include('tournament.urls')),
path("player/", include("player.urls")),
path("player/", include("django.contrib.auth.urls")),
]

22
app/views.py Normal file
View File

@@ -0,0 +1,22 @@
from django.shortcuts import render
from rest_framework import generics
from django.http import HttpResponse
from django.template import loader
## https://docs.djangoproject.com/en/4.2/intro/tutorial03/
def home(request):
print("home home")
template = loader.get_template("home.html")
context = {
"key": "value",
}
return HttpResponse(template.render(context, request))

16
app/wsgi.py Normal file
View File

@@ -0,0 +1,16 @@
"""
WSGI config for application 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/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
application = get_wsgi_application()