Меню

Tag start is not closed ошибка

Create an account to follow your favorite communities and start taking part in conversations.

r/django

Posted by10 months ago

Archived

Im trying to load an authentication view and writing the base.html file but on line ten, this errror will not go away. I have tried everything including looking at the source code. I cant figure it out I think i still just have to folder structure wrong which is abit confusing with django. Can anyone help me out. I suppose im suppose to have created a static/css/ folder with a base.css file but it still wont go away. Maybe this picture will help.

r/django - Tag start not closed error DJango

This thread is archived

New comments cannot be posted and votes cannot be cast

level 1

If you’ve been following this sub for even a short while you should realize by now the benefits of posting your actual correctly-formatted code here, so I’m not going to re-iterate them. So please, post your code. Screenshots look great as wallpaper, but are pretty much useless for code diagnosis and investigation.

level 1

Has that always been this way in python or is it a new change in the tut I’m looking at and in GitHub it has double quotes and it’s still not loading the right css . Thanks for your help

level 2

It did take the error away in the ide though

level 1

<link href="{% static 'css/base.css' %}" rel="stylesheet">

level 2

singles quotes ? lets see if that works

About Community

Subreddit Icon

News and discussion about the Django web framework.



Hi, I assume that registering *.html to the handlebars/mustache plugin wouldn’t be a terribly good idea. So I guess that I’m
experiencing this because handlebars section are inserted within

<script type=»text/x-handlebars» data-template-name=»todos/index»> … </script> tags within an html file.

Not an expert at this, so I guess closing the ticket is the right way to go.
Will read a few more sections of the ember.js tutorial, before bothering at all another time.
In any case, thanks,
Guglielmo

Il giorno 23/dic/2013, alle ore 18:04, Daniel Marcotte notifications@github.com ha scritto:

Hey @guglielmo, I was only able to reproduce this problem by disabling the plugin, so here’s my hunch about what’s going on:

It looks like the Handlebars/Mustache plugin is not active for the file you’re getting these errors in (does your file icon have a mustache on an orange background? If not, the plugin is definitely not active). You should be able to fix that by ensuring that your file pattern is associated with the plugin in Preferences…->File Types.

Optimistically closing this, but if this doesn’t get you fixed up, or you have follow-up questions, please let me know!


Reply to this email directly or view it on GitHub.

Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Hi.

the problem I’m having with my code is line 16
<input type=»radio» id=»{{ color }}» name=»colors» value=»{{ color }}»
{% if saves.get(‘color’) == color %}checked{% endif %}>

I get an error saying tag start is not closed. Can some one help me with this?

{% extends "layout.html" %}

{% block content %}
<!--Build Area -->
<form action="" method="POST" class="wrap no-top">
    <div class="grid-100 row">
        <div class="grid-30">
            <div class="title">
                <input type="text" name="name" value="{{ saves.get('name', '') }}">
            </div>
        </div>
        <div class="grid-70">
            <div class="colors">
                {% for color in options['colors'] %}
                    <input type="radio" id="{{ color }}" name="colors" value="{{ color }}"
                           {% if saves.get('color') == color %}checked{% endif %}>
                    <label for="{{ color }}"></label>
                {% endfor %}
                <button class="btn">Update</button>
            </div>
        </div>
        <div id="bear" class="grid-100">
            <div class="bear-body"><img src="/static/img/bear_body.svg" /></div>
            <div class="head"><img src="/static/img/bear_face.svg" /></div>
            <div class="nose"><img src="/static/img/bear_nose.svg" /></div>
        </div>
        <div class="items">
        </div>
    </div>
</form>

{% endblock %}

1 Answer

Mel Rumsey

seal-mask

STAFF

Hey Daniel Mohr!
I am taking a look at the code for the section you are on and it looks like there might be an issue with code that is written in the layout.html file.
I used your code from the builder.html and while the line is red, it isn’t what is throwing the error on my end. Check your layout.html file and see if it looks similar to this:

        <div class="wrap no-bottom messages bg-{{ saves.get('colors', 'black') }}">
            {% with messages = get_flashed_messages() %}
            {% if messages %}
            <ul class="flashes">
                {% for message in messages %}
                <li>{{ message }}</li>
                {% endfor %}
            </ul>
            {% endwith %}
        </div>

If so, there needs to be an endif to close out the if statement right above the endwith. Give that a try. If that doesn’t solve the problem, send over a snapshot link to your workspace and I can dig into your code and see what the issue might be.

На странице статьи есть блок комменатриев, у которого есть селектор сортировки. Параметр сортировки передаётся через view. Хочу сделать так, чтобы атрибут selected проставлялся в нужный тег option в зависимости от этого параметра. Делаю это так:

<select id="comments-sort">
    <option value="comment_datetime" {% if sort == "comment_datetime" %}selected{% endif %}>Сначала старые</option>
    <option value="-comment_datetime" {% if sort == "-comment_datetime" %}selected{% endif %}>Сначала новые</option>
    <option value="-rating_sum" {% if sort == "-rating_sum" %}selected{% endif %}>Рейтинг по-убыванию</option>
    <option value="rating_sum" {% if sort == "rating_sum" %}selected{% endif %}>Рейтинг по-возрастанию</option>
</select>

И этот код работает, но проблема в том, что PyCharm ругается на этот код с сообщением Tag start is not closed и даёт warning Attribute {% is not allowed here:
введите сюда описание изображения
И вот у меня вопрос, это PyCharm неправомерно выпендривается, или моя ошибка всё-таки где-то есть?

Back to Top

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Table is full орион как исправить ошибку
  • Table index is nil ошибка