cj
Hi guys how can i create dynamic bootstrap accordion in django
that's related to JS actually , not django
Matin
that's related to JS actually , not django
No I wanna add accordions with django administration (models), and I have problem with accordions id in HTML , when I open an accordion,all accordions will open.
Matin
Ok , I'll be appreciated if you help me
Mikhail
I suppose, that problem with accordion in the area of musical instruments, not django
Matin
So what should I do..
Charly
So what should I do..
Ask in a proper group and show what you have done
Pooya
Hi to all, Can anybody tell me how I can build music notation and play it with django?
Charly
Hi to all, Can anybody tell me how I can build music notation and play it with django?
Django runs on the server, do you want to play sounds in the server where no one is to hear it?
Joao Paulo
hello everyone! i'm stuck trying to use django automcomplete light inside a modal ... anyone with experience in this situation?
Charly
hello everyone! i'm stuck trying to use django automcomplete light inside a modal ... anyone with experience in this situation?
We can't say are are experiencing the same situation because you didn't give any details of the situation
Joao Paulo
i cant load the autcomplete data ...that's the problem...outside modal it works...
Mikhail
Hi to all, Can anybody tell me how I can build music notation and play it with django?
Think u can collaborate with Mohammadreza above with his accordion problem to find solution
Charly
No, I want user to hear it
Then that must be done on the frontend, JavaScript not python
Godfred
Hello, please any Django documentation for me as a beginner
Carlos Z. Bent
Hello, please any Django documentation for me as a beginner
https://docs.djangoproject.com/en/stable/intro/tutorial01/
Godfred
Thank you
Roshan
× Encountered error while trying to install package. ╰─> psycopg2 i face this error..please help me on it
Prakash
Please suggest me I have a CSV file Which I have to display on a html page in table format But requirement is to display on html page as well as edit those data.. any idea? Basically fetch data from CSV and display+edit option i need
Carolyn
Hi I want to create some APIs using django and utilize them in my frontend which is in next.js Do i need to integrate them? Or I just can keep them separate and use it with fetch api?
Carolyn
"keep them separate and use it with fetch ap" - right way
Ok so can i also handle the authorization this way?😁
Mikhail
yep, for example from docs: https://docs.djangoproject.com/en/4.1/topics/auth/default/
SUSHANT
I am getting INDENTATION error in views.py ...in return statement...
Sergey
hi everyone! Is there any way to paginate on some nested field?
@lex
how to solve error that shown the browser page not found 404
Vishal
how to have a form from another model inside a detailview in django?
Vishal
Anyone can help me regarding this ?
Safeer
Is there anybody who can help with python django tutorial complete course 2022 video?
Safeer
In youtube videos are outdated
Maxim
In youtube videos are outdated
so, what do you want ? pirated courses ?
Gregory
I try manage my static files. I have: STATIC_ROOT = os.path.join(ROOT_DIR, 'static/') STATIC_URL = 'static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), ] i made python manage.py collstatics it was OK. All my files coped to STATIC_ROOT Bat i have 404: [09/Sep/2022 13:42:51] "GET /static/admin/js/vendor/jquery/jquery.min.js HTTP/1.1" 404 179 [09/Sep/2022 13:42:52] "GET /static/admin/js/vendor/xregexp/xregexp.min.js HTTP/1.1" 404 179 Whats wrong?
Carlos Z. Bent
I am getting INDENTATION error in views.py ...in return statement...
sometimes I get that error without reason. I just remove all indentation for that specific block of code, and then indent it correctly line by line
Mikhail
pycharm -> code -> reformat will help with indentations even in Django projects
Maxim
No Name please read the rules
Peter
Hi team, I am a django student. I have learnt a lot in the last few months but I have a question. http://linkode.org/#wopJlJUeCB1VvzAbyXUO53
Maxim
Hi team, I am a django student. I have learnt a lot in the last few months but I have a question. http://linkode.org/#wopJlJUeCB1VvzAbyXUO53
as you did: unnecessary information and linkode link here, everything else on the link as you should do: issue description and link here, code by link, unnecessary information in /dev/null
Peter
as you did: unnecessary information and linkode link here, everything else on the link as you should do: issue description and link here, code by link, unnecessary information in /dev/null
Apologies if i broke rules. I am trying to auto-save a value to a model every time I upload a csv. I know how to do this using a form but I am wondering if the model can capture this automatically. http://linkode.org/#pbj0t5w2LULgsrC2n31Yc6
hello
I am building a charging station booking django application, I want to know , how should I make model so that no 2 people can book charging station for same time interval.
hello
If any one know than can you help me.
xdd
Hi all, help me please, if someone here worked with stripe, maybe you know, how i can fix the PermissionError?
Carlos
Hi all, do you recommen Work with django templates for medium project ?
Peter
it's not about rules, it's about common sense
Thanks for triggering my mind to think outside the box. Form in the views function receives request.POST which is a QueryDict. The trick was to create a querydict from a python dictionary and then save the form.
Peter
http://linkode.org/#tRO5SRNAhXKdRG1c8ao9L3
finegorko
guys what's better: Comment.objects.filter(post=self.kwargs.get('post_id')) or get_object_or_404(Post, pk=self.kwargs.get('post_id')).comments.all() ?
Naggafin
guys what's better: Comment.objects.filter(post=self.kwargs.get('post_id')) or get_object_or_404(Post, pk=self.kwargs.get('post_id')).comments.all() ?
I guess that really depends on how you like to write code. personally whenever I use get_obj_or_404() I always assign the result and then use that as opposed to directly operating on the return value. seems more readable to me. in terms of number of db queries the first one is fewer though, because get_obj_or_404 will, I believe, query for the object matching your criteria, then after that query returns, query all objects in its related comments field
Naggafin
honestly I would do both though (get the object and then get all its comments) because then you can error check if an invalid post_id was given. pulling directly from kwargs could give the filter function invalid data and if you don't handle the resulting exception you'll get a 500 response
Nour
Good evening everyone I'm trying to deploy a website on pythonanywhere and it keeps showing: No module named 'django'
Nour
I can see django in my venv Using pip list
finegorko
I guess that really depends on how you like to write code. personally whenever I use get_obj_or_404() I always assign the result and then use that as opposed to directly operating on the return value. seems more readable to me. in terms of number of db queries the first one is fewer though, because get_obj_or_404 will, I believe, query for the object matching your criteria, then after that query returns, query all objects in its related comments field
thanks for the answer! I just want to do "right" in terms of logic, full functions looks like this: def get_queryset(self): post = get_object_or_404(Post, pk=self.kwargs.get('post_id')) return comments.all() or def get_queryset(self): queryset = Comment.objects.filter(post=self.kwargs.get('post_id')) return queryset
finegorko
finegorko
or ur requirements.txt
Nour
pip install django sir
It's installed
Nour
I can import it using bash
Rojitech
It's installed
Are you using a virtual env
Naggafin
the reason being is because it can be erroneous to directly pull from self.kwargs in a view and feed it into a model filter
Nour
Yes
Naggafin
say if someone typed the URL and fed junk data like ?post_id=sokfiwnahisjwnd . inputting that into filter might be erroneous if it can't coerce to a type
Rojitech
Yes
Make sure you add it to your requirements
Naggafin
it looks like your post_id field should coerce into an integer, but obviously such a string doesn't coerce, and there for would result in 500 response
Nour
Make sure you add it to your requirements
I added it and I'm running it using: "Start console in this virtualenv" btn
Naggafin
now with get_obj_or_404, obviously you'd get a 404 response for any possible lookup failure, which is probably the desired behavior
finegorko
thank you sir !
Naggafin
what operating system are you trying to deploy on?
Nour
I think linux
Naggafin
OK, that's good. it's much easier IMHO to operate django, or python at all for that matter, on a Unix based OS