Commits

Chris Mutel committed 1c787f3

Simpler errors

Comments (0)

Files changed (5)

bw2webreports/app.py

 
 @app.errorhandler(404)
 def page_not_found(e):
-    return render_template('404.html'), 404
+    return "Resource not found", 404
 
 
 @app.errorhandler(500)
 def internal_error(e):
-    return render_template('500.html'), 500
+    return "Application error", 500
 
 
 @app.route("/upload", methods=["POST"])

bw2webreports/bin/bw2-report-server.py

     args = docopt(__doc__, version='Brightway2 Reports Server 0.1')
     port = int(args.get("--port", False) or 8000)
     report_server.config['DATA_DIR'] = args["<data_dir>"]
-    run_simple("0.0.0.0", port, report_server, use_evalex=True)
+    run_simple("0.0.0.0", port, report_server)

bw2webreports/templates/404.html

-{% extends "base.html" %}
-
-{% block extrahead %}<style type="text/css">
-body {
-	background-color: #736160;
-	}
-.errortext {
-		margin-top:13em
-}
-</style>{% endblock %}
-
-{% block body %}
-<div class="span-9"><img src="{{ url_for('static', filename="img/llama.jpg") }}"></div>
-<div class="push-1 span-12">
-	<div class="errortext">
-		<h1 style="color: white">404 - Page not found</h1>
-		<h2 style="color: white">We all get lost sometimes...</h2>
-	</div>
-</div>
-{% endblock %}

bw2webreports/templates/500.html

-{% extends "base.html" %}
-
-{% block extrahead %}<style type="text/css">
-body {
-	background-color: #dcd8d5;
-	color: black !important
-	}
-.errortext {
-		margin-top:13em
-}
-</style>{% endblock %}
-
-{% block body %}
-<div class="span-9"><img src="{{ url_for('static', filename="img/monster.jpg") }}"></div>
-<div class="push-1 span-8">
-	<div class="errortext">
-		<h1>500 - Server Error</h1>
-		<h2>Something went wrong!</h2>
-	</div>
-</div>
-{% endblock %}
 
 setup(
   name='bw2webreports',
-  version="0.1",
+  version="0.2",
   packages=["bw2webreports"],
   package_data={'bw2webreports': [
     "static/blueprint/*.css",