Skip to content

Commit 860e8c4

Browse files
committed
serve lets encrypt challenge
update pycon info
1 parent 5e74430 commit 860e8c4

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

sopy/__init__.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import logging
2+
import os
23
import sys
34
import pkg_resources
4-
from flask import Flask
5+
from flask import Flask, send_from_directory
56
from flask import render_template, url_for, redirect
67
from flask_alembic import Alembic
78
from flask_alembic.cli.click import cli as alembic_cli
@@ -65,9 +66,20 @@ def not_found(e):
6566
def internal_server_error(e):
6667
return render_template('errors/500.html'), 500
6768

68-
@app.route('/pycon2016')
69-
def pycon2016():
70-
return redirect(url_for('wiki.detail', title='PyCon US 2016'))
69+
@app.route('/.well-known/<path:path>')
70+
def serve_lets_encrypt_challenge(path):
71+
return send_from_directory(
72+
os.path.join(
73+
app.instance_path,
74+
'lets_encrypt_challenge',
75+
'.well-known'
76+
),
77+
path
78+
)
79+
80+
@app.route('/pycon')
81+
def pycon():
82+
return redirect(url_for('wiki.detail', title='PyCon US 2017'))
7183

7284
if not app.debug:
7385
handler = logging.StreamHandler(sys.stderr)

sopy/templates/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ <h2>print('Hello, World!')</h2>
1010
<p>Join us for chat in the <a href="http://chat.stackoverflow.com/rooms/6/python">Python room</a>!</p>
1111
</div>
1212
<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>
13+
<div class="panel-heading">PyCon US 2017</div>
14+
<div class="panel-body"><p><a href="{{ url_for('pycon') }}">We're at PyCon!</a>
1515
David Lord (@davidism) is planning open spaces and meetups.
16-
Ping @davidism in chat for more information.</p></div>
16+
Ping @davidism in chat or on Twitter for more information.</p></div>
1717
</div>
1818
</div></div>
1919
{% endblock %}

0 commit comments

Comments
 (0)