remotes/1693045480750635534/spooky-22
Aevann1 2021-10-03 21:53:14 +02:00
parent 1a21a70e59
commit 4b7e44cbf7
5 changed files with 15 additions and 9 deletions

View File

@ -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

1
env
View File

@ -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"

View File

@ -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():

View File

@ -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="<h1>Hello<h1>",
sender="from@example.com",
recipients=["to@example.com"])
mail.send(msg)
@app.get('/rules')
@auth_desired
def static_rules(v):

View File

@ -4,7 +4,7 @@ Flask
Flask-Caching
Flask-Compress
Flask-Limiter==1.1.0
Flask-Markdown
Flask-Mail
gevent
greenlet
gunicorn