mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 02:24:20 +00:00
Change some email settings. MAIL_DEFAULT_SENDER removed.
This commit is contained in:
parent
8a9db7f4b8
commit
7dd27fb007
12
app/email.py
12
app/email.py
@ -10,10 +10,12 @@ def send_async_email(app, msg):
|
||||
|
||||
|
||||
def send_email(to, subject, template, **kwargs):
|
||||
msg = Message('[nopaque] {}'.format(subject), recipients=[to])
|
||||
msg.body = render_template(template + '.txt.j2', **kwargs)
|
||||
msg.html = render_template(template + '.html.j2', **kwargs)
|
||||
thread = Thread(target=send_async_email,
|
||||
args=(current_app._get_current_object(), msg))
|
||||
app = current_app._get_current_object()
|
||||
msg = Message(
|
||||
'{} {}'.format(app.config['NOPAQUE_MAIL_SUBJECT_PREFIX'], subject),
|
||||
recipients=[to], sender=app.config['NOPAQUE_MAIL_SENDER'])
|
||||
msg.body = render_template('{}.txt.j2'.format(template), **kwargs)
|
||||
msg.html = render_template('{}.html.j2'.format(template), **kwargs)
|
||||
thread = Thread(target=send_async_email, args=(app, msg))
|
||||
thread.start()
|
||||
return thread
|
||||
|
10
config.py
10
config.py
@ -12,14 +12,15 @@ class Config:
|
||||
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS').lower() == 'true'
|
||||
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
|
||||
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
|
||||
MAIL_DEFAULT_SENDER = os.environ.get('MAIL_DEFAULT_SENDER')
|
||||
|
||||
''' ### Flask-SQLAlchemy ### '''
|
||||
SQLALCHEMY_ENGINE_OPTIONS = {'pool_size': 30, 'pool_timeout': 30}
|
||||
SQLALCHEMY_RECORD_QUERIES = True
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
|
||||
''' ### Opaque ### '''
|
||||
''' ### nopaque ### '''
|
||||
NOPAQUE_ADMIN = os.environ.get('NOPAQUE_ADMIN')
|
||||
NOPAQUE_MAIL_SENDER = os.environ.get('NOPAQUE_MAIL_SENDER')
|
||||
NOPAQUE_MAIL_SUBJECT_PREFIX = '[nopaque]'
|
||||
NOPAQUE_STORAGE = os.environ.get('NOPAQUE_STORAGE')
|
||||
|
||||
@staticmethod
|
||||
@ -35,8 +36,7 @@ class DevelopmentConfig(Config):
|
||||
SQLALCHEMY_DATABASE_URI = 'postgresql://{}:{}@db/{}'.format(
|
||||
os.environ.get('POSTGRES_USER'),
|
||||
os.environ.get('POSTGRES_PASSWORD'),
|
||||
os.environ.get('POSTGRES_DB_NAME')
|
||||
)
|
||||
os.environ.get('POSTGRES_DB_NAME'))
|
||||
if not os.path.isfile('logs/nopaque.log'):
|
||||
file_path = os.path.join(os.getcwd(), 'logs/nopaque.log')
|
||||
log = open(file_path, 'w+')
|
||||
|
@ -22,11 +22,11 @@ MAIL_PORT=
|
||||
MAIL_USE_TLS=
|
||||
MAIL_USERNAME=
|
||||
MAIL_PASSWORD=
|
||||
MAIL_DEFAULT_SENDER=
|
||||
|
||||
### Gunicorn ###
|
||||
GUNICORN_WORKERS=
|
||||
|
||||
### nopaque ###
|
||||
NOPAQUE_ADMIN=
|
||||
NOPAQUE_MAIL_SENDER
|
||||
NOPAQUE_STORAGE=
|
||||
|
27
notes.txt
27
notes.txt
@ -1,27 +0,0 @@
|
||||
<div class="col s12 m6">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<span class="card-title">File setup</span>
|
||||
<p>To use the <a href="{{ url_for('services.service', service='ocr') }}">OCR</a> service offered here, the input data provided for this purpose must be available either as PDF or multipage TIFF files. However, image files are usually only available as PNG, JPEG or singlepage TIFF files. This service converts the uploaded image files into the correct file format for the <a href="{{ url_for('services.service', service='ocr') }}">OCR</a> service.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col s12 m6">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<span class="card-title">Optical Character Recognition</span>
|
||||
<p>Der hier zur Verfügung gestellte Dienst basiert auf dem Verfahren der optischen Zeichenerkennung. Dabei werden durch optische Analysemethoden und einen anschließenden Abgleich mit Wörterbüchern aus Bilddaten, wie Fotos oder Scans, Textdaten erzeugt. Erst dieser Vorverarbeitungsschritt ermöglicht eine computergestützte Verarbeitung von Dokumenten.</p>
|
||||
<p>Die Ausgabe dieses Dienstes erfolgt in Form von Textdateien, PDF Dateien mit hinterlegtem Text und <a href="https://tei-c.org/guidelines/p5/" target="_blank">TEI P5</a> konformen XML Dateien.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col s12 m6">
|
||||
<div class="card">
|
||||
<div class="card-content">
|
||||
<span class="card-title">Natural Language Processing</span>
|
||||
<p>Mit Hilfe computergestützter linguistischer Datenverarbeitungsmethoden können Textdateien mit weiteren Informationen angereichert werden. Auf dieser Plattform werden derzeit die im folgenden aufgeführten Textverarbeitungsroutinen in automatisierter Form zur Verfügung gestellt.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user