Tag start is not closed ошибка

In my HTML page, I am getting an error Tag start is not closed after the .jpg
Here’s the code:

{% load staticfiles %}

<figure>
  <img src="{% static "FLC image.jpg" %}" alt="The Pulpit Rock" width="304" height="228">
</figure>

What is wrong with code ?

asked Oct 11, 2019 at 7:00

Yantra Logistics's user avatar

4

You can close the image tag. Try the below code.

{% load staticfiles %}

<figure>
  <img src="{% static "FLC image.jpg" %}" alt="The Pulpit Rock" width="304" height="228"/>
</figure>

answered Oct 11, 2019 at 7:06

Pushprajsinh Chudasama's user avatar

That doesn’t affect the loading of the page, its because of PyCharm IDE. You can still run the runserver command and get the desired output.

If you are using the closing tags then your error will be gone but you wont get the desired output.

{% load staticfiles %}
    </img {% static "FLC image.jpg" %}" alt="The Pulpit Rock" width="304" height="228">

(or)

 {% load staticfiles %}
    <img {% static "FLC image.jpg" %}" alt="The Pulpit Rock" width="304" height="228" />

If you are using recent versions of Django try replacing {% load staticfiles %} with
{ %load static % }

So finally use the below code to get your desired result

{% load static %}
    <img {% static "FLC image.jpg" %}" alt="The Pulpit Rock" width="304" height="228" >

answered Jan 7, 2021 at 7:03

Panyam Praneeth Reddy 's user avatar

<!-- Comment --> is the way to add comments in an XML file. Doesn’t that actually means, that this part is not «compiled»?

However, when I do something like this:

<item android:id="@+id/ss3"
    android:icon="@drawable/some_icon"
    android:title="Blabla Title"
    tools:ignore="AppCompatResource"
    <!-- -->
/>

I get an error «Tag start is not closed». Why?

Andrew T.'s user avatar

Andrew T.

4,6918 gold badges43 silver badges62 bronze badges

asked Sep 7, 2014 at 21:32

user3801167's user avatar

Comments are not allowed inside tags. You have to close the tag first with «>» or «/>» and then you can add your comment there.

answered Sep 7, 2014 at 21:38

Miro Lehtonen's user avatar

2

androidjavaxmlxml-comments

<!-- Comment --> is the way to add comments in an XML file. Doesn’t that actually means, that this part is not «compiled»?

However, when I do something like this:

<item android:id="@+id/ss3"
    android:icon="@drawable/some_icon"
    android:title="Blabla Title"
    tools:ignore="AppCompatResource"
    <!-- -->
/>

I get an error «Tag start is not closed». Why?

Best Solution

Comments are not allowed inside tags. You have to close the tag first with «>» or «/>» and then you can add your comment there.

Related Solutions

C# – XML multiline comments in C# – what am I doing wrong

Try this

/// <summary>
/// this comment is on line 1 in the tooltip
/// <para>this comment is on line 2 in the tooltip</para>
/// </summary>

Xml – How to comment attributes inside an XML tag

No, this isn’t possible. Comments are not allowed in an XML open tag. Depending on your application, you might get away with «commenting out» the attributes by prefixing their names with «_», or you might not (if the XML is validated against a schema or all attributes are parsed). Because whitespace is allowed, and most editors support line operations, you can «comment» multiple attributes easily this way:

<element
   _attr1="value1"
   _attr2="value2"
   _attr3="value3"
>

But these attributes are still part of the document.


Go to django


r/django


r/django

News and links for Django developers.




Members





Online



by

[deleted]



Tag start not closed error DJango

[removed]

Sorry, this post was removed by Reddit’s spam filters.

Archived post. New comments cannot be posted and votes cannot be cast.

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.

Возможно, вам также будет интересно:

  • Table is full орион как исправить ошибку
  • Table index is nil ошибка
  • Table has no index order set ошибка foxpro
  • Taberror inconsistent use of tabs and spaces in indentation python ошибка
  • T6sp exe call of duty black ops 2 ошибка при запуске

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

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