Hi,
I am trying to develop the app with django on local sdk environment,
but I got the following error:
<class 'django.template.TemplateDoesNotExist'> Python 2.5.4: D:
\Python25\python.exe
Thu Apr 02 23:31:56 2009
A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
D:\Program Files\Google\google_appengine\google\appengine\tools
\dev_appserver.py in _HandleRequest
(self=<google.appengine.tools.dev_appserver.DevAppServerRequestHandler
instance at 0x014167B0>)
2709 infile,
2710 outfile,
2711 base_env_dict=env_dict)
2712 finally:
2713 self.module_manager.UpdateModuleFileModificationTimes
()
base_env_dict undefined, env_dict = {'APPLICATION_ID': 'account',
'CURRENT_VERSION_ID': '1.1', 'REMOTE_ADDR': '127.0.0.1',
'REQUEST_METHOD': 'GET', 'SERVER_NAME': 'localhost', 'SERVER_PORT':
'8080', 'SERVER_PROTOCOL': 'HTTP/1.0', 'SERVER_SOFTWARE': 'Development/
1.0'}
D:\Program Files\Google\google_appengine\google\appengine\tools
\dev_appserver.py in Dispatch
(self=<google.appengine.tools.dev_appserver.MatcherDispatcher object
at 0x0141AB30>, relative_url='/', path=None,
headers=<mimetools.Message instance at 0x01416918>,
infile=<cStringIO.StringI object at 0x00F51590>,
outfile=<cStringIO.StringO object at 0x0141A460>, base_env_dict=
{'APPLICATION_ID': 'account', 'CURRENT_VERSION_ID': '1.1',
'REMOTE_ADDR': '127.0.0.1', 'REQUEST_METHOD': 'GET', 'SERVER_NAME':
'localhost', 'SERVER_PORT': '8080', 'SERVER_PROTOCOL': 'HTTP/1.0',
'SERVER_SOFTWARE': 'Development/1.0'})
378 infile,
379 outfile,
380
base_env_dict=base_env_dict)
381
382 if forward:
base_env_dict = {'APPLICATION_ID': 'account', 'CURRENT_VERSION_ID':
'1.1', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_METHOD': 'GET',
'SERVER_NAME': 'localhost', 'SERVER_PORT': '8080', 'SERVER_PROTOCOL':
'HTTP/1.0', 'SERVER_SOFTWARE': 'Development/1.0'}
D:\Program Files\Google\google_appengine\google\appengine\tools
\dev_appserver.py in Dispatch
(self=<google.appengine.tools.dev_appserver.CGIDispatcher object at
0x0141A850>, relative_url='/', path='main.py',
headers=<mimetools.Message instance at 0x01416918>,
infile=<cStringIO.StringI object at 0x00F51590>,
outfile=<cStringIO.StringO object at 0x0141A460>, base_env_dict=
{'APPLICATION_ID': 'account', 'CURRENT_VERSION_ID': '1.1',
'REMOTE_ADDR': '127.0.0.1', 'REQUEST_METHOD': 'GET', 'SERVER_NAME':
'localhost', 'SERVER_PORT': '8080', 'SERVER_PROTOCOL': 'HTTP/1.0',
'SERVER_SOFTWARE': 'Development/1.0'})
1996 infile,
1997 outfile,
1998 self._module_dict)
1999 handler.AddDebuggingConsole(relative_url, env, outfile)
2000 finally:
self = <google.appengine.tools.dev_appserver.CGIDispatcher object at
0x0141A850>, self._module_dict = {'Cookie': <module 'Cookie' from 'D:
\Python25\lib\Cookie.pyc'>, 'StringIO': <module 'StringIO' from 'D:
\Python25\lib\StringIO.pyc'>, 'UserDict': <module 'UserDict' from 'D:
\Python25\lib\UserDict.py'>, '__future__': <module '__future__' from
'D:\Python25\lib\__future__.pyc'>, '__main__': <module 'main' from 'E:
\projects\account\trunk\main.py'>, '_bisect': <module '_bisect' (built-
in)>, '_hashlib': <module '_hashlib' from 'D:\Python25\DLLs
\_hashlib.pyd'>, '_locale': <module '_locale' (built-in)>, '_random':
<module '_random' (built-in)>, '_struct': <module '_struct' (built-in)
>, ...}
D:\Program Files\Google\google_appengine\google\appengine\tools
\dev_appserver.py in ExecuteCGI(root_path=r'E:\projects\account
\trunk', handler_path='main.py', cgi_path=r'E:\projects\account\trunk
\main.py', env={'APPLICATION_ID': 'account', 'AUTH_DOMAIN':
'gmail.com', 'CONTENT_LENGTH': '', 'CONTENT_TYPE': 'application/x-www-
form-urlencoded', 'CURRENT_VERSION_ID': '1.1', 'GATEWAY_INTERFACE':
'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/
xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET':
'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_LANGUAGE': 'en-
us,en;q=0.7,zh-cn;q=0.3', 'HTTP_CONNECTION': 'keep-alive', ...},
infile=<cStringIO.StringI object at 0x00F51590>,
outfile=<cStringIO.StringO object at 0x0141A460>, module_dict=
{'Cookie': <module 'Cookie' from 'D:\Python25\lib\Cookie.pyc'>,
'StringIO': <module 'StringIO' from 'D:\Python25\lib\StringIO.pyc'>,
'UserDict': <module 'UserDict' from 'D:\Python25\lib\UserDict.py'>,
'__future__': <module '__future__' from 'D:\Python25\lib
\__future__.pyc'>, '__main__': <module 'main' from 'E:\projects\account
\trunk\main.py'>, '_bisect': <module '_bisect' (built-in)>,
'_hashlib': <module '_hashlib' from 'D:\Python25\DLLs\_hashlib.pyd'>,
'_locale': <module '_locale' (built-in)>, '_random': <module
'_random' (built-in)>, '_struct': <module '_struct' (built-in)>, ...},
exec_script=<function ExecuteOrImportScript at 0x0113B6F0>)
1914 logging.debug('Executing CGI with env:\n%s', pprint.pformat
(env))
1915 try:
1916 reset_modules = exec_script(handler_path, cgi_path, hook)
1917 except SystemExit, e:
1918 logging.debug('CGI exited with status: %s', e)
reset_modules = True, exec_script = <function ExecuteOrImportScript at
0x0113B6F0>, handler_path = 'main.py', cgi_path = r'E:\projects\account
\trunk\main.py', hook =
<google.appengine.tools.dev_appserver.HardenedModulesHook object at
0x0141A910>
D:\Program Files\Google\google_appengine\google\appengine\tools
\dev_appserver.py in ExecuteOrImportScript(handler_path='main.py',
cgi_path=r'E:\projects\account\trunk\main.py',
import_hook=<google.appengine.tools.dev_appserver.HardenedModulesHook
object at 0x0141A910>)
1810 try:
1811 if module_code:
1812 exec module_code in script_module.__dict__
1813 else:
1814 script_module.main()
module_code = <code object <module> at 011368D8, file "E:\projects
\account\trunk\main.py", line 1>, script_module = <module 'main' from
'E:\projects\account\trunk\main.py'>, script_module.__dict__ =
{'__builtins__': {'ArithmeticError': <type
'exceptions.ArithmeticError'>, 'AssertionError': <type
'exceptions.AssertionError'>, 'AttributeError': <type
'exceptions.AttributeError'>, 'BaseException': <type
'exceptions.BaseException'>, 'DeprecationWarning': <type
'exceptions.DeprecationWarning'>, 'EOFError': <type
'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError':
<type 'exceptions.EnvironmentError'>, 'Exception': <type
'exceptions.Exception'>, 'False': False, ...}, '__doc__': None,
'__file__': r'E:\projects\account\trunk\main.py', '__loader__':
<google.appengine.tools.dev_appserver.HardenedModulesHook object at
0x0141A910>, '__name__': 'main', 'django': <module 'django' from 'D:
\Program Files\Google\google_appengine\lib\django\django
\__init__.pyc'>, 'log_exception': <function log_exception at
0x01509370>, 'logging': <module 'logging' from 'D:\Python25\lib\logging
\__init__.pyc'>, 'main': <function main at 0x015093B0>, 'os': <module
'os' from 'D:\Python25\lib\os.pyc'>, ...}
E:\projects\account\trunk\main.py in ()
35 # Run the WSGI CGI handler with that application.
36 util.run_wsgi_app(application)
37
38 if __name__ == '__main__':
39 main()
main = <function main at 0x015093B0>
E:\projects\account\trunk\main.py in main()
34
35 # Run the WSGI CGI handler with that application.
36 util.run_wsgi_app(application)
37
38 if __name__ == '__main__':
global util = <module 'google.appengine.ext.webapp.util'
from ..._appengine\google\appengine\ext\webapp\util.pyc'>,
util.run_wsgi_app = <function run_wsgi_app at 0x014E10B0>, application
= <django.core.handlers.wsgi.WSGIHandler object at 0x014D8E70>
D:\Program Files\Google\google_appengine\google\appengine\ext\webapp
\util.py in run_wsgi_app
(application=<django.core.handlers.wsgi.WSGIHandler object at
0x014D8E70>)
74 env["wsgi.multithread"] = False
75 env["wsgi.multiprocess"] = False
76 result = application(env, _start_response)
77 if result is not None:
78 for data in result:
result undefined, application = <django.core.handlers.wsgi.WSGIHandler
object at 0x014D8E70>, env = {'APPLICATION_ID': 'account',
'AUTH_DOMAIN': 'gmail.com', 'CONTENT_LENGTH': '', 'CONTENT_TYPE':
'application/x-www-form-urlencoded', 'CURRENT_VERSION_ID': '1.1',
'DJANGO_SETTINGS_MODULE': 'settings', 'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/
xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET':
'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_LANGUAGE': 'en-
us,en;q=0.7,zh-cn;q=0.3', ...}, global _start_response = <function
_start_response at 0x014E1870>
D:\Program Files\Google\google_appengine\lib\django\django\core
\handlers\wsgi.py in __call__
(self=<django.core.handlers.wsgi.WSGIHandler object at 0x014D8E70>,
environ={'APPLICATION_ID': 'account', 'AUTH_DOMAIN': 'gmail.com',
'CONTENT_LENGTH': '', 'CONTENT_TYPE': 'application/x-www-form-
urlencoded', 'CURRENT_VERSION_ID': '1.1', 'DJANGO_SETTINGS_MODULE':
'settings', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/
html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.7,zh-cn;q=0.3', ...},
start_response=<function _start_response at 0x014E1870>)
187 try:
188 request = WSGIRequest(environ)
189 response = self.get_response(request)
190
191 # Apply response middleware
response undefined, self = <django.core.handlers.wsgi.WSGIHandler
object at 0x014D8E70>, self.get_response = <bound method
WSGIHandler.get_response of <djang....handlers.wsgi.WSGIHandler object
at 0x014D8E70>>, request = <WSGIRequest GET:<MultiValueDict: {}>,
POST:<Mul...gi.url_scheme': 'http', 'wsgi.version': (1, 0)}>
D:\Program Files\Google\google_appengine\lib\django\django\core
\handlers\base.py in get_response
(self=<django.core.handlers.wsgi.WSGIHandler object at 0x014D8E70>,
request=<WSGIRequest GET:<MultiValueDict: {}>,
POST:<Mul...gi.url_scheme': 'http', 'wsgi.version': (1, 0)}>)
124 # Return an HttpResponse that displays a
friendly error message.
125 callback, param_dict = resolver.resolve500()
126 return callback(request, **param_dict)
127
128 def _get_traceback(self, exc_info=None):
callback = <function server_error at 0x017B6330>, request =
<WSGIRequest GET:<MultiValueDict: {}>, POST:<Mul...gi.url_scheme':
'http', 'wsgi.version': (1, 0)}>, param_dict = {}
D:\Program Files\Google\google_appengine\lib\django\django\views
\defaults.py in server_error(request=<WSGIRequest GET:<MultiValueDict:
{}>, POST:<Mul...gi.url_scheme': 'http', 'wsgi.version': (1, 0)}>,
template_name='500.html')
85 Templates: `500.html`
86 Context: None
87 """
88 t = loader.get_template(template_name) # You need to create
a 500.html template.
89 return http.HttpResponseServerError(t.render(Context({})))
t undefined, global loader = <module 'django.template.loader' from 'D:
\Progra...appengine\lib\django\django\template\loader.pyc'>,
loader.get_template = <function get_template at 0x01587670>,
template_name = '500.html'
D:\Program Files\Google\google_appengine\lib\django\django\template
\loader.py in get_template(template_name='500.html')
77 handling template inheritance recursively.
78 """
79 source, origin = find_template_source(template_name)
80 template = get_template_from_string(source, origin,
template_name)
81 return template
source undefined, origin undefined, global find_template_source =
<function find_template_source at 0x015873B0>, template_name =
'500.html'
D:\Program Files\Google\google_appengine\lib\django\django\template
\loader.py in find_template_source(name='500.html', dirs=None)
70 except TemplateDoesNotExist:
71 pass
72 raise TemplateDoesNotExist, name
73
74 def get_template(template_name):
global TemplateDoesNotExist = <class
'django.template.TemplateDoesNotExist'>, name = '500.html'
<class 'django.template.TemplateDoesNotExist'>: 500.html
args = ('500.html',)
message = '500.html'
And this is my setting.py:
import os
ROOT_URLCONF = 'urls' # Replace 'project.urls' with just 'urls'
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
# 'django.contrib.sessions.middleware.SessionMiddleware',
# 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
)
INSTALLED_APPS = (
# 'django.contrib.auth',
'django.contrib.contenttypes',
# 'django.contrib.sessions',
'django.contrib.sites',
)
ROOT_PATH = os.path.dirname(__file__)
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or
# "C:/www/django/templates". Always use forward slashes, even on
Windows.
# Don't forget to use absolute paths, not relative paths.
ROOT_PATH + '/templates',
)
Can anyone give me some advise?
Thanks
Yunfeng
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---