I have a problem with jQuery in my project
as I can't successfully call any js function. I have added the jquery library to home.html
<script type="text/javascript" src="{% static '/js/jquery-1.11.3.min.js' %} ">
</script>
and I try to call something like:
{% extends "posts/home.html" %}
{% block content %}
<select onchange="dzialaj()">
{% for author in users %}
<option value={{author.id}}>{{author.username}}</option>
{% endfor %}
</select>
<div id='posty'>
</div>
{% endblock %}
but calling even a simple alert() doesn't give any result.
my settings static conf:
STATIC_URL = '/static/'
CRISPY_TEMPLATE_PACK = 'bootstrap3'
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static_env","static_root")
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static_pro", "my_static"),
#'/var/www/static/',
)
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static_env","media_root")
i have loaded static files in my base template too
update: I found that this problem can be a bug in python 2.7 Does someone know how to fix it?
staticfolder structure