Anonymous
AttributeError: Generic detail view GoalList must be called with either an object pk or a slug in the URLconf. what does this error means?
Mirco
Manish
How to develop autocomplete search suggestions from database
dynamic
If it works why touch it?
I'm trying to upgrade my Django from 1.9 to 2.22. In the process, I'm sequentially upgrading it to all the minor releases, fixing the errors and then going forward from that. When I'm trying to move to Django 1.10. I'm getting the error that django-pgjson is not compatible, as it has not been updated since 2015. In order to update, i need to somehow replace Django-pgjson, from which JsonBField is being used in the model.
Ильяс
How to connect styles and img in root urls ?
Mirco
? root urls ?
Ильяс
? root urls ?
in main project urls
Ильяс
Should it be like this? + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT), static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Ильяс
(urls.E004) Your URL pattern [<URLPattern '^static\/(?P<path>.*)$'>] is invalid. Ensure that urlpatterns is a list of path() and/or re_path() instances.
Ильяс
I have this error after connecting static and images
Ильяс
share your settings and urlspattern
https://repl.it/repls/VividRoyalblueProgramminglanguage
Mirco
https://repl.it/repls/VividRoyalblueProgramminglanguage
don't use comma to add the other static() , you need to concatenate to the urlspattern that's why you need to know python before using django 😊
Mirco
Thanks)))
yw 😊
Ильяс
yw 😊
How can i wrap all urls in {% static %} ? Or i wil have to do it one by one? I am using pycharm
Ильяс
urls in a template
Ильяс
the all have different path will it be possible?
007
How to get entire field from model, example :- i want name field from model and then assign name = value in views, how to do this ?
Mirco
the all have different path will it be possible?
why not ? if they are into the root you defined into settings
007
tmp = school.objects.get(name) tmp.name = 'studentOne' tmp.save() Not working
Kostya
tmp = school.objects.get(name=name)
007
tmp = school.objects.get(name=name)
But initially name is empty
Kostya
How do u get value for name?
Kostya
And are u sure than field name in db is unique?
007
From input fireld
Kostya
Method get find only one element with name equal 'Kostya'(example)if find more than one element that raise to exception
007
what are you trying to do ? update view ?
Yeah , i have used create_or_get() ,but it gives an error, Intially name field is empty , if user enter the name it should updated
Mirco
Yeah , i have used create_or_get() ,but it gives an error, Intially name field is empty , if user enter the name it should updated
you have a beautiful generic view called UpdateView that does all u need by specifying a model and template
Mirco
https://docs.djangoproject.com/en/2.2/ref/class-based-views/generic-editing/#updateview
Mirco
Ok ty, I'll try it
make a friendship with class based views and generic ones, you will be happier in the next future 😊
Shreehari
Guys im working on a small project, need help with a part or it. There are some set of *.json files in a github repo. All those files contain a url each and those url's get updated too frequently. I want to get those url to be automatically updated in my template. How can i do this? It would be helpful id i get some references
Mirco
Yeah, got it 👍
👍🏻
Artyom
Hi, devs! I have to generate an excel file from few ModelResource classes. But I havn't idea when (wich variable of class) and how I have to set multiresource variable in views.py function.. code here: https://pyfiddle.io/fiddle/3e4ab529-2976-41da-96c8-70e124ff4a0f/?i=true
Artyom
I think it is common task
Ayyan
No it’s not
Artyom
please read the group rules and use code sharing service
Sorry, I had eddited message, link was added
Anders (izzno / gooood) 🇳🇴
I think it is common task
It is: django-import-export
Artyom
It is: django-import-export
Yes, but how to use few resource for one ecxcel document
Anders (izzno / gooood) 🇳🇴
Yes, but how to use few resource for one ecxcel document
I dont know what that means, but read the docs and I'm sure you can get what you want.
Anders (izzno / gooood) 🇳🇴
Like whats a resource...
Aleksey
Hello, everyone. Can i add additional cond in annotate by relation field in dhango <= 1.5 ? I need join cond like this LEFT OUTER JOIN "animals_animalgroupsubcount" ON ("animals_animalgroup"."id" = "animals_animalgroupsubcount"."animalgroup_id" AND "animals_animalgroupsubcount"."info_date" <= '2019-06-07 17:02:25' AND "animals_animalgroupsubcount"."info_date_next" > '2019-06-07 17:02:25')
Aleksey
Sorry, I have no idea how to use context manager in this situation😔 I need to calculate sum by field of related models with condition.
inchidi
oh i thought django
cj
oh i thought django
are you blind, sir?
inchidi
sorry
dhelbegor
someone here use graphene-django? I need to impletement a pagination in my project, but I have no ideia in how to do this
Krunal
How to get difference between two dates in django
cj
How to get difference between two dates in django
what have you tried? (please tell me you've done some research before, it's so basic-easy task)
Krunal
what have you tried? (please tell me you've done some research before, it's so basic-easy task)
I can get the result but it's in timedelta object so I am facing the problem while inserting it db
Anonymous
Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/products Using the URLconf defined in booktime.urls, Django tried these URL patterns, in this order: admin/ about-us/ [name='about_us'] [name='home'] contact-us/ [name='contact_us'] products/<slug:tag>/ [name='products'] ^media\/(?P<path>.*)$ The current path, products, didn't match any of these.
Anonymous
guys help me please
Eric
guys help me please
Your ULRCONF expects /products/<something>/ but you typed just "/products/" with no "tag" Either edit your URLCONF to add another route for /products/ to be the root or product landing page, or change the existing route to not have the "slug:tag" part (if you do that your view will also have to be edited)
Muflone
What's the difference from before? Read what @ekiara wrote you before
Eric
In the browser type something similar to "/products/56/" to match the format specified in your urls.py file... Or if you insist on young /products/ then change the format in your urls.py to be path("products/"..) I recommend that you read https://docs.djangoproject.com/en/2.2/topics/http/urls/ and maybe go through the full official tutorial once.
Anonymous
Hi guys, Anyone can help me please? I need to create a tool but I can't because I am a beginner.
Anonymous
My csrf_token is not working
Anonymous
Can anyone help
Anonymous
My csrf_token is not working
Why is it not working?
Anonymous
Not error ...but the username and password field is jot showing up in the Html page
Anonymous
Can hoy show you templete?
Anonymous
You *