I realize that this has been asked a couple of times, but none of the solutions seemed to help.
I am trying to use Flask to serve some basic HTML and CSS to my website. On App Engine, Flask is serving the template correctly, but is not able to locate the stylesheet in the static/css folder (I'm getting 404s in my logs on the developer console).
My project's relevant structure is this:
/app
/static
/css
style.css
/templates
home.html
The commands I'm using are:
render_template('home.html')
In the main python file,
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css') }}">
In the html to link the stylesheet. My app.yaml file is very basic:
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: main.app
- url: /static
static_dir: static
expiration: "7d"
Now, this works fine when I run it on localhost, and the url_for function is getting the stylesheet correctly, but not on Google Cloud Platform, despite getting the correct filepath and having the correct source code in the Development tab, only the HTML is served. If it helps, this is the command I'm using to deploy the app:
gcloud app deploy app.yaml --project my-project
I'm sure the problem is right in front of me, but I can't figure out. Any insight would be appreciated. Thank you in advance.