-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from mpdavis/main_views_cleanup
Some cleanup of main.py
- Loading branch information
Showing
6 changed files
with
83 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from base import views as base_views | ||
from flask import render_template | ||
|
||
|
||
def setup_urls(app): | ||
"""URLs for the base module""" | ||
app.add_url_rule('/', view_func=base_views.MainHandler.as_view('home')) | ||
app.add_url_rule('/about/', view_func=base_views.About.as_view('about')) | ||
app.add_url_rule('/contact/', view_func=base_views.ContactUs.as_view('contact')) | ||
app.add_url_rule('/demo/', view_func=base_views.DemoHandler.as_view('demo')) | ||
|
||
@app.errorhandler(404) | ||
def page_not_found(e): | ||
return render_template('404.html'), 404 | ||
|
||
@app.errorhandler(500) | ||
def server_error(e): | ||
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
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
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
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,12 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %}404 - WebTournaments{% endblock %} | ||
|
||
{% block content %} | ||
<div class="row"> | ||
<div class="span6 offset3" style="text-align: center;"> | ||
<h1>Page Not Found - 404</h1> | ||
<img src="/static/img/trophy_gold.svg" /> | ||
</div> | ||
</div> | ||
{% 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,12 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %}500 - WebTournaments{% endblock %} | ||
|
||
{% block content %} | ||
<div class="row"> | ||
<div class="span6 offset3" style="text-align: center;"> | ||
<h1>Page Not Found - 500</h1> | ||
<img src="/static/img/trophy_gold.svg" /> | ||
</div> | ||
</div> | ||
{% endblock %} |