我与http://docs.django-cms.org/en/2.4.0/getting_started/tutorial.html有关的Django CMS 但是在1.3.4点。启动并运行! - 我没有看到任何欢迎页面。 相反,我仍然看到
有效! 祝贺你的第一个Django页面。 当然,你还没有做过任何工作。这是下一步做什么: 如果您打算使用数据库,请编辑pyizbirkom / settings.py中的DATABASES设置。 通过运行python manage.py startapp [appname]启动第一个应用程序。 您正在看到此消息,因为您在Django设置文件中有DEBUG = True并且您尚未配置任何URL。开始工作!
如果我将DEBUG = True设置为False,我会在白页上看到服务器错误(500)
我该怎么办?
更新:我在控制台中看到的内容:
Traceback (most recent call last):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\wsgiref\handlers.py", line 8
5, in run
self.result = application(self.environ, self.start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 73, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\core\ha
ndlers\wsgi.py", line 255, in __call__
response = self.get_response(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 63, in get_response
return self.serve(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 56, in serve
return serve(request, self.file_path(request.path), insecure=True)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\views.py", line 44, in serve
return static.serve(request, path, document_root=document_root, **kwargs)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\views\s
tatic.py", line 61, in serve
mimetype, encoding = mimetypes.guess_type(fullpath)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 294, in
guess_type
init()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 355, in
init
db.read_windows_registry()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 259, in
read_windows_registry
for ctype in enum_types(mimedb):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 249, in
enum_types
Traceback (most recent call last):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\wsgiref\handlers.py", line 8
5, in run
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal
not in range(128)
self.result = application(self.environ, self.start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 73, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\core\ha
ndlers\wsgi.py", line 255, in __call__
response = self.get_response(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 63, in get_response
return self.serve(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 56, in serve
Traceback (most recent call last):
return serve(request, self.file_path(request.path), insecure=True)
[12/Jun/2013 21:22:35] "GET /static/cms/jstree/tree_component.js HTTP/1.1" 500 5
9
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\views.py", line 44, in serve
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\wsgiref\handlers.py", line 8
5, in run
return static.serve(request, path, document_root=document_root, **kwargs)
self.result = application(self.environ, self.start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\views\s
tatic.py", line 61, in serve
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 73, in __call__
mimetype, encoding = mimetypes.guess_type(fullpath)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 294, in
guess_type
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\core\ha
ndlers\wsgi.py", line 255, in __call__
init()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 355, in
init
response = self.get_response(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 63, in get_response
db.read_windows_registry()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 259, in
read_windows_registry
return self.serve(request)
for ctype in enum_types(mimedb):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 56, in serve
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 249, in
enum_types
return serve(request, self.file_path(request.path), insecure=True)
ctype = ctype.encode(default_encoding) # omit in 3.x!
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\views.py", line 44, in serve
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal
not in range(128)
return static.serve(request, path, document_root=document_root, **kwargs)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\views\s
tatic.py", line 61, in serve
mimetype, encoding = mimetypes.guess_type(fullpath)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 294, in
guess_type
init()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 355, in
init
db.read_windows_registry()
[12/Jun/2013 21:22:35] "GET /static/cms/js/libs/jquery.ui.dialog.js HTTP/1.1" 50
0 59
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 259, in
read_windows_registry
for ctype in enum_types(mimedb):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 249, in
enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal
not in range(128)
[12/Jun/2013 21:22:35] "GET /static/cms/js/libs/jquery.functional.js HTTP/1.1" 5
00 59
Traceback (most recent call last):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\wsgiref\handlers.py", line 8
5, in run
self.result = application(self.environ, self.start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 73, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\core\ha
ndlers\wsgi.py", line 255, in __call__
response = self.get_response(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 63, in get_response
return self.serve(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 56, in serve
return serve(request, self.file_path(request.path), insecure=True)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\views.py", line 44, in serve
return static.serve(request, path, document_root=document_root, **kwargs)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\views\s
tatic.py", line 61, in serve
mimetype, encoding = mimetypes.guess_type(fullpath)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 294, in
guess_type
init()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 355, in
init
db.read_windows_registry()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 259, in
read_windows_registry
for ctype in enum_types(mimedb):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 249, in
enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal
not in range(128)
[12/Jun/2013 21:22:35] "GET /static/cms/js/libs/classy.min.js HTTP/1.1" 500 59
Traceback (most recent call last):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\wsgiref\handlers.py", line 8
5, in run
self.result = application(self.environ, self.start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 73, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\core\ha
ndlers\wsgi.py", line 255, in __call__
response = self.get_response(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 63, in get_response
return self.serve(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 56, in serve
return serve(request, self.file_path(request.path), insecure=True)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\views.py", line 44, in serve
return static.serve(request, path, document_root=document_root, **kwargs)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\views\s
tatic.py", line 61, in serve
mimetype, encoding = mimetypes.guess_type(fullpath)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 294, in
guess_type
init()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 355, in
init
db.read_windows_registry()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 259, in
read_windows_registry
for ctype in enum_types(mimedb):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 249, in
enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal
not in range(128)
[12/Jun/2013 21:22:35] "GET /static/cms/js/plugins/cms.setup.js HTTP/1.1" 500 59
Traceback (most recent call last):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\wsgiref\handlers.py", line 8
5, in run
self.result = application(self.environ, self.start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 73, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\core\ha
ndlers\wsgi.py", line 255, in __call__
response = self.get_response(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 63, in get_response
return self.serve(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 56, in serve
return serve(request, self.file_path(request.path), insecure=True)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\views.py", line 44, in serve
return static.serve(request, path, document_root=document_root, **kwargs)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\views\s
tatic.py", line 61, in serve
mimetype, encoding = mimetypes.guess_type(fullpath)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 294, in
guess_type
init()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 355, in
init
db.read_windows_registry()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 259, in
read_windows_registry
for ctype in enum_types(mimedb):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 249, in
enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal
not in range(128)
[12/Jun/2013 21:22:36] "GET /static/cms/js/plugins/cms.base.js HTTP/1.1" 500 59
Traceback (most recent call last):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\wsgiref\handlers.py", line 8
5, in run
self.result = application(self.environ, self.start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 73, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\core\ha
ndlers\wsgi.py", line 255, in __call__
response = self.get_response(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 63, in get_response
return self.serve(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 56, in serve
return serve(request, self.file_path(request.path), insecure=True)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\views.py", line 44, in serve
return static.serve(request, path, document_root=document_root, **kwargs)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\views\s
tatic.py", line 61, in serve
mimetype, encoding = mimetypes.guess_type(fullpath)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 294, in
guess_type
init()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 355, in
init
db.read_windows_registry()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 259, in
read_windows_registry
for ctype in enum_types(mimedb):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 249, in
enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal
not in range(128)
[12/Jun/2013 21:22:36] "GET /static/cms/js/change_list.js HTTP/1.1" 500 59
Traceback (most recent call last):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\wsgiref\handlers.py", line 8
5, in run
self.result = application(self.environ, self.start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 73, in __call__
return super(StaticFilesHandler, self).__call__(environ, start_response)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\core\ha
ndlers\wsgi.py", line 255, in __call__
response = self.get_response(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 63, in get_response
return self.serve(request)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\handlers.py", line 56, in serve
return serve(request, self.file_path(request.path), insecure=True)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\contrib
\staticfiles\views.py", line 44, in serve
return static.serve(request, path, document_root=document_root, **kwargs)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\site-packages\django\views\s
tatic.py", line 61, in serve
mimetype, encoding = mimetypes.guess_type(fullpath)
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 294, in
guess_type
init()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 355, in
init
db.read_windows_registry()
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 259, in
read_windows_registry
for ctype in enum_types(mimedb):
File "D:\WinPython-32bit-2.7.5.1\python-2.7.5\lib\mimetypes.py", line 249, in
enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 0: ordinal
not in range(128)
答案 0 :(得分:0)
此问题与Setting DEBUG = False causes 500 Error类似。你会看到你应该在settings.py文件中正确设置ALLOWED_HOSTS,如果你试图在localhost之外查看它,你也必须配置Apache(和mod_wsgi)。