Can't link CSS files

72 views
Skip to first unread message

Sean S

unread,
May 2, 2012, 3:17:48 PM5/2/12
to google-a...@googlegroups.com
I can't figure out how to link CSS style sheets into my html. This is how my app.yaml looks:

application: gulshan-singh
version: 1
runtime: python27
api_version: 1
threadsafe: yes

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

- url: .*
  script: main.app
  
- url: /stylesheets/(.*\.css)
  mime_type: text/css
  static_files: stylesheets/\1
  upload: stylesheets/(.*\.css)

libraries:
- name: webapp2
  version: "2.5.1"
- name: jinja2
  version: latest


And I link my CSS like this:
<link rel="stylesheet" type="text/css" href="/stylesheets/styles.css">

I've also tried changing the handler to this:

- url: /stylesheets
  static_dir: stylesheets

That didn't work either. What am I doing wrong?

Sean S

unread,
May 2, 2012, 3:24:43 PM5/2/12
to google-a...@googlegroups.com
I was able to figure it out. These lines
- url: .*
  script: main.app

Needed to go after the stylesheet handler

Dragan Mestrovik

unread,
Oct 3, 2014, 7:25:27 AM10/3/14
to google-a...@googlegroups.com
Mee too facing the same problem.. any one please help us
-- sqageek

Vinny P

unread,
Oct 7, 2014, 1:09:05 AM10/7/14
to google-a...@googlegroups.com
On Fri, Oct 3, 2014 at 6:25 AM, Dragan Mestrovik <sa.test...@gmail.com> wrote:
Mee too facing the same problem.. any one please help us
-
On Wednesday, May 2, 2012 12:17:48 PM UTC-7, Gulshan Singh wrote:
I can't figure out how to link CSS style sheets into my html. 



Are you using the same app.yaml as the OP? The OP fixed his problem as documented in https://groups.google.com/d/msg/google-appengine/hFWYjAlEud8/27q4QNe4IpIJ by moving the script handler to the end.

If you're facing a different issue, you should post your app.yaml and folder structure. 
 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com
 
Reply all
Reply to author
Forward
0 new messages