Skip to content

Commit 23d8571

Browse files
PicardParisbusunkim96
authored andcommitted
Fix Flask local resource relative path (#2605)
1 parent 81701c5 commit 23d8571

File tree

1 file changed

+3
-1
lines changed
  • codelabs/functions/python_powered

1 file changed

+3
-1
lines changed

codelabs/functions/python_powered/main.py

Lines 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)