automated push from the terminal
This commit is contained in:
6
application/__init__.py
Normal file
6
application/__init__.py
Normal 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
application/asgi.py
Normal file
16
application/asgi.py
Normal 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', 'application.settings')
|
||||
|
||||
application = get_asgi_application()
|
||||
173
application/settings.py
Normal file
173
application/settings.py
Normal file
@@ -0,0 +1,173 @@
|
||||
"""
|
||||
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 = 'application.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 = 'application.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':'localhost',
|
||||
'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
application/urls.py
Normal file
21
application/urls.py
Normal 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
application/views.py
Normal file
22
application/views.py
Normal 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
application/wsgi.py
Normal file
16
application/wsgi.py
Normal 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', 'application.settings')
|
||||
|
||||
application = get_wsgi_application()
|
||||
Reference in New Issue
Block a user