External CSS Style sheet doesn't work when running on GAE
google-app-engine, jinja2, python
Solution
For anyone else that stumbles upon this question, static files should be declared with a static file handler. For example, this serves a directory called css, which maps the directory `css` in the root of your application directory to a publicly available `css` directory at the root of your appspot domain:
- url: /css
static_dir: css
Problem
I have main.html that links to web.css and when I run the main file it runs fine with the CSS but when I run the whole thing on google app engine, it doesn't apply the CSS. From the GAE logs I get ``` INFO 2012-05-10 01:58:46,526 dev_appserver.py:2891] "GET /web.css HTTP/1.1" 404 - INFO 2012-05-10 01:58:46,540 dev_appserver.py:2891] "GET /favicon.ico HTTP/1.1" 200 - ``` This is in my html file ``` <html> <head> <link rel="stylesheet" type="text/css" href="web.css"/> </head> <body> <h1> Hi </h1> </body> </html> ``` And this is my code ``` import os import webapp2 import jinja2 import re from datetime import datetime from google.appengine.ext import db from utility_functions import valid_username, valid_password, valid_email class Handler(webapp2.RequestHandler): def render(self, link, values={}): je = jinja2.Environment(autoescape=True, loader=jinja2.FileSystemLoader( os.path.join(os.path.dirname(__file__), 'templates'))) template = je.get_template(link) self.response.out.write(template.render(values)) class MainPage(Handler): def get(self): self.render('main.html') handlers = [('/', MainPage)] app = webapp2.WSGIApplication(handlers, debug=True) ```