【问题标题】:Django, apache and mod_wsgiDjango、apache 和 mod_wsgi
【发布时间】:2014-11-29 19:21:36
【问题描述】:

我正在尝试使用 Django 安装部署 Apache 网络服务器。

我已经安装了 Apache 2.2.25(正在运行)和 mod_wsgi 3.5。

在我的错误日志中我得到

[Sun Oct 05 10:09:10 2014] [notice] Apache/2.2.25 (Win32) mod_wsgi/3.5 Python/3.4.1 configured -- resuming normal operations

所以我认为有些事情可能会奏效。

当我转到http://localhost/ 时出现问题。我收到了500 Internal Server Error

错误日志说:

[Sun Oct 05 10:09:10 2014] [notice] Apache/2.2.25 (Win32) mod_wsgi/3.5 Python/3.4.1 configured -- resuming normal operations
[Sun Oct 05 10:09:10 2014] [notice] Server built: Jul 10 2013 01:52:12
[Sun Oct 05 10:09:10 2014] [notice] Parent: Created child process 5832
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.0.19 for ServerName
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.0.19 for ServerName
[Sun Oct 05 10:09:10 2014] [notice] Child 5832: Child process is running
[Sun Oct 05 10:09:10 2014] [notice] Child 5832: Acquired the start mutex.
[Sun Oct 05 10:09:10 2014] [notice] Child 5832: Starting 64 worker threads.
[Sun Oct 05 10:09:10 2014] [notice] Child 5832: Starting thread to listen on port 80.
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] mod_wsgi (pid=5832): Exception occurred processing WSGI script 'C:/Users/Username/Dropbox/myproject/myproject/wsgi.py'.
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] Traceback (most recent call last):\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 359, in urlconf_module\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     return self._urlconf_module\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] \r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] During handling of the above exception, another exception occurred:\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] \r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] Traceback (most recent call last):\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\wsgi.py", line 168, in __call__\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     self.load_middleware()\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\base.py", line 46, in load_middleware\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     mw_instance = mw_class()\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\middleware\\locale.py", line 23, in __init__\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     for url_pattern in get_resolver(None).url_patterns:\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 367, in url_patterns\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 361, in urlconf_module\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     self._urlconf_module = import_module(self.urlconf_name)\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\importlib\\__init__.py", line 109, in import_module\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     return _bootstrap._gcd_import(name[level:], package, level)\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2254, in _gcd_import\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2237, in _find_and_load\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1129, in _exec\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1471, in exec_module\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Users\\Username\\Dropbox\\myproject\\myproject\\urls.py", line 8, in <module>\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     admin.autodiscover()\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\__init__.py", line 23, in autodiscover\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     autodiscover_modules('admin', register_to=site)\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\utils\\module_loading.py", line 67, in autodiscover_modules\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     for app_config in apps.get_app_configs():\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 137, in get_app_configs\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     self.check_apps_ready()\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 124, in check_apps_ready\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1]     raise AppRegistryNotReady("Apps aren't loaded yet.")\r
[Sun Oct 05 10:09:14 2014] [error] [client 127.0.0.1] django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.\r

所以问题似乎是AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'\r。首先,我认为它一定与我的项目有关,所以我尝试不加载任何应用程序,但即使使用干净的 django 项目也会导致问题(我检查了它是否适用于普通的 django 开发服务器)。

谁能看出我做错了什么?

编辑(从urls.py 中省略admin.autodiscover() 时的错误日志):

[Sun Oct 05 10:31:51 2014] [notice] Apache/2.2.25 (Win32) mod_wsgi/3.5 Python/3.4.1 configured -- resuming normal operations
[Sun Oct 05 10:31:51 2014] [notice] Server built: Jul 10 2013 01:52:12
[Sun Oct 05 10:31:51 2014] [notice] Parent: Created child process 5492
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.0.19 for ServerName
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.0.19 for ServerName
[Sun Oct 05 10:31:51 2014] [notice] Child 5492: Child process is running
[Sun Oct 05 10:31:52 2014] [notice] Child 5492: Acquired the start mutex.
[Sun Oct 05 10:31:52 2014] [notice] Child 5492: Starting 64 worker threads.
[Sun Oct 05 10:31:52 2014] [notice] Child 5492: Starting thread to listen on port 80.
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] mod_wsgi (pid=5492): Exception occurred processing WSGI script 'C:/Users/Username/Dropbox/myproject/myproject/wsgi.py'.
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] Traceback (most recent call last):\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 359, in urlconf_module\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     return self._urlconf_module\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] AttributeError: 'RegexURLResolver' object has no attribute '_urlconf_module'\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] \r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] During handling of the above exception, another exception occurred:\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] \r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] Traceback (most recent call last):\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\wsgi.py", line 168, in __call__\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     self.load_middleware()\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\base.py", line 46, in load_middleware\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     mw_instance = mw_class()\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\middleware\\locale.py", line 23, in __init__\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     for url_pattern in get_resolver(None).url_patterns:\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 367, in url_patterns\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 361, in urlconf_module\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     self._urlconf_module = import_module(self.urlconf_name)\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\importlib\\__init__.py", line 109, in import_module\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     return _bootstrap._gcd_import(name[level:], package, level)\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2254, in _gcd_import\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2237, in _find_and_load\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1129, in _exec\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 1471, in exec_module\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Users\\Username\\Dropbox\\myproject\\myproject\\urls.py", line 10, in <module>\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     url(r'^admin/', include(admin.site.urls)),\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 260, in urls\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     return self.get_urls(), self.app_name, self.name\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 221, in get_urls\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     self.check_dependencies()\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 159, in check_dependencies\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     if not apps.is_installed('django.contrib.admin'):\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 223, in is_installed\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     self.check_apps_ready()\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 124, in check_apps_ready\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1]     raise AppRegistryNotReady("Apps aren't loaded yet.")\r
[Sun Oct 05 10:32:00 2014] [error] [client 127.0.0.1] django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.\r

编辑 2:

WSGIScriptAlias / C:/Users/Username/Dropbox/myproject/myproject/wsgi.py
WSGIPythonPath C:/Users/Username/Dropbox/myproject

<Directory C:/Users/Username/Dropbox/myproject/myproject>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>

我的wsgi.py

import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'

from django.core.handlers.wsgi import WSGIHandler

application = WSGIHandler()

编辑 3 (10-07-2014):

使用 Python 2.7 时出现错误:

[Tue Oct 07 11:55:19 2014] [warn] mod_wsgi: Compiled for Python/2.7.6.
[Tue Oct 07 11:55:19 2014] [warn] mod_wsgi: Runtime using Python/2.7.8.
[Tue Oct 07 11:55:19 2014] [notice] Apache/2.2.25 (Win32) mod_wsgi/3.5 Python/2.7.8 configured -- resuming normal operations
[Tue Oct 07 11:55:19 2014] [notice] Server built: Jul 10 2013 01:52:12
[Tue Oct 07 11:55:19 2014] [notice] Parent: Created child process 5824
[Tue Oct 07 11:55:19 2014] [warn] mod_wsgi: Compiled for Python/2.7.6.
[Tue Oct 07 11:55:19 2014] [warn] mod_wsgi: Runtime using Python/2.7.8.
[Tue Oct 07 11:55:19 2014] [notice] Child 5824: Child process is running
[Tue Oct 07 11:55:20 2014] [notice] Child 5824: Acquired the start mutex.
[Tue Oct 07 11:55:20 2014] [notice] Child 5824: Starting 64 worker threads.
[Tue Oct 07 11:55:20 2014] [notice] Child 5824: Starting thread to listen on port 80.
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1] mod_wsgi (pid=5824): Exception occurred processing WSGI script 'C:/Users/sgan/Dropbox/myproject/myproject/wsgi.py'.
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1] Traceback (most recent call last):
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\wsgi.py", line 168, in __call__
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     self.load_middleware()
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\handlers\\base.py", line 46, in load_middleware
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     mw_instance = mw_class()
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\middleware\\locale.py", line 23, in __init__
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     for url_pattern in get_resolver(None).url_patterns:
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 367, in url_patterns
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\core\\urlresolvers.py", line 361, in urlconf_module
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     self._urlconf_module = import_module(self.urlconf_name)
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python27\\Lib\\importlib\\__init__.py", line 37, in import_module
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     __import__(name)
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Users\\sgan\\Dropbox\\myproject\\myproject\\urls.py", line 9, in <module>
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     url(r'^admin/', include(admin.site.urls)),
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 260, in urls
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     return self.get_urls(), self.app_name, self.name
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 221, in get_urls
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     self.check_dependencies()
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\contrib\\admin\\sites.py", line 159, in check_dependencies
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     if not apps.is_installed('django.contrib.admin'):
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 223, in is_installed
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     self.check_apps_ready()
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]   File "C:\\Python34\\Lib\\site-packages\\django-1.7-py3.4.egg\\django\\apps\\registry.py", line 124, in check_apps_ready
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1]     raise AppRegistryNotReady("Apps aren't loaded yet.")
[Tue Oct 07 11:55:25 2014] [error] [client 127.0.0.1] AppRegistryNotReady: Apps aren't loaded yet.

Apache 配置是

WSGIScriptAlias / C:/Users/Username/Dropbox/myproject/myproject/wsgi.py
WSGIPythonPath C:/Users/Username/Dropbox/myproject;C:/Python27;C:/Python27/Lib

<Directory C:/Users/Username/Dropbox/myproject/myproject>
<Files wsgi.py>
Order deny,allow
Allow from all
#Require all granted
</Files>
</Directory>

【问题讨论】:

  • 你最好先尝试python manage.py runserver,这会引发错误吗?
  • 我这样做了,它没有引发任何错误
  • 你介意贴一下你对应的apache配置行吗?
  • 我已经添加了我的配置行

标签: python django apache mod-wsgi wsgi


【解决方案1】:

问题是创建 wsgi 应用程序的正确方法是在 django 1.6 和 1.7 之间编辑到

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

现在它适用于 python 2.7 和 python 3.4

【讨论】:

    【解决方案2】:

    好像和python的版本有关。

    https://www.pythonanywhere.com/forums/topic/1278/

    您似乎为WSGIPythonPath 设置了错误的值,它应该指向python 可执行文件的文件夹,即python.exe,而不是项目。

    【讨论】:

    • 所以不能用 Django 和 Python 3.4 部署 Apache 网络服务器?
    • 好吧,至少我以前从未尝试过。您可以做的一件事是尝试从 wsgi 文件中找出包含系统路径的错误,例如在wsgi.py里面,写下import sys; raise Exception(sys.path),然后对比一下apache的sys路径和run server,看看有没有区别。
    • 我添加了新的错误日志。现在看来wsgi脚本有问题
    猜你喜欢
    • 2012-03-17
    • 1970-01-01
    • 2013-02-12
    • 1970-01-01
    • 2013-07-09
    • 2020-10-11
    • 2012-09-18
    • 1970-01-01
    • 2012-11-04
    相关资源
    最近更新 更多