Answer the question
In order to leave comments, you need to log in
Is Django not working properly?
There is a pattern
{% extends "home/base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<div class="container">
<div class="col-xs-8 col-xs-offset-2">
<form action="." method="POST">
{% csrf_token %}
{{ form|crispy }}
<br>
<input type='submit' class='btn btn-default' value='Update'>
</form>
</div>
</div>
{% endblock %}
{% extends "home/base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<div class="container">
<h2>{{ title }} page</h2>
<form method='POST' action='.'>
{% csrf_token %}
{{ form|crispy }}
<input type='submit' class='btn btn-success'>
</form>
</div>
<style>
.asteriskField {
display: none;
}
</style>
{% endblock content %}
Answer the question
In order to leave comments, you need to log in
Set up the static files correctly.
STATIC_URL = '/static/'
или
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'posts/static'),
)
You need to connect statics only through{% static "[путь до файла]" %}
Judging by your comments in the discussion, your project is either poorly planned in terms of statics, or you connect it incorrectly. Relative paths with ../ should not be used at all.
Most likely the correct path should be: /static/posts/js/jquery-3.3.1.min.js yes?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question