0

我已经用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)
4

1 回答 1

0

这个问题类似于Setting DEBUG = False 导致 500 Error。您将看到您应该在 settings.py 文件中正确设置您的 ALLOWED_HOSTS,如果您尝试在 localhost 之外查看它,您还必须配置 Apache(和mod_wsgi)。

于 2013-06-14T15:30:55.813 回答