Mercurial > party-buddy-server
changeset 17:f3f981631d2d
Add templates and statics
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Sun, 02 Jun 2013 11:06:06 +0200 |
| parents | b4260712b885 |
| children | ab19211ebe1a |
| files | runserver.py server/__init__.py server/static/main.js server/static/style.css server/templates/base.html server/templates/index.html |
| diffstat | 4 files changed, 30 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/runserver.py Sun Jun 02 10:16:17 2013 +0200 +++ b/runserver.py Sun Jun 02 11:06:06 2013 +0200 @@ -1,5 +1,8 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + if __name__ == '__main__': from server import app - + app.debug = True app.run(debug=True)
--- a/server/__init__.py Sun Jun 02 10:16:17 2013 +0200 +++ b/server/__init__.py Sun Jun 02 11:06:06 2013 +0200 @@ -1,15 +1,17 @@ -# coding=utf-8 -from flask import (Flask, request, redirect, url_for, abort, - render_template, flash, jsonify, g, session, send_file) +# -*- coding: utf-8 -*- +import flask import os -app = Flask(__name__) + +app = flask.Flask(__name__) app.config.from_object('server.configs.default') if 'PARTYBUDDY_SETTINGS' in os.environ: app.config.from_envvar('PARTYBUDDY_SETTINGS') + @app.route('/') def home(): - return '42' + return flask.render_template('index.html') +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/templates/base.html Sun Jun 02 11:06:06 2013 +0200 @@ -0,0 +1,12 @@ +<!doctype html> +<html><head> + <meta http-equiv="content-type" content="text/html;charset=utf-8"> + <title>{% block title %}Party Buddy{% endblock %}</title> + <link + href="{{ url_for('static', filename='style.css') }}" + rel="stylesheet" + > + {% block extrahead %}{% endblock %} +</head><body> +{% block body %}{% endblock %} +</body></html>
