Skip to content

Commit a940777

Browse files
committed
add redirect for /pycon2016 to wiki page
remove giant cabbage, salad of the day from index add pycon notice to index
1 parent 3b77c40 commit a940777

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

sopy/__init__.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import logging
2-
32
import sys
4-
53
import pkg_resources
64
from flask import Flask
7-
from flask import render_template
5+
from flask import render_template, url_for, redirect
86
from flask_alembic import Alembic
97
from flask_alembic.cli.click import cli as alembic_cli
108
from flask_babel import Babel
@@ -17,7 +15,7 @@
1715
db = SQLAlchemy()
1816

1917

20-
def create_app():
18+
def create_app(info=None):
2119
app = Flask(__name__, instance_relative_config=True)
2220
app.config.from_object('sopy.config')
2321
app.config.from_pyfile('config.py', True)
@@ -50,9 +48,7 @@ def create_app():
5048

5149
@app.route('/')
5250
def index():
53-
from sopy.salad.models import Salad
54-
55-
return render_template('index.html', wod=Salad.word_of_the_day())
51+
return render_template('index.html')
5652

5753
app.add_url_rule('/favicon.ico', None, app.send_static_file, defaults={'filename': 'favicon.ico'})
5854
app.add_url_rule('/robots.txt', None, app.send_static_file, defaults={'filename': 'robots.txt'})
@@ -63,16 +59,19 @@ def forbidden(e):
6359

6460
@app.errorhandler(404)
6561
def not_found(e):
66-
6762
return render_template('errors/404.html'), 404
6863

6964
@app.errorhandler(500)
7065
def internal_server_error(e):
7166
return render_template('errors/500.html'), 500
7267

68+
@app.route('/pycon2016')
69+
def pycon2016():
70+
return redirect(url_for('wiki.detail', title='PyCon US 2016'))
71+
7372
if not app.debug:
7473
handler = logging.StreamHandler(sys.stderr)
7574
handler.setLevel(logging.ERROR)
76-
app.logger.addHander(handler)
75+
app.logger.addHandler(handler)
7776

7877
return app

sopy/templates/index.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
{% block content %}
66
<div class="row"><div class="col-md-12">
77
<div class="jumbotron">
8-
<h2>Cabbage, World!</h2>
8+
<h2>print('Hello, World!')</h2>
99
<p>Welcome to <strong>so</strong>python, the website of the Python community on <a href="http://stackoverflow.com/">Stack Overflow</a>.</p>
1010
<p>Join us for chat in the <a href="http://chat.stackoverflow.com/rooms/6/python">Python room</a>!</p>
1111
</div>
12-
13-
{% if wod %}<div class="panel panel-info">
14-
<div class="panel-body">The word of the day is "<a href="{{ wod.highlight_url }}"><strong>{{ wod.term }}</strong></a>"!</div>
15-
</div>{% endif %}
12+
<div class="panel panel-info">
13+
<div class="panel-heading">PyCon US 2016</div>
14+
<div class="panel-body"><p><a href="{{ url_for('pycon2016') }}">We're at PyCon!</a>
15+
David Lord (@davidism) is planning open spaces and meetups.
16+
Ping @davidism in chat for more information.</p></div>
17+
</div>
1618
</div></div>
1719
{% endblock %}

0 commit comments

Comments
 (0)