return render(request, 'ex/excursions.html',
{'list_of_excursions': Excursion.objects.all() })
{% for ex in list_of_excursions %}
{% if forloop.first %}
первона
{% endif %}
<a href="{{ ex.get_absolute_url }}">ex.name</a>
{% else %}
нифига нет екскурсий
{%endfor%}
r'^excursions$'
надо со слешем на конце писать #
d = []
with open(file, 'r') as f:
for i in f:
print(i)
d.append(i)
byte_count = 8
with open("myfile", "rb") as f:
byte = f.read(byte_count)
while byte != b"":
# Do stuff with byte.
byte = f.read(byte_count)
The schema in Elasticsearch is a mapping that describes the the fields in the JSON documents along with their data type, as well as how they should be indexed in the Lucene indexes that lie under the hood.