Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 23d8571

Browse filesBrowse files
PicardParisbusunkim96
authored andcommitted
Fix Flask local resource relative path (GoogleCloudPlatform#2605)
1 parent 81701c5 commit 23d8571
Copy full SHA for 23d8571

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
  • codelabs/functions/python_powered
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎codelabs/functions/python_powered/main.py

Copy file name to clipboardExpand all lines: codelabs/functions/python_powered/main.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import os
16+
1517
import flask
1618

1719

@@ -55,4 +57,4 @@ def python_powered(request):
5557
Returns:
5658
The response file, a JPG image that says "Python Powered"
5759
"""
58-
return flask.send_file("python_powered.jpg", mimetype="image/jpg")
60+
return flask.send_from_directory(os.getcwd(), "python_powered.jpg", mimetype="image/jpg")

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.