This commit is contained in:
Adrian Amaglio 2020-04-30 18:46:01 +02:00
parent afdffffc3c
commit 0d8946bf56
2 changed files with 9 additions and 1 deletions

View File

@ -15,4 +15,4 @@ COPY ./main.py ./list.tpl ./
# I juste wanted to change the socket owner but it turned out I needed to change thu uwsgi user
#CMD uwsgi --exec-asap 'chown $UID:$UID /tmp/uwsgi/ ; mkdir -p $BASE_PATH && chown $UID:$UID $BASE_PATH' -s /tmp/uwsgi/uwsgi.sock --uid $UID --manage-script-name --mount /=server:app
# --log-master makes 500 error on 30s timeout for every valid http request
CMD uwsgi --chown-socket $UID -s /tmp/uwsgi/uwsgi.sock --manage-script-name --mount $MOUNT=main:app
CMD uwsgi --logto2 /dev/stdout --chown-socket $UID -s /tmp/uwsgi/uwsgi.sock --manage-script-name --mount $MOUNT=main:app

View File

@ -6,6 +6,7 @@ import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import os
import sys # to print ot stderr
import re
import pymongo
from dotenv import load_dotenv
@ -95,6 +96,13 @@ mongodb_database = mongodb_client[mongodb_dbname]
form_regex = '\{\{(\w+)(\|\w+)?\}\}'
@app.post('/fail')
@app.post('/fail/')
def fail ():
a = 2/0
print('lol, failed', file=sys.stderr)
return 'failed'
@app.post('/submit')
@app.post('/submit/')
def submission ():