如何进行不区分大小写的字符串比较?
就我而言,当 topic.title 等于 page.slug 时,我需要添加一个menu_active类。但现在
所以我的条件失败了
nav_bar.html
{% for topic in landing_pages %}
<li role="presentation">
<a class="{% if topic.title == page.slug %}menu_active{% endif %}" href="/{{topic.slug}}/">{{topic.title}}</a>
</li>
{% endfor %}
Run Code Online (Sandbox Code Playgroud) 我在尝试以下步骤后收到此错误ModuleNotFoundError: No module named 'django.db.migrations.migration'
python3 manage.py migrate --fake resources zero (资源是我的应用程序名称)find . -path "*/migrations/*.py" -not -name "__init__.py" -deletefind . -path "*/migrations/*.pyc" -deletepython3 manage.py showmigrations注意:使用 PostgreSQL
如何解决这个问题?