小编Mit*_*ara的帖子

在 django 3.0 上为 include() 提供命名空间参数

在 Django 3.0 中,这给出了错误:

django.core.exceptions.ImproperlyConfigured: Passing a 3-tuple to include() is not supported. Pass a 2-tuple containing the list of patterns and app_name, and provide the namespace argument to include() instead.
Run Code Online (Sandbox Code Playgroud)

我该怎么改url(r'^admin/', include(admin.site.urls))?我试着看文档,

from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^hello/', include(myapp.views)),
]
Run Code Online (Sandbox Code Playgroud)

django python-3.7

6
推荐指数
1
解决办法
1194
查看次数

mysqlclient 在 Mac 操作系统上的 python3 中安装

在python3系统中安装mysqlclient出现这个错误

命令pip3 install mysqlclient

错误:命令错误,退出状态 1:python setup.py Egg_info 检查日志以获取完整的命令输出。

ERROR: Command errored out with exit status 1:
 command: /usr/local/opt/python/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/pip-egg-info
     cwd: /private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/
Complete output (12 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/setup.py", line 16, in <module>
    metadata, options = get_config()
  File …
Run Code Online (Sandbox Code Playgroud)

django python-3.7

3
推荐指数
1
解决办法
3518
查看次数

标签 统计

django ×2

python-3.7 ×2