Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixes on ec2

  • Loading branch information...
commit 8721f0d9f88abb923cab638e54a639086b09806d 1 parent 2cfd385
Ubuntu authored
Showing with 8 additions and 4 deletions.
  1. +2 −2 2010/parser.py
  2. +6 −2 app.py
View
4 2010/parser.py
@@ -21,7 +21,7 @@
f = lambda: defaultdict(f)
res_dict = defaultdict(f)
year_set = set()
-print u"qmsdlkjqmslkjfçççç"
+
countries_dict = {}
count =0
for sex in files:
@@ -115,4 +115,4 @@ def age_to_int(age):
f = open('mainData.json','w')
f.write(json.dumps(main_data_dict))
-f.close()
+f.close()
View
8 app.py
@@ -1,6 +1,8 @@
from flask import Flask, url_for
from flask import render_template, make_response
import pickle
+import logging, sys
+logging.basicConfig(stream=sys.stderr)
app = Flask(__name__)
@@ -8,6 +10,7 @@
@app.route('/<country>/<int:year>/')
@app.route('/<country>/<int:year>/<currentLetter>/')
def pyramid(country="WORLD",year="2010",currentLetter=None):
+ app.logger.error('request received %s %s',country, year)
years = range(1950,2101,5)
alphabet = map(chr, range(65, 91))
f = open('2010/letters_to_countries_list_dict.pickle')
@@ -18,7 +21,7 @@ def pyramid(country="WORLD",year="2010",currentLetter=None):
countries_dict = pickle.load(f)
f.close()
currentCountryName = countries_dict.get(country,None)
-
+ app.logger.error('files read')
if currentCountryName is None:
return make_response(render_template('404.html'), 404)
@@ -52,7 +55,8 @@ def page_not_found(e):
return render_template('404.html'), 404
import os
if __name__ == '__main__':
- if __name__ == '__main__':
+
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT', 5000))
+ app.debug = True
app.run(host='0.0.0.0', port=port)
Please sign in to comment.
Something went wrong with that request. Please try again.