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