0
votes

i am using google app engine (python) to develop my web application, now i found a little problem. I would like to add bootstrap css file to google app engine, and here is my folder directory

  • project
    • app.yaml
    • favicon.ico
    • index.yaml
    • main.py
    • templates
      • css
        • bootstrap
          • css
            • bootstrap.css
    • images
    • js
    • header.html
    • signup.html
    • welcome.html

app.yaml code

application: project
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: /templates/css/boostrap/css/
  static: boostrap.css


- url: /.*
  script: main.app

libraries:
- name: webapp2
  version: "2.5.2"

- name: jinja2
  version: latest

in my header.html css link like this

<link type="text/css" rel="stylesheet" href="css/bootstrap/css/bootstrap.css" rel="stylesheet">

when i refresh my page, it only shows the plain text, css file is 404 not found. Any help?

1
Your yaml file has a different url than your header.html - joel goldstick

1 Answers

0
votes

Try

- url: /css/bootstrap/
  static_dir: /templates/css/bootstrap/css

and reference it via

<link rel="stylesheet" type="text/css" href="/css/bootstrap/bootstrap.css" />