When I follow the tutorial – App Engine Series #4 – I got this error for Ajax.py: ImportError: No module named django.utils According to this article, Python 2.7 uses native JSON library. Fixed source for Ajax.py is this: #!/usr/bin/env python # -*- coding: utf-8 -*- # Including the models: from models.models import * # from Phyton 2.7,…
Category: Google App Engine
Python – ImportError: No module named
When I follow the tutorial – App Engine Series #4 – I kept getting the error like below: ImportError: No module named controllers It is caused by below code: import webapp2 # Importing the controllers that will handle # the generation of the pages: from controllers import crons,ajax,generate,mainh To fix the error, it is very simple….
Google App Engine Tutorial – Datastore – 한글 입력시 Internal Server Error 나는 현상
Google App Engine의 Datastore 튜토리얼 소스를 실행시 한글을 방명록 이름(Guestbook name)필드에 입력하면 다음과 같은 에러가 발생한다. Traceback (most recent call last): File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py”, line 1535, in __call__ rv = self.handle_exception(request, response, e) File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py”, line 1529, in __call__ rv = self.router.dispatch(request, response) File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py”, line 1278, in default_dispatcher return route.handler_adapter(request, response) File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/webapp2-2.5.2/webapp2.py”, line 1102,…
Python – 한글로 주석 남기면 실행 안되는 현상(cannot execute app if write Korean as comment)
한글로 코멘트를 남겼는데 다음과 같은 서버 에러가 발생했다. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. 검색해서 Using Python with Chinese, Japanese and Korean 라는 글을 찾았고, 코드를 다음과 같이 하니 문제없이 실행되었다. #!/usr/bin/env python # -*- coding: utf-8 -*-
Sample Code from Developing and deploying an application on Google App Engine
In the video, it provides the code as below #!/usr/bin/env python import os import wsgiref.handlers from google.appengine.ext import webapp from google.appengine.ext.webapp import template class MyHandler(webapp.RequestHandler): def get(self): self.response.out.write(template.render(‘main.html’, {})) def main(): app = webapp.WSGIApplication([ (r’.*’, MyHandler)], debug= True) wsgiref.handlers.CGIHandler().run(app); if __name__ == “__main__”: main() However, it gives the error as below: Traceback (most recent call…