diff --git a/app.py b/app.py index 340f9db..fa32c38 100644 --- a/app.py +++ b/app.py @@ -7,8 +7,7 @@ app = Flask(__name__) api = Api(app) -reload(sys) -sys.setdefaultencoding('utf-8') + CORS(app) diff --git a/joke.py b/joke.py index 5bcdae9..f787200 100644 --- a/joke.py +++ b/joke.py @@ -9,8 +9,8 @@ def random_digits(joke_count): def get_joke(): # Return random joke - with open('data.json') as data_file: + with open('data.json', encoding="utf8") as data_file: data = json.load(data_file) joke = data[random_digits(len(data))] - print joke + print(joke) return joke diff --git a/requirements.txt b/requirements.txt index 05950f1..360e0a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ -Flask==0.11.1 -gunicorn==19.7.0 -httplib2==0.9.2 -Jinja2==2.8 -virtualenv==15.1.0 -Werkzeug==0.11.10 +Flask==1.0.2 +gunicorn==19.9.0 +httplib2==0.11.3 +Jinja2==2.10 +virtualenv==16.0.0 +Werkzeug==0.14.1 flask-restful flask-cors==3.0.6