Skip to content

Commit

Permalink
Remove unused extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
ssurbhi560 committed Sep 8, 2021
1 parent 5633a15 commit 730f84a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 195 deletions.
37 changes: 0 additions & 37 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,43 +40,6 @@ def create_app(config_class=Config):
from app.main import bp as main_bp
app.register_blueprint(main_bp)

if not app.debug and not app.testing:
if app.config['MAIL_SERVER']:
auth = None
if app.config['MAIL_USERNAME'] or app.config['MAIL_PASSWORD']:
auth = (app.config['MAIL_USERNAME'],
app.config['MAIL_PASSWORD'])
secure = None
if app.config['MAIL_USE_TLS']:
secure = ()
mail_handler = SMTPHandler(
mailhost=(app.config['MAIL_SERVER'], app.config['MAIL_PORT']),
fromaddr='no-reply@' + app.config['MAIL_SERVER'],
toaddrs=app.config['ADMINS'], subject='Qaari Failure',
credentials=auth, secure=secure)
mail_handler.setLevel(logging.ERROR)
app.logger.addHandler(mail_handler)


if app.config['LOG_TO_STDOUT']:
stream_handler = logging.StreamHandler()
stream_handler.setLevel(logging.INFO)
app.logger.addHandler(stream_handler)

else:
if not os.path.exists('logs'):
os.mkdir('logs')
file_handler = RotatingFileHandler('logs/qaari.log',
maxBytes=10240, backupCount=10)
file_handler.setFormatter(logging.Formatter(
'%(asctime)s %(levelname)s: %(message)s '
'[in %(pathname)s:%(lineno)d]'))
file_handler.setLevel(logging.INFO)
app.logger.addHandler(file_handler)

app.logger.setLevel(logging.INFO)
app.logger.info('Qaari startup')

return app


Expand Down
8 changes: 0 additions & 8 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ class Config(object):
'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False

MAIL_SERVER = os.environ.get('MAIL_SERVER')
MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25)
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
ADMINS = ['shawarma2412@gmail.com']
LOG_TO_STDOUT = os.environ.get('LOG_TO_STDOUT')



POSTS_PER_PAGE = 25
73 changes: 0 additions & 73 deletions logs/qaari.log.1

This file was deleted.

75 changes: 0 additions & 75 deletions logs/qaari.log.2

This file was deleted.

2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ blinker==1.4
click==8.0.
email-validator==1.1.3
Flask==2.0.1
Flask-Babel==2.0.0
Flask-Bootstrap==3.3.7.1
Flask-HTTPAuth==4.4.0
Flask-Login==0.5.0
Flask-Mail==0.9.1
Flask-Migrate==3.0.1
Flask-Moment==1.0.1
Flask-SQLAlchemy==2.5.1
Expand Down

0 comments on commit 730f84a

Please sign in to comment.