Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions portal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
from flask import Flask
from flask_wtf.csrf import CSRFProtect
from datetime import timedelta
import json

# from flask import Markup
from flask_misaka import markdown
from flask_misaka import Misaka
import logging.handlers
import logging
import sys

__author__ = 'Jeremy Van <jeremyvan@uchicago.edu>'
__author__ = "MANIAC Lab <gardnergroup@lists.uchicago.edu>"

app = Flask(__name__)
# Enable CSRF protection globally for Flask app
Expand All @@ -26,13 +23,24 @@
print("Could not read config location from {}".format(sys.argv[1]))
else:
print("Reading config file from local directory")
app.config.from_pyfile('portal.conf')
app.config.from_pyfile("portal.conf")

app.url_map.strict_slashes = False
app.permanent_session_lifetime = timedelta(minutes=1440)
app.config.update(SESSION_COOKIE_SECURE=True, SESSION_COOKIE_HTTPONLY=True, SESSION_COOKIE_SAMESITE='Lax')
app.config.update(
SESSION_COOKIE_SECURE=True,
SESSION_COOKIE_HTTPONLY=True,
SESSION_COOKIE_SAMESITE="Lax",
)
# set up Markdown Rendering
md = Misaka()
md.__init__(app, tables=True, autolink=True, fenced_code=True, smartypants=True, quote=True, math=True, math_explicit=True)

import portal.views
md.__init__(
app,
tables=True,
autolink=True,
fenced_code=True,
smartypants=True,
quote=True,
math=True,
math_explicit=True,
)
Loading