I have main.html that references web.css, and when I run the main file, it works fine with CSS, but when I run it all in the Google engine, it does not apply CSS. From GAE magazines 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)
source share