Fixed Flask not choosing new name for uploading

Moved uploading and removing files to APIs
Added max file upload to config from yml file
Jquery is now a file not a CDN
General Sass(y) fixes
This commit is contained in:
Michał Gdula 2023-01-11 19:46:31 +00:00
parent 5db8fa52e8
commit 2455d3f88c
13 changed files with 131 additions and 95 deletions

View file

@ -32,13 +32,13 @@ def create_app(test_config=None):
with open(os.path.join(app.root_path, 'user', 'conf.yml'), 'r') as f:
conf = yaml.load(f, Loader=yaml.FullLoader)
print("Loaded config")
print(conf['upload']['allowed-extensions'])
# App configuration
app.config.from_mapping(
SECRET_KEY=os.environ.get('FLASK_SECRET'),
DATABASE=os.path.join(app.instance_path, 'gallery.sqlite'),
UPLOAD_FOLDER=os.path.join(app.root_path, 'user', 'uploads'),
MAX_CONTENT_LENGTH = 1024 * 1024 * conf['upload']['max-size'],
ALLOWED_EXTENSIONS=conf['upload']['allowed-extensions'],
)