Christof
ok thanks
The
Hello guys, help me please, with what i can save or insert into database video scripts ? Which method is best to use&
Raghavender
What is desktop application? In python
Doragonsureiyā
What is desktop application? In python
Looks like you need an offtopic group, please continue this conversation at @pythonofftopic as it's not related to Python
Artem
Hi guys! Does anyone know how to change datetime format for DateTimeField in Django REST? I've tried a lot of ways throughout of internet but none of them helped me. I would appreciate any help
Mirco
Hi guys! Does anyone know how to change datetime format for DateTimeField in Django REST? I've tried a lot of ways throughout of internet but none of them helped me. I would appreciate any help
Into the serializer, you have input_format and format The first one for methods like POST/PUT/PATCH and the second one for the output so GET https://www.django-rest-framework.org/api-guide/fields/#datetimefield
Mirco
I tried but it didn't help me
Take your time to understand it It works, trust me 😊
Anonymous
Hi, I've a problem. I tried to make a menu bar in django project, adding one js function. However, when i push on menubar button, the entire site gets disappeared, why is it so?
نعيم
I'd like to pass mulitple urls to html template buttons in a for loop, each href link refers to its correspond page in the urlpatterns paths... Any leads would be appreciated! <div class="btn-group"> <a href="{% url 'page1' %}" class="btn btn-primary my-2">View</a></div> I managed to get the link of one page on all buttons when the above code is inside a for loop, now I want to get all pages instead.
Akshat
Try from .models import Task
I tried this also bt its not working
Anonymous
Akshat
i am creating a todo task project so i have created a task html file but when i import it in admin it doesnt works also the urls.py file that i have created in the app homi gives me error from django.urls import path from homi import views urlpatterns = [ path('', views.homi, name='homi'), path('tasks', views.tasks, name='tasks') ] error : Cannot find reference 'views' in '__init__.py' from django.contrib import admin from home.models import Task admin.site.register(Task) and Task gives me error unresolved reference
Maxwell
How does one implement a carousel that gets images from the database??
Anonymous
There's a function for that I really forgot that 😅
Anonymous
Anonymous
He has given there clearly
Ankit
Hi guys, can any one help me with the issue. Actually bootstrap modalform I am using in django but after sumit window is not getting close and going to reference page.
Anonymous
Why my js function works in console, but onclick event doesn't?
Rup
Credit= models.FlotField(blank=True, null=True) Still facing the validation required error
Rup
Not getting it. I am allowing blank=True still it demands for value
Rup
Please help.
Rup
do you have this problem in admin panel?
No. I am facing this after migration (model.py)
Rup
set default=None
Not working. Same issue
Anonymous
Hey guys ...has anyone successfully pushed their project to heroku before? I always get these errors whenever I try to upload my projects
Anonymous
.
Jacek
What are the errors?
Anonymous
What are the errors?
Error: failed to push some refs to 'https://git.heroku.com/blogster-gangstar.git.... . I believe this to be the error message
Jacek
You have a problem with git thus
Anonymous
Error: failed to push some refs to 'https://git.heroku.com/blogster-gangstar.git.... . I believe this to be the error message
Before the error it shows: . . [ remote rejected ] master -> master (pre -receive hook declined)... . And then the error
Anonymous
You have a problem with git thus
But the project was pushed to git without a hassle
Jacek
I think you are not allowed to push to master
.
Can anyone help. How to construct views in such way /api/categories/:id/products/:id -> POST. Maybe you have some code sample, then i can see it how to implement
Marcos
What does the hook file looking like?
Anonymous
I think you are not allowed to push to master
I just pushed to my master about 11 minutes ago
Marcos
Can anyone help. How to construct views in such way /api/categories/:id/products/:id -> POST. Maybe you have some code sample, then i can see it how to implement
Do not incluye id twice but /<int:category_id>/xxx/<int:pk>/ and in your view override get_queryset método Category.objects.get(pk=self.kwargs['category_id']).products.get(pk=self.kwargs['pk'])
Marcos
I just pushed to my master about 11 minutes ago
What does your pre-receive hook file looks like??
.
Do not incluye id twice but /<int:category_id>/xxx/<int:pk>/ and in your view override get_queryset método Category.objects.get(pk=self.kwargs['category_id']).products.get(pk=self.kwargs['pk'])
Thanks. Yes i don't wanna include id twice, just for example. But in what view I should invoke this url. In CategoryView or ProductView ? Then if I want to create product in this category, I just grab the category_id from url and put into product. Am I correct ? Thanks in advancee)
Anonymous
What does your pre-receive hook file looks like??
😐 I don't think I know what a pre -receive hook file is.... I am just checking it out now😞
Marcos
In what view you will include is up to you and how your business logic needs it, regarding save I think it should be on ProductView when saving override form_valid method, def form_save(self, form): self.object = form.save(commit=False) self.object.category = Category.objects.get(pk=self............... self.object.save() ....... return your reaponse
Marcos
😐 I don't think I know what a pre -receive hook file is.... I am just checking it out now😞
pre-recive file lives in your git directory of the project .git/hooks/pre-receive Your push is being rejected due this hook validations, as you showed us before so check the validations and you will get your answer 😉
Anonymous
Gracias
Anonymous
Amigo
Marcos
De Nada
Akshat
Add " in first path you added only one "
No no actually i gave single quotes(' ') but while copying it was visible like one double coute(")
Marcos
No no actually i gave single quotes(' ') but while copying it was visible like one double coute(")
I think your error is related to project structure since djsngo cant find models and when you try to import views django says that found nothing in ini.py
aakash
Guys I am new to django, I have understood the basics and now wanna understand how to make user specific pages, can anyone reccomend any video or link for the same?
Yevhen
Really It's the best resource for learning Django
Ganesh
Really It's the best resource for learning Django
Not for beginners though... Even the examples are quite complicated
Marcos
Examples on official documentation are far from being complicated
Poojitha
can anyone tell me how to display a url field in html template
Poojitha
no... models and using django admin
âshîsh
<a href='your_url_link'> click here </a>
Poojitha
{{r.url}} ? is it correct?
Ganesh
{{r.url}} ? is it correct?
{% url 'your url'%}
Poojitha
no i was taking from models.py
Poojitha
storing urls in db and then retrieving
Ganesh
Did you create URLField in your model?
Poojitha
yes
Anonymous
You're selling code!?
Anonymous
But removes the ability to multithread
Abdul Shakoor
those who used poetry, can you tell me why I should use poetry?????