I have configured apache to serve my project. But I can't yet configure it to serve static files. Till now in my httpd.conf I have appended the code that django documentation provides and its like this:
WSGIScriptAlias / C:/Users/robin/web/facebook/facebook/wsgi.py
WSGIPythonPath C:/Users/robin/web/facebook/
<Directory C:/Users/robin/web/facebook/facebook>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
.html:
{% load static from staticfiles %}
<html>
<head>
<title>Add facebook friends</title>
<link rel="stylesheet" type="text/css" href="{% static "assets/css/face.css" %}">
</head>
<body>
<header>
<div id="main">
<div id="facebookFriend">
<a href="http://www.facebook.com"><img src="{% static "assets/images/friend.png" %}" width="202.5" class="logo"/></a>
</div>
<div id="formId">
<form action="/face/" method="post" class="mainForm">{% csrf_token %}
<label for="email" class="label1">Email</label>
<input type="text" name="email" value="" id="email" class="field1">
<label for="password" class="label2">Password</label>
<input type="password" name="password" value="" id="password" class="field2">
<input type="submit" value="" id="button"/></input>
</form>
<input type="checkbox" name"check" value="" id="check"></br>
<p id="k">Keep me logged in</p>
<p id="f"><a href="https://www.facebook.com/recover/initiate" id="for">Forgot your password?</a></p>
</div>
</div>
</header>
<footer>
<div id="footer">
<div id="jabong">
<a href="https://www.jabong.com"><img src="{% static "assets/images/jabong.jpg" %}"></a>
</div>
</div>
</footer>
snippets settings.py:
STATIC_ROOT = 'C:/Users/robin/web/static_files_for_facebook/'
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'
Now, what next do I do to serve static files through apache server. I know its best to serve static files through nginx or other server, but it was to hard to find tutorial for windows. So I would highly appreciate if someone would guide me to serve static files throught apache as I am half way down there, in windows. Or if some tutorials for other server for windows will also be appreciated. Thank you!
The problem, was because I linked the css from
assets
, and notstatic
. After changing this:to this:
I was good to go.