Reformat with black
This commit is contained in:
parent
ed72411c22
commit
023e892964
5 changed files with 128 additions and 138 deletions
20
setup.py
20
setup.py
|
|
@ -3,22 +3,20 @@
|
|||
from setuptools import find_packages, setup
|
||||
|
||||
setup(
|
||||
name='strojnadzor',
|
||||
version='0.0.1',
|
||||
description='Strojnadzor site',
|
||||
author='Andrey Golovizin',
|
||||
author_email='ag@sologoc.com',
|
||||
url='https://golovizin.ru/',
|
||||
license='AGPLv3',
|
||||
platforms=['platform-independent'],
|
||||
name="strojnadzor",
|
||||
version="0.0.1",
|
||||
description="Strojnadzor site",
|
||||
author="Andrey Golovizin",
|
||||
author_email="ag@sologoc.com",
|
||||
url="https://golovizin.ru/",
|
||||
license="AGPLv3",
|
||||
platforms=["platform-independent"],
|
||||
packages=find_packages("src"),
|
||||
package_dir={"": "src"},
|
||||
# install_requires=install_requires,
|
||||
# extras_require=extras_require,
|
||||
include_package_data=True,
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'strojnadzor-admin = strojnadzor.__main__:main',
|
||||
],
|
||||
"console_scripts": ["strojnadzor-admin = strojnadzor.__main__:main",],
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import sys
|
|||
|
||||
|
||||
def main():
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'strojnadzor.settings')
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "strojnadzor.settings")
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
except ImportError as exc:
|
||||
|
|
@ -17,5 +17,5 @@ def main():
|
|||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import os # isort:skip
|
||||
|
||||
gettext = lambda s: s
|
||||
DATA_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
"""
|
||||
|
|
@ -23,7 +24,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|||
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = '15-d*6bl(@+jfo92@=67vi1ohx%3e&^l98*bo*v$$+ms%!l(!!'
|
||||
SECRET_KEY = "15-d*6bl(@+jfo92@=67vi1ohx%3e&^l98*bo*v$$+ms%!l(!!"
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
|
@ -34,47 +35,35 @@ ALLOWED_HOSTS = []
|
|||
# Application definition
|
||||
|
||||
|
||||
ROOT_URLCONF = "strojnadzor.urls"
|
||||
|
||||
|
||||
|
||||
ROOT_URLCONF = 'strojnadzor.urls'
|
||||
|
||||
|
||||
|
||||
WSGI_APPLICATION = 'strojnadzor.wsgi.application'
|
||||
WSGI_APPLICATION = "strojnadzor.wsgi.application"
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
|
||||
|
||||
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/2.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',
|
||||
"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/2.2/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'ru'
|
||||
LANGUAGE_CODE = "ru"
|
||||
|
||||
TIME_ZONE = 'Europe/Prague'
|
||||
TIME_ZONE = "Europe/Prague"
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
|
|
@ -86,38 +75,36 @@ USE_TZ = True
|
|||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/2.2/howto/static-files/
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
MEDIA_URL = '/media/'
|
||||
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
|
||||
STATIC_ROOT = os.path.join(DATA_DIR, 'static')
|
||||
STATIC_URL = "/static/"
|
||||
MEDIA_URL = "/media/"
|
||||
MEDIA_ROOT = os.path.join(DATA_DIR, "media")
|
||||
STATIC_ROOT = os.path.join(DATA_DIR, "static")
|
||||
|
||||
STATICFILES_DIRS = (
|
||||
os.path.join(BASE_DIR, 'strojnadzor', 'static'),
|
||||
)
|
||||
STATICFILES_DIRS = (os.path.join(BASE_DIR, "strojnadzor", "static"),)
|
||||
SITE_ID = 1
|
||||
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [os.path.join(BASE_DIR, 'strojnadzor', 'templates'),],
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
'django.template.context_processors.i18n',
|
||||
'django.template.context_processors.debug',
|
||||
'django.template.context_processors.request',
|
||||
'django.template.context_processors.media',
|
||||
'django.template.context_processors.csrf',
|
||||
'django.template.context_processors.tz',
|
||||
'sekizai.context_processors.sekizai',
|
||||
'django.template.context_processors.static',
|
||||
'cms.context_processors.cms_settings'
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [os.path.join(BASE_DIR, "strojnadzor", "templates"),],
|
||||
"OPTIONS": {
|
||||
"context_processors": [
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
"django.template.context_processors.i18n",
|
||||
"django.template.context_processors.debug",
|
||||
"django.template.context_processors.request",
|
||||
"django.template.context_processors.media",
|
||||
"django.template.context_processors.csrf",
|
||||
"django.template.context_processors.tz",
|
||||
"sekizai.context_processors.sekizai",
|
||||
"django.template.context_processors.static",
|
||||
"cms.context_processors.cms_settings",
|
||||
],
|
||||
'loaders': [
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader'
|
||||
"loaders": [
|
||||
"django.template.loaders.filesystem.Loader",
|
||||
"django.template.loaders.app_directories.Loader",
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
@ -125,82 +112,81 @@ TEMPLATES = [
|
|||
|
||||
|
||||
MIDDLEWARE = [
|
||||
'cms.middleware.utils.ApphookReloadMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.locale.LocaleMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
'cms.middleware.user.CurrentUserMiddleware',
|
||||
'cms.middleware.page.CurrentPageMiddleware',
|
||||
'cms.middleware.toolbar.ToolbarMiddleware',
|
||||
'cms.middleware.language.LanguageCookieMiddleware'
|
||||
"cms.middleware.utils.ApphookReloadMiddleware",
|
||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
"django.middleware.csrf.CsrfViewMiddleware",
|
||||
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||
"django.contrib.messages.middleware.MessageMiddleware",
|
||||
"django.middleware.locale.LocaleMiddleware",
|
||||
"django.middleware.common.CommonMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
"cms.middleware.user.CurrentUserMiddleware",
|
||||
"cms.middleware.page.CurrentPageMiddleware",
|
||||
"cms.middleware.toolbar.ToolbarMiddleware",
|
||||
"cms.middleware.language.LanguageCookieMiddleware",
|
||||
]
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'absolute',
|
||||
'aldryn_forms',
|
||||
'aldryn_forms.contrib.email_notifications',
|
||||
'captcha',
|
||||
'cms',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.sitemaps',
|
||||
'django.contrib.sites',
|
||||
'django.contrib.staticfiles',
|
||||
'djangocms_admin_style',
|
||||
'djangocms_file',
|
||||
'djangocms_googlemap',
|
||||
'djangocms_icon',
|
||||
'djangocms_link',
|
||||
'djangocms_picture',
|
||||
'djangocms_snippet',
|
||||
'djangocms_style',
|
||||
'djangocms_text_ckeditor',
|
||||
'djangocms_video',
|
||||
'easy_thumbnails',
|
||||
'emailit',
|
||||
'filer',
|
||||
'menus',
|
||||
'sekizai',
|
||||
'treebeard',
|
||||
|
||||
'strojnadzor'
|
||||
"absolute",
|
||||
"aldryn_forms",
|
||||
"aldryn_forms.contrib.email_notifications",
|
||||
"captcha",
|
||||
"cms",
|
||||
"django.contrib.admin",
|
||||
"django.contrib.auth",
|
||||
"django.contrib.contenttypes",
|
||||
"django.contrib.messages",
|
||||
"django.contrib.sessions",
|
||||
"django.contrib.sitemaps",
|
||||
"django.contrib.sites",
|
||||
"django.contrib.staticfiles",
|
||||
"djangocms_admin_style",
|
||||
"djangocms_file",
|
||||
"djangocms_googlemap",
|
||||
"djangocms_icon",
|
||||
"djangocms_link",
|
||||
"djangocms_picture",
|
||||
"djangocms_snippet",
|
||||
"djangocms_style",
|
||||
"djangocms_text_ckeditor",
|
||||
"djangocms_video",
|
||||
"easy_thumbnails",
|
||||
"emailit",
|
||||
"filer",
|
||||
"menus",
|
||||
"sekizai",
|
||||
"treebeard",
|
||||
"strojnadzor",
|
||||
]
|
||||
|
||||
LANGUAGES = (
|
||||
## Customize this
|
||||
('ru', gettext('ru')),
|
||||
("ru", gettext("ru")),
|
||||
)
|
||||
|
||||
CMS_LANGUAGES = {
|
||||
## Customize this
|
||||
1: [
|
||||
{
|
||||
'code': 'ru',
|
||||
'name': gettext('ru'),
|
||||
'redirect_on_fallback': True,
|
||||
'public': True,
|
||||
'hide_untranslated': False,
|
||||
"code": "ru",
|
||||
"name": gettext("ru"),
|
||||
"redirect_on_fallback": True,
|
||||
"public": True,
|
||||
"hide_untranslated": False,
|
||||
},
|
||||
],
|
||||
'default': {
|
||||
'redirect_on_fallback': True,
|
||||
'public': True,
|
||||
'hide_untranslated': False,
|
||||
"default": {
|
||||
"redirect_on_fallback": True,
|
||||
"public": True,
|
||||
"hide_untranslated": False,
|
||||
},
|
||||
}
|
||||
|
||||
CMS_TEMPLATES = (
|
||||
## Customize this
|
||||
('fullwidth.html', 'Fullwidth'),
|
||||
('sidebar_left.html', 'Sidebar Left'),
|
||||
('sidebar_right.html', 'Sidebar Right')
|
||||
("fullwidth.html", "Fullwidth"),
|
||||
("sidebar_left.html", "Sidebar Left"),
|
||||
("sidebar_right.html", "Sidebar Right"),
|
||||
)
|
||||
|
||||
CMS_PERMISSION = False
|
||||
|
|
@ -208,25 +194,25 @@ CMS_PERMISSION = False
|
|||
CMS_PLACEHOLDER_CONF = {}
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'CONN_MAX_AGE': 0,
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'HOST': 'localhost',
|
||||
'NAME': 'project.db',
|
||||
'PASSWORD': '',
|
||||
'PORT': '',
|
||||
'USER': ''
|
||||
"default": {
|
||||
"CONN_MAX_AGE": 0,
|
||||
"ENGINE": "django.db.backends.sqlite3",
|
||||
"HOST": "localhost",
|
||||
"NAME": "project.db",
|
||||
"PASSWORD": "",
|
||||
"PORT": "",
|
||||
"USER": "",
|
||||
}
|
||||
}
|
||||
|
||||
THUMBNAIL_PROCESSORS = (
|
||||
'easy_thumbnails.processors.colorspace',
|
||||
'easy_thumbnails.processors.autocrop',
|
||||
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
|
||||
'easy_thumbnails.processors.filters'
|
||||
"easy_thumbnails.processors.colorspace",
|
||||
"easy_thumbnails.processors.autocrop",
|
||||
"filer.thumbnail_processors.scale_and_crop_with_subject_location",
|
||||
"easy_thumbnails.processors.filters",
|
||||
)
|
||||
|
||||
DJANGOCMS_PICTURE_RESPONSIVE_IMAGES = True
|
||||
DJANGOCMS_PICTURE_RESPONSIVE_IMAGES_VIEWPORT_BREAKPOINTS = [300, 400, 576, 768]
|
||||
|
||||
DEFAULT_FROM_EMAIL = 'noreply@sologoc.com'
|
||||
DEFAULT_FROM_EMAIL = "noreply@sologoc.com"
|
||||
|
|
|
|||
|
|
@ -12,19 +12,25 @@ from django.views.static import serve
|
|||
admin.autodiscover()
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^sitemap\.xml$', sitemap,
|
||||
{'sitemaps': {'cmspages': CMSSitemap}}),
|
||||
url(r"^sitemap\.xml$", sitemap, {"sitemaps": {"cmspages": CMSSitemap}}),
|
||||
]
|
||||
|
||||
urlpatterns += [
|
||||
url(r'^admin/', admin.site.urls), # NOQA
|
||||
url(r'^captcha/', include('captcha.urls')),
|
||||
url(r'^', include('cms.urls')),
|
||||
url(r"^admin/", admin.site.urls), # NOQA
|
||||
url(r"^captcha/", include("captcha.urls")),
|
||||
url(r"^", include("cms.urls")),
|
||||
]
|
||||
|
||||
# This is only needed when using runserver.
|
||||
if settings.DEBUG:
|
||||
urlpatterns = [
|
||||
url(r'^media/(?P<path>.*)$', serve,
|
||||
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
|
||||
] + staticfiles_urlpatterns() + urlpatterns
|
||||
urlpatterns = (
|
||||
[
|
||||
url(
|
||||
r"^media/(?P<path>.*)$",
|
||||
serve,
|
||||
{"document_root": settings.MEDIA_ROOT, "show_indexes": True},
|
||||
),
|
||||
]
|
||||
+ staticfiles_urlpatterns()
|
||||
+ urlpatterns
|
||||
)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@ import os
|
|||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'strojnadzor.settings')
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "strojnadzor.settings")
|
||||
|
||||
application = get_wsgi_application()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue