The Summer
Guys how to use range() in template
The Summer
I want to make pagination links
Anonymous
{% for i in range(n) %} #your_code {% endfor %}
Anonymous
Guys how to use range() in template
https://stackoverflow.com/questions/1107737/numeric-for-loop-in-django-templates
Anonymous
Hi, everyone. Which good books do you know about django?
drunktimelord
drunktimelord
thx
Anonymous
Yeah, thanks
drunktimelord
Yeah, thanks
go only for the 4th edition
drunktimelord
there have been a few breaking changes since django 2
👨🏻‍🦲
hello, I want to save a value in the web browser client, which can only be used in that tab, when opening a new tab will create a new value, for example, in tab 1 I save a value with the name "key1", when opening a new tab, a new value added with the name "key2", when tab 1 closes the value of "key1" is deleted, how do you make it?
Anonymous
go only for the 4th edition
Are you about 4th release
Anonymous
?
drunktimelord
👨🏻‍🦲
1. check if there is a value "Key [1-10]" 2. if the "Key3" value is not available it will be created. 3. When the tab closes, the value of "Key3" is deleted. what method is suitable for this? session or local storage? or use another method?
Anonymous
4th edition
Ok, thanks
The Summer
{% for i in range(n) %} #your_code {% endfor %}
In template, range doesn't work
The Summer
Using for loop
In template, range doesn't work
The Summer
https://stackoverflow.com/questions/1107737/numeric-for-loop-in-django-templates
This is confusing for me can u write one simple for loop with range(5)
The Summer
1.5
Anonymous
This is confusing for me can u write one simple for loop with range(5)
In your views.py While rendering the template return render( request, 'templateName.html' ,{'range':range(n) } ) In your templateName.html {% for n in range %} {{n}} #your_code {% endfor %}
Jaydeep
MultiValueDictKeyError in login page while clicking on register button Please help
Jaydeep
There are two buttons on login page 1st login 2nd register
Kaushal
MultiValueDictKeyError in login page while clicking on register button Please help
Use request.POST.get(' ') instead of request.POST[' ']
Jaydeep
Ok
🧩
Somebody used taggit?
Денис
Somebody used taggit?
First: this is a meta-question that is not the best option to start with. Just say what's your problem. Second: "Django By Example" book has a good working case with taggit.
🧩
Sorry. I read this book. My problem is when i parsing articles from site and save it, tags don’t save.
Денис
Денис
i created customs commands
I feel even less informed than before. Post your views.py to pastebin
Денис
is all the remaining content saved correctly?
🧩
it should save to my models it's not related to views.py at all
Денис
it should save to my models it's not related to views.py at all
Yes. But it's views.py that's responsible to execute model.save()
Денис
how do you parse with django? You should probably create some API commands (views) that just accept requests and save their contents to DB
🧩
i use requests
🧩
or requests_html
🧩
or urllib3
Денис
Alright. The first thing you should check is how your parser executes your model's save(). Is all the information in its proper fields upon saving?
🧩
I'm interested in one thing In what format to transmit tags (in taggit lib) ?
🧩
string, list?
Денис
em.... list of strings?
Денис
I don't recall
Денис
there's a simple example on GitHub: https://github.com/jazzband/django-taggit
ashish
Has anyone in the group used nginx rtmp. I am having problem deploying Django and the streaming server on digitalocean simultaneously, should I have two nginx configuration files or one will do, I have been trying this for days now
sergio
Hello, Django how to reconnect after DatabaseError: query timeout? any idea?
Anonymous
OperationalError at /app1/register/ table app1_userprofileinfo has no column named age
Anonymous
can anyone helpme in sorting this error
Dcruz
Migrate?
Anonymous
yes i do,but still it comes
ashish
OperationalError at /app1/register/ table app1_userprofileinfo has no column named age
This simply means your profile table does not have column age. Which database are you using?
Anonymous
sqlite3
Anonymous
Anonymous
but i have declared age column in models file
ashish
but i have declared age column in models file
But they have not migrated yet so Django doesn't know about it yet
Anonymous
but i have declared age column in models file
Have you mention the same field name in views.py while storing dara
ashish
Clear your migrations folder except init. Py and run migrations once again
Anonymous
https://del.dog/odigukaruk models.py file https://del.dog/nagoqixuxu views.py file
ashish
Have you tried clearing migrations
ashish
Because there are no problem in model and view here
Anonymous
Yeah I have cleared migration folder
Anonymous
Can you tell me how to access sqlite3 from command line to check tables
ashish
Run make migrations
ashish
And migrate
ashish
Once more
ashish
Age will now show up
ashish
Hello, Django how to reconnect after DatabaseError: query timeout? any idea?
I don't think we can try again. Django tries once per query.. Have you checked your query
sergio
I don't think we can try again. Django tries once per query.. Have you checked your query
I have a db cycle, but other tasks are done in the cycle, they can take seconds or minutes. the timeout of the db (pgpool - postgresql) is 180 seconds it is not an option to increase this time
Maksim
when i apply migrations i get a mistake "django.contrib.messages.context_processors.message must be enabled in DJangoTemplates in orrder to use the application
Anonymous
I have a table with many to many to field, Now i have a variable with nested list(list with multiple list ex. [[],[],[]] like this) i want to put that variable as values to my many to many field by obj.fieldname.set() or .add() method . But it is showing error unhashable list type . Anyone can help?? Thanks in advance
🧩
Guys,who know how to convert this " <QuerySet [<Tag: body>]>" to "body"? ( this is lib taggit)
Ghorz
👍👍👍👍👍👍👍