One one of my pages, the static url is not rendering correctly. For instance:
<link href="//static/static/css/style.css" rel="stylesheet">
It's a contact form and here's the view:
def contact(request):
Success = False
email = ""
title = ""
text = ""
if request.method == "POST":
contact_form = ContactForm(request.POST)
if contact_form.is_valid():
Success = True
email = contact_form.cleaned_data['email']
title = contact_form.cleaned_data['title']
text = contact_form.cleaned_data['text']
else:
contact_form = ContactForm()
ctx = {'contact_form':contact_form, 'email':email, 'title':title, 'text':text, 'success':success}
return render_to_response('website/contact.html', ctx, context_instance=RequestContext(request))
Template:
{% if success %}
<p>{{ email }}</p>
<p>{{ title }}</p>
<p>{{ text }}</p>
{% else %}
<form action"." method="POST">
{{ contact_form.as_p }}
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
{% endif %}
All other pages are loading corrctly, and the only difference is this form. Does anyone know what's going on?
Edit:
The template code that renders the url is:
<link href="/{{ STATIC_URL }}static/css/bootstrap.css" rel="stylesheet">
And the relevant settings.py code:
STATIC_ROOT = os.path.join(os.path.dirname(__file__), "static")
CURRENT_PATH = os.path.abspath(os.path.dirname(__file__).decode('utf-8')).replace('\\', '/')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(CURRENT_PATH, '/static/'),
)