0

I was able to preview the HTML page on cloud shell and it shows everything correctly. when i deploy the app using "gcloud app deploy", the display is not showing the same page display as the preview page. for the deployment view, a specific CSS file data was pulled. while the preview page pulled from another CSS file. I have 2 different CSS files. app.yaml appended here. please advise.

{


runtime: python37
runtime_config: 
  entrypoint: "gunicorn -b:$PORT main:app"
  env: flex
  python_version: 3

handlers: 
  - 
    static_dir: images
    url: /images
  - 
    static_dir: static/css
    url: /css
  - 
    static_dir: templates/css
    url: /css
  - 
    script: auto
    url: /.*
Vincent Teo
  • 43
  • 1
  • 9

1 Answers1

0

Considering your app.yaml, indeed, it seems that your CSS files are not being ready while your application is deployed and run.

For this reason, I would recommend you to take a look at the articles CSS and multiple HTML files in App Engine and Loading Images and CSS in AppEngine, where you can find more information and assistance on configuring your App Engine to read and use the CSS file during the deployment.

Let me know if the information helped you!

gso_gabriel
  • 4,199
  • 1
  • 10
  • 22
  • I tried a few iterations on app.yaml to no avail. Sharing my directory view : [Directory](https://1drv.ms/u/s!AvToduCwLFkhtFUlGIsNmYOxSRaO?e=1jWdZS) – Vincent Teo Mar 03 '20 at 23:31
  • Hi @VincentTeo could you please confirm if you checked the documentation that I mentioned and the changes that you tried in your `app.yaml` file? – gso_gabriel Mar 04 '20 at 09:12
  • hi, i looked at both weblinks you provided and tried with changes for the path pointing to CSS to no avail. the only diff is I have in my yaml.app file is that "script: auto" instead of pointing to a .app file....and i am not sure what .app file should be referred to in my directory. So, i guess the answer is yes but not seeing CSS file being pulled. Is there an other files (besides yaml.app) that could affect the proper execution of CSS file ? thank you. – Vincent Teo Mar 06 '20 at 02:05
  • Hi @VincentTeo the `app.yaml` file is the one that you need to configure for the CSS files to be read by App Engine. Another point that you might take a look - as mentioned in this post [here](https://stackoverflow.com/questions/9390917/google-app-engine-can-not-see-my-css-files) - it's to look for the order between the `static_dir` and the `script` in your parameters. – gso_gabriel Mar 10 '20 at 10:49
  • thank you. i removed a css directory , leaving 1 css directory only instead of two ie. /static. i also made changes to the html file on the css reference line. it is ok now. however, i still have /animate which is not working and only showing 1 jpg file instead of toggling between 3 files which i wanted. – Vincent Teo Mar 12 '20 at 00:49