1
1
Fork 0

Configs for deployment,

the css
dev
Jan Kužílek 5 years ago
parent 713f565e26
commit 4ff472ee2b

@ -1,4 +1,5 @@
import os import os
import shutil
from flask import Flask from flask import Flask
from flask_sqlalchemy import SQLAlchemy from flask_sqlalchemy import SQLAlchemy
@ -19,26 +20,34 @@ assets = AssetsEnvironment()
def create_app(): def create_app():
app = Flask(__name__) app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping( app.config.from_pyfile('config.py')
SECRET_KEY='dev', app.config.from_mapping(POST_UPLOADS=os.path.join(app.instance_path, 'post'), SQLALCHEMY_TRACK_MODIFICATIONS=False)
#SQLALCHEMY_DATABASE_URI='sqlite:///{}'.format(os.path.join(app.instance_path, 'yadc.db')), # app.config.from_mapping(
SQLALCHEMY_DATABASE_URI='postgresql://{}:{}@{}:{}/{}'.format('yadc', 'omegalul', 'localhost', 5432, 'yadc'), # SECRET_KEY='dev',
MAX_CONTENT_LENGTH=10*1024*1024, # #SQLALCHEMY_DATABASE_URI='sqlite:///{}'.format(os.path.join(app.instance_path, 'yadc.db')),
POST_LIST_THUMB_HEIGHT=200, # SQLALCHEMY_DATABASE_URI='postgresql://{}:{}@{}:{}/{}'.format('yadc', 'omegalul', 'localhost', 5432, 'yadc'),
POST_UPLOADS=os.path.join(app.instance_path, 'post'), # MAX_CONTENT_LENGTH=10*1024*1024,
INSTANCE_NAME='Darkne.su', # POST_LIST_THUMB_HEIGHT=200,
POSTS_PER_PAGE=8, # POST_UPLOADS=os.path.join(app.instance_path, 'post'),
MANAGE_USERS_PER_PAGE=2, # INSTANCE_NAME='Darkne.su',
MANAGE_POSTS_PER_PAGE=2, # POSTS_PER_PAGE=8,
# MANAGE_USERS_PER_PAGE=2,
ALLOW_REGISTER=False, # MANAGE_POSTS_PER_PAGE=2,
SQLALCHEMY_ECHO=True, # ALLOW_REGISTER=False,
)
# SQLALCHEMY_ECHO=True,
# )
try: try:
os.makedirs(app.instance_path) os.makedirs(app.instance_path)
# os.makedirs(app.config.get('POST_UPLOADS'))
for d in ['img', 'jpeg', 'sample', 'thumb']:
os.makedirs(os.path.join(app.config.get('POST_UPLOADS'), d))
# shutil.copyfile(os.path.join(app.root_path, 'config.def.py'), os.path.join(app.instance_path, 'config.py'))
except OSError: except OSError:
pass pass

@ -0,0 +1,14 @@
INSTANCE_NAME = 'Darkne.su'
ALLOW_REGISTER = False
SECRET_KEY = '<place your key here>'
# SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = 'postgresql://{}:{}@{}:{}/{}'.format('yadc', 'password', 'localhost', 5432, 'yadc')
MAX_CONTENT_LENGTH = 10*1024*1024
POST_LIST_THUMB_HEIGHT = 200
POSTS_PER_PAGE = 8
MANAGE_USERS_PER_PAGE = 8
MANAGE_POSTS_PER_PAGE = 8

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save