我使用sqlite3作为我的项目的数据库,当我通过键入python manage.py runserver
手动提供临时端口时,它就工作了。但是,在部署到apache服务器后,会引发异常,如下图所示。起初,我认为这是一个文件权限问题,当我在django中运行命令时,例如python manage.py runserver
、python manage.py mycommand
、python manage.py createsuperuser
,错误不会发生并且正在工作,但当我使用在/etc/apache2/sites-enabled/000-default.conf
中创建的指定端口时,错误就会出现。我使用ubuntu 20.04和apache 2.4.41作为我的环境,下面的虚拟主机配置是我为我的项目指定的端口
Listen 112
<VirtualHost *:112>
Alias /assets /home/yuan04/Projects/Lotto/assets
<Directory /home/yuan04/Projects/Lotto/assets>
Require all granted
</Directory>
<Directory /home/yuan04/Projects/Lotto/lotto>
<Files wsgi.py>
Require all granted
</Files>
<Files db.sqlite3>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess lotto python-home=/home/yuan04/Projects/Lotto/venv python-path=/home/yuan04/Projects/Lotto
WSGIProcessGroup lotto
WSGIScriptAlias / /home/yuan04/Projects/Lotto/lotto/wsgi.py
</VirtualHost>
目前没有回答
相关问题 更多 >
编程相关推荐