【发布时间】:2021-03-24 14:03:36
【问题描述】:
我已经按照这个在 digitel ocean 上部署了我的 django 应用程序
博客:alocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-16-04
这是我在控制台获取静态文件时出现的错误网址
(索引):5913 GET http://67.205.160.21/static/js/dashkit.min.js net::ERR_ABORTED 403(禁止)(索引):5913 GET http://67.205.160.21/static/js/style.jsnet::ERR_ABORTED 403 (禁止)
除了静态文件,一切都很好,
settings.py
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
运行 python3 manage.py collect static 后,它给出了这个
/home/podstatsclub/webapp/Podcast_stats/static
我已将其放入 default.config 文件中,看起来像这样
Alias /static /home/podstatsclub/webapp/Podcast_stats/static <Directory /home/podstatsclub/webapp/Podcast_stats/static> <Files wsgi.py> Require all granted </Files> </Directory> <Directory /home/podstatsclub/webapp/Podcast_stats/podcast> <Files wsgi.py> Require all granted </Files> </Directory> WSGIDaemonProcess Podcast_stats python-home=/home/podstatsclub/webapp/Podcast_stats/env pytho> WSGIProcessGroup Podcast_stats WSGIScriptAlias / /home/podstatsclub/webapp/Podcast_stats/podcast/wsgi.py
【问题讨论】:
标签: python django digital-ocean django-deployment