-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added mail settings added errors.py added custom error views
- Loading branch information
Showing
7 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from flask import render_template | ||
|
||
from app import app | ||
from app import db | ||
|
||
@app.errorhandler(404) | ||
def not_found_error(error): | ||
return render_template("404.html"), 404 | ||
|
||
@app.errorhandler(500) | ||
def internal_error(error): | ||
db.session.rollback() | ||
return render_template("500.html"), 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
<h1>File Not found</h1> | ||
<p><a href="{{ url_for('index') }}">Back</a></p> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
<h1>An unexpected error has occurred</h1> | ||
<p>The Adminstrator has been notified, Sorry for the inconvenience</p> | ||
<p><a href="{{ url_for('index') }}">Back</a></p> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,10 @@ class Config: | |
SECRET_KEY = os.environ.get("SECRET_KEY") or "you-will-never-guess" | ||
SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL") or \ | ||
'sqlite:///'+os.path.join(basedir,"app.db") | ||
SQLALCHEMY_TRACK_MODIFICATIONS = False | ||
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 = ["[email protected]"] |