From 4b7e44cbf7630cda25b8e5343b8e2f29d2e0c9b8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 3 Oct 2021 21:53:14 +0200 Subject: [PATCH] sfdsfd --- docker-compose.yml | 1 - env | 1 - files/__main__.py | 10 +++++----- files/routes/static.py | 10 +++++++++- requirements.txt | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f6589b894..72ed0746d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,7 +20,6 @@ services: - DISCORD_CLIENT_ID=3435tdfsdudebussylmaoxxt43 - DISCORD_CLIENT_SECRET=3435tdfsdudebussylmaoxxt43 - DISCORD_BOT_TOKEN=3435tdfsdudebussylmaoxxt43 - - CATBOX_KEY=3435tdfsdudebussylmaoxxt43 #- HCAPTCHA_SITEKEY=3435tdfsdudebussylmaoxxt43 - HCAPTCHA_SECRET=3435tdfsdudebussylmaoxxt43 - YOUTUBE_KEY=3435tdfsdudebussylmaoxxt43 diff --git a/env b/env index 732244adc..0a937e482 100644 --- a/env +++ b/env @@ -10,7 +10,6 @@ export DISCORD_SERVER_ID="3435tdfsdudebussylmaoxxt43" export DISCORD_CLIENT_ID="3435tdfsdudebussylmaoxxt43" export DISCORD_CLIENT_SECRET="3435tdfsdudebussylmaoxxt43" export DISCORD_BOT_TOKEN="3435tdfsdudebussylmaoxxt43" -export CATBOX_KEY="3435tdfsdudebussylmaoxxt43" export HCAPTCHA_SECRET="3435tdfsdudebussylmaoxxt43" export YOUTUBE_KEY="3435tdfsdudebussylmaoxxt43" export PUSHER_KEY="3435tdfsdudebussylmaoxxt43" diff --git a/files/__main__.py b/files/__main__.py index 00261611c..2d8bed376 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -7,7 +7,8 @@ from flask_caching import Cache from flask_limiter import Limiter from flask_compress import Compress from flask_limiter.util import get_ipaddr -from flaskext.markdown import Markdown +from flask_mail import Mail + from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, scoped_session from sqlalchemy import * @@ -63,10 +64,6 @@ app.config["RATELIMIT_STORAGE_URL"] = environ.get("REDIS_URL", "redis://127.0.0. r=redis.Redis(host=environ.get("REDIS_URL", "redis://127.0.0.1"), decode_responses=True, ssl_cert_reqs=None) -cache = Cache(app) -Markdown(app) -Compress(app) - limiter = Limiter( app, key_func=get_ipaddr, @@ -81,6 +78,9 @@ engine = create_engine(app.config['DATABASE_URL']) db_session = scoped_session(sessionmaker(bind=engine, autoflush=False)) +cache = Cache(app) +Compress(app) +mail = Mail(app) @app.before_request def before_request(): diff --git a/files/routes/static.py b/files/routes/static.py index 291280a67..9008d3ae4 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -1,15 +1,23 @@ from files.mail import * -from files.__main__ import app, limiter +from files.__main__ import app, limiter, mail from files.helpers.alerts import * from files.classes.award import AWARDS from sqlalchemy import func from os import path import calendar import matplotlib.pyplot as plt +from flask_mail import Message site = environ.get("DOMAIN").strip() site_name = environ.get("SITE_NAME").strip() +@app.route("/mailtest") +def mailtest(): + msg = Message(html="

Hello

", + sender="from@example.com", + recipients=["to@example.com"]) + mail.send(msg) + @app.get('/rules') @auth_desired def static_rules(v): diff --git a/requirements.txt b/requirements.txt index 489932b05..5f3263376 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ Flask Flask-Caching Flask-Compress Flask-Limiter==1.1.0 -Flask-Markdown +Flask-Mail gevent greenlet gunicorn