我已经按照这个在digital ocean上部署了我的django应用程序
博客:alocean.com/community/tutorials/how-to-serve-django-application-with-apache-and-mod_wsgi-on-ubuntu-16-04
这是我在控制台中获得的静态文件的错误url
(索引(:5913 GEThttp://67.205.160.21/static/js/dashkit.min.jsnet::ERR_ABORTED 403(禁止((索引(:5913 GEThttp://67.205.160.21/static/js/style.jsnet::ERR_ABORTED 403(禁止(
除了静态文件、之外,一切都很好
设置.py
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
在运行python3 manage.py collect static之后,它给出了这个
/home/podstatsclub/webapp/Podcastrongtats/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
在静态目录中,您意外地只授予了对wsgi.py的访问权限…这是一个复制粘贴错误。只需留下";要求所有被授予";那里