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 shutil
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
@ -19,26 +20,34 @@ assets = AssetsEnvironment()
def create_app():
app = Flask(__name__)
app.config.from_mapping(
SECRET_KEY='dev',
#SQLALCHEMY_DATABASE_URI='sqlite:///{}'.format(os.path.join(app.instance_path, 'yadc.db')),
SQLALCHEMY_DATABASE_URI='postgresql://{}:{}@{}:{}/{}'.format('yadc', 'omegalul', 'localhost', 5432, 'yadc'),
MAX_CONTENT_LENGTH=10*1024*1024,
POST_LIST_THUMB_HEIGHT=200,
POST_UPLOADS=os.path.join(app.instance_path, 'post'),
INSTANCE_NAME='Darkne.su',
POSTS_PER_PAGE=8,
MANAGE_USERS_PER_PAGE=2,
MANAGE_POSTS_PER_PAGE=2,
ALLOW_REGISTER=False,
SQLALCHEMY_ECHO=True,
)
app = Flask(__name__, instance_relative_config=True)
app.config.from_pyfile('config.py')
app.config.from_mapping(POST_UPLOADS=os.path.join(app.instance_path, 'post'), SQLALCHEMY_TRACK_MODIFICATIONS=False)
# app.config.from_mapping(
# SECRET_KEY='dev',
# #SQLALCHEMY_DATABASE_URI='sqlite:///{}'.format(os.path.join(app.instance_path, 'yadc.db')),
# SQLALCHEMY_DATABASE_URI='postgresql://{}:{}@{}:{}/{}'.format('yadc', 'omegalul', 'localhost', 5432, 'yadc'),
# MAX_CONTENT_LENGTH=10*1024*1024,
# POST_LIST_THUMB_HEIGHT=200,
# POST_UPLOADS=os.path.join(app.instance_path, 'post'),
# INSTANCE_NAME='Darkne.su',
# POSTS_PER_PAGE=8,
# MANAGE_USERS_PER_PAGE=2,
# MANAGE_POSTS_PER_PAGE=2,
# ALLOW_REGISTER=False,
# SQLALCHEMY_ECHO=True,
# )
try:
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:
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