Note that there are some explanatory texts on larger screens.

plurals
  1. POstatic file with mod_wsgi in django
    primarykey
    data
    text
    <p>I've searched a lot but I still have a problem with the static files (css, image,...) with my django website.</p> <p>I'm using mod_wsgi with apache on archlinux 64bits</p> <p>I've added it in my http.conf : </p> <pre><code>LoadModule wsgi_module modules/mod_wsgi.so &lt;VirtualHost *:80&gt; WSGIDaemonProcess mart.localhost user=mart group=users processes=2 threads=25 WSGIProcessGroup mart.localhost LogLevel debug Alias /media /home/mart/programmation/python/django/martfiles/media/ &lt;Directory /home/mart/programmation/python/django/martfiles/&gt; Order allow,deny Allow from all &lt;/Directory&gt; WSGIScriptAlias / /srv/http/wsgi-scripts/django.wsgi &lt;/VirtualHost&gt; </code></pre> <p>I tried to use the django.wsgi in my home folder but it doesn't work (<code>permission denied to access /</code>) (strangely it works if I use the test script given <a href="http://wiki.archlinux.org/index.php/Mod_wsgi#Test_mod_wsgi" rel="noreferrer">here</a>)</p> <p>all the directories and content (apache folder, wsgi-script, martfiles) have the permission <code>775 root:devusers</code> with the group devusers including my user, http and root</p> <p>in my template base.html, I call the css this way :</p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" href="/media/css/style.css" /&gt; </code></pre> <p>and the error in /var/log/http/error.log</p> <pre><code> [Sat Jan 16 13:22:21 2010] [error] [client 127.0.0.1] (13)Permission denied: access to /media/css/style.css denied, referer: http://localhost/ [Sat Jan 16 13:22:21 2010] [info] mod_wsgi (pid=14783): Attach interpreter '' </code></pre> <p><a href="http://paste.pocoo.org/show/166263/" rel="noreferrer">/etc/httpd/conf/http.conf</a></p> <p><a href="http://paste.pocoo.org/show/165992" rel="noreferrer">/srv/http/wsgi-script/django.wsgi</a></p> <p><a href="http://paste.pocoo.org/show/165993/" rel="noreferrer">/home/.../martfiles/settings.py</a></p> <p>thank you</p> <hr> <p><strong>edit</strong> : I precise that my django website is working fine (except the sessions but I don't think it's related) so I'm not sure it's related to the django.wsgi file (maybe I'm wrong) but what is sure is that I should be able to use the django.wsgi from outside the apache folder</p> <p>if I change the line <code>Alias /media /home/mart/programmation/python/django/martfiles/media/</code> with <code>Alias /media /srv/http/media/</code> and gives the right permissions, it works. But I don't want (and shouldn't) to put all my media in the apache folder</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload