Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Red Dragon

Google App engine troubles

Recommended Posts

Posted · Original PosterOP

Hey guys im trying to get a website up on google app engine for a class im doing and whenever i do it loads up a blank page. It says module has no attribute called environment but i looked it up and all of the code for jinja2 has it so i don't really know what do do. thank you in advance!

 

AttributeError: 'module' object has no attribute 'enviroment'



INFO 2015-08-18 08:52:17,038 module.py:808] default: "GET / HTTP/1.1" 500 -
ERROR 2015-08-18 12:52:20,801 wsgi.py:263]

Traceback (most recent call last):

File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 240, in Handle

handler = _config_handle.add_wsgi_middleware(self._LoadHandler())

File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 299, in _LoadHandler

handler, path, err = LoadObject(self._handler)

File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 85, in LoadObject

obj = __import__(path[0])

File "C:\Users\Dean\Desktop\website\Main.py", line 6, in

jinja_env = jinja2.enviroment(loader = jinja2.FileSystemLoader(template_dir))

AttributeError: 'module' object has no attribute 'enviroment'

INFO 2015-08-18 08:52:20,808 module.py:808] default: "GET /favicon.ico HTTP/1.1" 500 -
 

import jinja2
import webapp2

template_dir = os.path.join(os.path.dirname(__file__), 'templates')
jinja_env = jinja2.Enviroment(loader = jinja2.FileSystemLoader(template_dir))

class Handler(webapp2.RequestHandler):
def write(self, *a, **kw):
self.response.out.write(*a, **kw)

def render_str(self, template, **params):
t = jinja_env.get_template(template)
return t.render(params)

def render(self, template, **kw):
self.write(self.render_str(template, **kw))

class Mainpage(Handler):
def get(self):
items = self.request.get_all("comment")
self.render("Note.html", items = items)




app = webapp2.WSGIApplication([
('/', MainPage),
], debug=True)
import os
 

version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
script: Main.app

libraries:
- name: webapp2
version: latest
- name: jinja2
version: latest
application: myapp

~ Maybe the cup is just too big ~

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×