0.0.1 init
This commit is contained in:
0
TWB/__init__.py
Normal file
0
TWB/__init__.py
Normal file
16
TWB/asgi.py
Normal file
16
TWB/asgi.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
ASGI config for TWB 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/4.2/howto/deployment/asgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'TWB.settings')
|
||||
|
||||
application = get_asgi_application()
|
||||
250
TWB/settings.py
Normal file
250
TWB/settings.py
Normal file
@@ -0,0 +1,250 @@
|
||||
"""
|
||||
Django settings for TWB project.
|
||||
|
||||
Generated by 'django-admin startproject' using Django 4.2.2.
|
||||
|
||||
For more information on this file, see
|
||||
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/
|
||||
"""
|
||||
|
||||
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/4.2/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'django-insecure-)q52-&03erd#(n#yje^)26^q8$jimfc154lhpu@cc8n*%kay^('
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django.contrib.humanize',
|
||||
]
|
||||
|
||||
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 = 'TWB.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',
|
||||
'django.template.context_processors.media',
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
WSGI_APPLICATION = 'TWB.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'twbDB',
|
||||
'USER': 'test_user',
|
||||
'PASSWORD': 'test_db_pass',
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '5432',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/4.2/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/4.2/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'ru-RU'
|
||||
|
||||
TIME_ZONE = 'Europe/Minsk'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
||||
|
||||
MEDIA_URL = '/media/'
|
||||
MEDIA_ROOT = 'media/'
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
STATIC_ROOT = '/'
|
||||
|
||||
STATICFILES_DIRS = [
|
||||
BASE_DIR / "static",
|
||||
]
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
|
||||
CKEDITOR_BASEPATH = "/static/ckeditor/ckeditor/"
|
||||
CKEDITOR_UPLOAD_PATH = "uploads/"
|
||||
|
||||
CKEDITOR_IMAGE_BACKEND = "pillow"
|
||||
|
||||
# CKEDITOR_BROWSE_SHOW_DIRS = True
|
||||
|
||||
CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'
|
||||
|
||||
CKEDITOR_CONFIGS = {
|
||||
'default': {
|
||||
'toolbar': 'Custom',
|
||||
'toolbar_Custom': [
|
||||
['Bold', 'Italic', 'Underline'],
|
||||
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
|
||||
['Link', 'Unlink'],
|
||||
['RemoveFormat', 'Source']
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CKEDITOR_OPTIONS = {
|
||||
'height': 291,
|
||||
'width': '95%',
|
||||
'filebrowserWindowHeight': 600,
|
||||
'filebrowserWindowWidth': "100%",
|
||||
'toolbar': 'YourCustomToolbarConfig',
|
||||
|
||||
'allowedContent': True,
|
||||
|
||||
'enterMode': 2,
|
||||
'basicEntities' : False,
|
||||
'entities_additional': '',
|
||||
'entities' : False,
|
||||
'htmlEncodeOutput' : False,
|
||||
'toolbar_Basic': [
|
||||
['Source', '-', 'Bold', 'Italic']
|
||||
],
|
||||
'toolbar_YourCustomToolbarConfig': [
|
||||
{'name': 'document', 'items': ['Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates']},
|
||||
{'name': 'clipboard', 'items': ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
|
||||
{'name': 'editing', 'items': ['Find', 'Replace', '-', 'SelectAll']},
|
||||
{'name': 'forms',
|
||||
'items': ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',
|
||||
'HiddenField']},
|
||||
'/',
|
||||
{'name': 'basicstyles',
|
||||
'items': ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},
|
||||
{'name': 'paragraph',
|
||||
'items': ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-',
|
||||
'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl',
|
||||
'Language']},
|
||||
{'name': 'links', 'items': ['Link', 'Unlink', 'Anchor']},
|
||||
{'name': 'insert',
|
||||
'items': ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe']},
|
||||
'/',
|
||||
{'name': 'styles', 'items': ['FontSize']},
|
||||
{'name': 'colors', 'items': ['TextColor', 'BGColor']},
|
||||
{'name': 'tools', 'items': ['Maximize', 'ShowBlocks']},
|
||||
# {'name': 'about', 'items': ['About']},
|
||||
'/', # put this to force next toolbar on new line
|
||||
# {'name': 'yourcustomtools', 'items': [
|
||||
# # put the name of your editor.ui.addButton here
|
||||
# 'Preview',
|
||||
# 'Maximize',
|
||||
#
|
||||
# ]},
|
||||
],
|
||||
|
||||
'tabSpaces': 4,
|
||||
'removePlugins': 'stylesheetparser',
|
||||
# 'extraPlugins': ','.join([
|
||||
# 'uploadimage', # the upload image feature
|
||||
# # your extra plugins here
|
||||
# 'div',
|
||||
# 'autolink',
|
||||
# 'autoembed',
|
||||
# 'embedsemantic',
|
||||
# 'autogrow',
|
||||
# # 'devtools',
|
||||
# 'widget',
|
||||
# 'lineutils',
|
||||
# 'clipboard',
|
||||
# 'dialog',
|
||||
# 'dialogui',
|
||||
# 'elementspath'
|
||||
# ]),
|
||||
|
||||
}
|
||||
|
||||
|
||||
try:
|
||||
from tEDataProj import db_local_sets
|
||||
DATABASES = db_local_sets.DATABASES
|
||||
except ImportError as e:
|
||||
pass
|
||||
|
||||
# global prod_server
|
||||
try:
|
||||
import local_sets
|
||||
SERVER_URL = local_sets.SERVER_URL
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
try:
|
||||
from settings_local import *
|
||||
except ImportError:
|
||||
print('settings_local fail')
|
||||
22
TWB/urls.py
Normal file
22
TWB/urls.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
URL configuration for TWB 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
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
16
TWB/wsgi.py
Normal file
16
TWB/wsgi.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
WSGI config for TWB 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/4.2/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'TWB.settings')
|
||||
|
||||
application = get_wsgi_application()
|
||||
Reference in New Issue
Block a user