python - Django/Apache/Mod_WSGI - HTTP 404 Error with Static Files -


i'm trying use django + apache + wsgi on windows.

i've been using bitnami stack takes care of installation of apache. able put django project on django, however, loads webpage without static files (css, js). i've opened apache logs , static files shown 404.

this httpd-app.conf:

<directory "e:/bitnami/djangostack-1.6.7-1/apps/django/django_projects/dashboard_web/dashboard_web">     options +multiviews     allowoverride     <ifversion < 2.3 >         order allow,deny         allow     </ifversion>     <ifversion >= 2.3>         require granted         options     </ifversion>     options +execcgi   wsgiapplicationgroup %{global}     <ifversion < 2.3 >         order allow,deny         allow     </ifversion>     <ifversion >= 2.3>         require granted         options     </ifversion>     options     allowoverride     options indexes followsymlinks     options +execcgi            </directory>   alias /static/ 'e:/bitnami/djangostack-1.6.7-1/apache2/static/'  <directory 'e:/bitnami/djangostack-1.6.7-1/apache2/static'>     <ifversion < 2.3 >         order allow,deny         allow     </ifversion>     <ifversion >= 2.3>         require granted         options     </ifversion>         require granted     options     allowoverride     options indexes followsymlinks </directory>  <directory />     require granted </directory>  wsgiscriptalias /dashboard_web 'e:/bitnami/djangostack-1.6.7-1/apps/django/django_projects/dashboard_web/dashboard_web/wsgi.py' 

this settings.py:

static_url = '/static/' static_root = "e:/bitnami/djangostack-1.6.7-1/apache2/static/" 

for static files, i've used python manage.py collectstatic , generate static files "e:/bitnami/djangostack-1.6.7-1/apache2/static/", can automate fabric (so don't need update static files typing python manage.py collectstatic myself).

alias seems pointing right folder, because searchable in windows explorer. i'm not sure why happening, can point me right direction?

thanks.

edit: looks in html page

<script type="text/javascript" src="/static/webapp/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="/static/webapp/login.js"></script> <script type="text/javascript" src="/static/webapp/bootstrap-3.2.0-dist/js/bootstrap.min.js"></script> <script type="text/javascript" src="/static/webapp/zxcvbn-master/zxcvbn.js"></script> <script type="text/javascript" src="/static/webapp/jquery.pwstrength.bootstrap-1.2.2/dist/pwstrength-bootstrap-1.2.2.min.js"></script> 

this how link static files

{% load staticfiles %} <script type="text/javascript" src="{% static 'webapp/jquery-2.1.1.min.js' %}"></script> <script type="text/javascript" src="{% static 'webapp/index.js' %}"></script> <script type="text/javascript" src="{% static 'webapp/bootstrap-3.2.0-dist/js/bootstrap.min.js' %}"></script> <script type="text/javascript" src="{% static 'webapp/flot/jquery.flot.js' %}"></script> <script type="text/javascript" src="{% static 'webapp/datatables-1.10.2/media/js/jquery.datatables.min.js' %}"></script> 

in case needed make alias static file, in case, configuration this:

wsgidaemonprocess dashboard_web python-path=e:/bitnami/djangostack-1.6.7-1/apps/django/django_projects/dashboard_web/ wsgiscriptalias /dashboard_web e:/bitnami/djangostack-1.6.7-1/apps/django/django_projects/dashboard_web/dashboard_web/wsgi.py process-group=dashboard_web  alias /static/ e:/bitnami/djangostack-1.6.7-1/apache2/static/  <directory e:/bitnami/djangostack-1.6.7-1/apps/django/django_projects/dashboard_web/>  order allow,deny  allow  </directory> 

it's worth use wsgidaemonprocess when run more 1 django application. problem may coz system, may try use "\" instead of "/", example:

alias /static/ e:\bitnami\djangostack-1.6.7-1\apache2\static\ 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -