This commit is contained in:
2018-08-31 17:48:29 +03:00
parent be28af1ccb
commit 48ebf82a1f
44 changed files with 645 additions and 28077 deletions

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
__author__ = 'RemiZOffAlex'
__copyright__ = '(c) RemiZOffAlex'
__license__ = 'MIT'
__email__ = 'remizoffalex@mail.ru'
CONFIG = 'config.demo'

33
deploy/config/demo.py Normal file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
__author__ = 'RemiZOffAlex'
__copyright__ = '(c) RemiZOffAlex'
__license__ = 'MIT'
__email__ = 'remizoffalex@mail.ru'
import os
import sys
# Конфигурация
DEBUG = True
SQLDEBUG = False
SESSION_COOKIE_NAME = 'myapp'
SESSION_TYPE = 'filesystem'
TITLE = 'Проект'
DIR_BASE = '/'.join(os.path.dirname(os.path.abspath(__file__)).split('/')[:-1])
DIR_DATA = DIR_BASE + '/data'
DIR_FILES = DIR_DATA + '/files'
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + DIR_DATA + '/db.sqlite3'
# Генерировать можно утилитой pwgen
# Пример:
# pwgen -sy 64
SECRET_KEY = '''0123456789'''
# Логирование
LOG_FILE = DIR_DATA + '/myapp.log'
LONG_LOG_FORMAT = '%(asctime)s - [%(name)s.%(levelname)s] [%(threadName)s, %(module)s.%(funcName)s@%(lineno)d] %(message)s'
LOG_FILE_SIZE = 128 # Размер файла лога в МБ

10
deploy/nginx/myapp.conf Normal file
View File

@@ -0,0 +1,10 @@
server {
listen 80;
server_name myapp www.myapp;
access_log /var/log/nginx/myapp-access.log mainproxy;
error_log /var/log/nginx/myapp-error.log info;
location / {
include uwsgi_params;
uwsgi_pass unix:///var/run/uwsgi/myapp.sock;
}
}

6
deploy/requirements.txt Normal file
View File

@@ -0,0 +1,6 @@
wtforms
flask
sqlalchemy
sqlalchemy-utils
alembic
celery

8
deploy/uwsgi/myapp.ini Normal file
View File

@@ -0,0 +1,8 @@
[uwsgi]
chdir = /home/user/myapp
logto = /home/user/myapp/logs/myapp.log
wsgi-file = /home/user/myapp/wsgi.py
py-autoreload = 10
uid = user
gid = user