Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions flask/files/.platform.app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
name: app

# The runtime the application uses.
type: "python:2.7"
type: "python:3.7"

# The build-time dependencies of the app.
dependencies:
python:
pipenv: "2018.10.13"

# The hooks executed at various points in the lifecycle of the application.
hooks:
build: |
pip install -r requirements.txt
pipenv install --system --deploy

# The size of the persistent disk of the application (in MB).
disk: 1024
Expand Down
15 changes: 15 additions & 0 deletions flask/files/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
flask = "*"
redis = "*"
pymysql = "*"
gevent = "*"

[dev-packages]

[requires]
python_version = "3.7"
248 changes: 248 additions & 0 deletions flask/files/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flask/files/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Platform.sh Python 2.7 Flask minimal example
# Platform.sh Python 3.7 Flask minimal example

This project provides a starter kit for minimal Python 2.7 Flask projects hosted on Platform.sh. It is primarily an example, although could be used as the starting point for a real project.

Expand Down
10 changes: 0 additions & 10 deletions flask/files/requirements.txt

This file was deleted.

6 changes: 3 additions & 3 deletions flask/files/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import flask
import flask.json
import gevent.wsgi
import gevent.pywsgi
import pymysql
import redis

Expand Down Expand Up @@ -64,12 +64,12 @@ def test_redis(instance):
db=0,
)
key_name = "foo-%s" + str(uuid.uuid4())
value = "bar"
value = b"bar"

r.set(key_name, "bar")
assert value == r.get(key_name)


if __name__ == "__main__":
http_server = gevent.wsgi.WSGIServer(('127.0.0.1', int(os.environ["PORT"])), app)
http_server = gevent.pywsgi.WSGIServer(('127.0.0.1', int(os.environ["PORT"])), app)
http_server.serve_forever()