相关疑难解决方法(0)

无法导入名称模式

在我写信之前urls.py,我的代码......一切都很完美.现在我有问题 - 不能去我的网站."无法导入名称模式"

urls.py是:

from django.conf.urls import patterns, include, url
Run Code Online (Sandbox Code Playgroud)

他们说这里有什么错误.

python django

71
推荐指数
5
解决办法
11万
查看次数

使用matplotlib示例时Django出错

我正在测试几个Django和matplotlib案例,如这个问题法语.

每次,它都可以在我的Mac上运行,但不在我的服务器上,我收到以下错误:

Internal Server Error: /mj/charts/mplimage.png
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/root/src/jm/majority_judgment/views.py", line 39, in mplimage
    canvas.print_png(response)
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_agg.py", line 526, in print_png
    with cbook.open_file_cm(filename_or_obj, "wb") as fh:
  File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.6/dist-packages/matplotlib/cbook/__init__.py", line 624, in open_file_cm
    fh, opened = …
Run Code Online (Sandbox Code Playgroud)

python django matplotlib

8
推荐指数
1
解决办法
2814
查看次数

标签 统计

django ×2

python ×2

matplotlib ×1