Mohammad
Hi Suggest a comment app?
Charanjit Singh
Can you please explain more
https://docs.djangoproject.com/en/3.1/topics/i18n/translation/
Upasana
i've a couple of doubts, can i dm someone here related to them?
Charanjit Singh
Upasana you can ask your doubt one by one here in the group
Upasana
cool
Upasana
i'm trying to include a css animation code off the internet in my code, its displaying plain text instead of animation. i've tried various codes and checked w various websites.
Upasana
https://del.dog/styling
Upasana
👆my code
Charanjit Singh
Upsana you have to link your css file also by using static method
Randy
I am having a problem with the model formset. When submitting, I initialize the formset with a queryset, where each form has an id. On the page in the browser, all id's for the instances are also visible. But when receiving in the POST method of the formset, the instances from the forms do not have an id, and when saving (), new instances are created in the database, which should not be. Here is the view in the github: https://github.com/alechries/MyHouse24Django/blob/master/MyHome24/apps/admin/views.py#L178
b
hey guys, I'm having problem with storing variable in virtualenvwrapper, I tried searching and stuff but not one example worked for me
Randy
âshîsh
I made the print before installing the queryset. All instances have an ID. I also make a print on the html template. ID outputs. But when I get MyFormset (request.POST), I get instances from the form that have no ID /
Because you are not sending their IDs to the targeted post request. Try to send - <form method="post" action="mypost"> {% csrf_token %} <input name="myid" value={{sample.id}}> <button type="submit>submit</button> </form> And at views.py def mypost(request): if request.method=='POST': id=request.POST['myid'] print(id) return HttpResponse ("done")
Droll55
Hey. I am trying to integrate auto complete address field in my django app. The problem is that i gave no idea how to do it. I made an API places key, installed django-google-maps. The documentation is very poor, i did everything, but it does not works. Maybe there is someone experienced in that?
Anushka
Hey, guys If anyone here is interested in learning computer vision, deep learning and machine learning. Do check out this playlist on YouTube. It covers the basics first and then move on to some really fun projects, including OCR and OMR. So if you liked it, you can check it out on the link mentioned below. https://youtube.com/playlist?list=PLL64AzDOoODnPUhvdsXQdvxyFxWm9UNNT
âshîsh
{'image': None, 'title': 'titlefdsfdsfdsfsd', 'description': '<p>descriptionfds</p>', 'id': None} But why? I also make a print on the html template and ID outputs.
i can't give u pin point solution without understanding what's going on. I gave u references for your help. You have to figure out what's wrong.
Randy
i can't give u pin point solution without understanding what's going on. I gave u references for your help. You have to figure out what's wrong.
On the front, the instance has an id in the form, but on submit forms and to request.POST, the instances from the forms have no ID. Forms are sent in the formset
Randy
1. Before rendering the page in the view ID is 2. There is an ID on the page in the browser (in form.instance.id) 3. When the form is saved (submit), a POST request is sent and there is no ID in the received data in the form instances form: https://github.com/alechries/MyHouse24Django/blob/master/MyHome24/apps/admin/forms.py#L60 view: https://github.com/alechries/MyHouse24Django/blob/master/MyHome24/apps/admin/views.py#L178
Dima
class BoardDetailApiView(generics.RetrieveUpdateDestroyAPIView): serializer_class = BoardSerializer queryset = Board.objects.all() def get(self, request, pk, *args, **kwargs): offset = self.request.query_params.get('offset') or 10 limit = self.request.query_params.get('limit') or 10 offset = int(offset) limit = int(limit) start = (offset // limit) - 1 end = (start + 1) * offset cards = [] serializer = BoardSerializer(Board.objects.get(id=pk)) query = Card.objects.filter(board_id=pk)[start: end].select_related('textcard','progresscard', 'taskscard', 'habitcard') for i in query: if hasattr(i, 'textcard'): cards.append(i.textcard.as_json()) if hasattr(i, 'progresscard'): cards.append(i.progresscard.as_json()) if hasattr(i, 'taskscard'): cards.append(i.taskscard.as_json()) if hasattr(i, 'habittask'): cards.append(i.habittask.as_json()) return Response({ **serializer.data, 'cards': cards }) Hey guys, what i can do with this code, now it is very ugly
Hilariyus
Hi
Hilariyus
Hey amigo's I'm a fresher... Any anyone explain how to use dajngo... I'll hope that you all developera
^o^
When I tried to load my website, it is not loading the static files. I have used this below documentation to implement azure storage account to serve media and static files. Media uploading is working fine. Anyone come across this issue before... https://medium.com/@DawlysD/django-using-azure-blob-storage-to-handle-static-media-assets-from-scratch-90cbbc7d56be
^o^
Django built-in admin panel is working with its style. Only other CSS and js are not working
Hilariyus
I having some issues while running my django web app
^o^
Django built-in admin panel is working with its style. Only other CSS and js are not working
When I inspected the code, it is showing the path as storage account path.
^o^
Anyone had this issue before?
Василий
Hi everyone, maybe someone came across this problem
Василий
print('\udcfc'.encode('utf8','surrogateescape'))
Василий
print('\udcbd'.encode('utf8','surrogateescape'))
Tushar
Yes exactly!!
Charanjit Singh
If you are using filter and it is working then that means there are more id with same value and filter selects all the Id with same value and when you are using get it should give you error as there is more then one value if you are using get and there is more instance of the same value it returns error instead of data
Charanjit Singh
Do you have same Id for different user as well
Charanjit Singh
Yes correct its not possible I thought you might have not have made id as primary key or must have overided it
Charanjit Singh
Could you send snap of your code to analyse
Charanjit Singh
Right now it is not possible for me
Владислав
Good afternoon everyone. Who can advise the model for mods (files) and articles. I am making a game portal. Mods and articles are identical in fields, but there are some other fields, for example, a link to a file, the same field only a link to a file # 2, size, version of the mod, author of the mod. Maybe someone knows how to make one field a link to a file, but so that more links can be placed there, so as not to do url_to_1, url_to_2 in the model
Charanjit Singh
Is filter deleting all the data or a particular instance only
Harish
Filter returns a query set Get returns an object Managers are instantiated when you're dealing with querysets
Harish
It will
Harish
But I've had numerous issues with get and override the same to use a filter at the back And then converting the query set to an object if the length is 1
Randy
I have a problem with id 1. Before rendering the page in the view ID is 2. There is an ID on the page in the browser (in form.instance.id) 3. When the form is saved (submit), a POST request is sent and there is no ID in the received data in the form instances form: https://github.com/alechries/MyHouse24Django/blob/master/MyHome24/apps/admin/forms.py#L60 view: https://github.com/alechries/MyHouse24Django/blob/master/MyHome24/apps/admin/views.py#L194
Enigma
Hi everyone. in my htmls i have a button that i want to show it (or enable it to click) each hour , can anyone help me with that?
Ankit
Hi
Ankit
Can anyone suggest me when we use celery , where to store mailid whatever we used to send mail. So that next time we will not send mail to rahte id
life
How to correct insert a value {{ }} to the template? <img src="{% static 'main/avatars/{{ ch.avatar }}.png' %}"
life
after render I get: /static/main/avatars/%7B%7B%20ch.avatar%20%7D%7D.png
life
This work but I don't know is it a good idea: {% static 'main/avatars/' as basedir %} <img src="{{ basedir }}{{ ch.avatar }}.png">
Tukhtamurod
How to correct insert a value {{ }} to the template? <img src="{% static 'main/avatars/{{ ch.avatar }}.png' %}"
It is not a good idea since each ch has a different dynamic avatar, it has to be accomplished using ImageField saved to corresponding media folder using pillow module, then you can just say <img src="{{ch.avatar.url}}" /> Think about it, if you have to add new whatever ch is you will have to add the static picture manually in your case right
Tukhtamurod
As long as the User object has a delete() method not the filter or get methods, they even cant have that)) it should work. But filter returns list of objects, the vice versa should be working, delete method with get i mean, and also User.objects.filter(pk=id)[0].delete() perfectly works too
Tukhtamurod
If you want to check whether smth is being deleted or not do like that: user=User.objects.get(pk=id) print(user.delete()) It should return the deleted model with its fields in dic format @NuIllII
Ashutosh
A doubt Class Based views Or function based views. .??
Ashutosh
And How much db-query for 1) User.objects.all() 2) User.objects.all( ).prefetch_related('orders') ????
Enigma
JS
The time is diffrent for each user for example user 1 is 10:12 and user 2 is 10:59 Is it possible by js?
Tukhtamurod
The time is diffrent for each user for example user 1 is 10:12 and user 2 is 10:59 Is it possible by js?
What kinda web application is it? Is it like a game or like googlesheet where multiple users join together and work live?
Tukhtamurod
A doubt Class Based views Or function based views. .??
Depends on you, function based views are good for new learners since all the work you have to do yourself, completely customizable, later you can migrate to class based views since they offer a lot out of the box, that makes developers work easier and robust
Enigma
Is it a multiplayer game?
No its a shopping site but with free bounce cashes The user can have free mony only once in a hour by watching ads
Ankit
Do you have a database? How many emails_id do you need to save?
I don't have table for the email,. Actually every 15 mints, I am running process and which will send email. Based on logic. But should not send mail if it has already sent
Tukhtamurod
No its a shopping site but with free bounce cashes The user can have free mony only once in a hour by watching ads
Then js does not care about whether there is another user on the server right now, js works on the client side not on the server side, that means it only is responsible for a particular user
Tukhtamurod
So anyother option for me?
What I meant was in fact js is the solution
Enigma
What I meant was in fact js is the solution
Oo Do you know how it gets done?
Tukhtamurod
I don't have table for the email,. Actually every 15 mints, I am running process and which will send email. Based on logic. But should not send mail if it has already sent
Think about the way how to keep track of emails already sent, by using list for example and provide that list stay consistent throughout the process
꧁❦ I'm Farooq ❦꧂
Can any one help me to get idea about realtime environment