Tuan
I want to write table to an exissting excel template
Doragonsureiyā
hi, do you have any idea that this code does not work?
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://linkode.org, https://nekobin.com (or your favorite one)
Tuan
https://nekobin.com/jerotuxewu
S.A
Hi how to create a swagger UI for an existing post request api .
S.A
Anyone pls guide me on this
Jitxs
Is there some extra benefit to learn class based views? Or Can I skip them because my work can be done by simple views.
by class based views you mean using class instead of using only def.. am i right ?
Tuan
Whats the error?
there is no error
Tuan
[13/Jul/2023 11:17:21] "GET /?pn=&sn=&desc= HTTP/1.1" 200 1722903
Tuan
then?
nothing happen the ecxcel file is not downloaded
Tuan
im I export to excel (dont use exsting template), it works, excel file is downloaded
Mimi Khalid
Hi guys, I want to save image in media only without save in database. Is that possible?
Mimi Khalid
Please help
K
https://stackoverflow.com/questions/76672295/not-able-to-fetch-files-from-a-directory-using-llama-index-and-qdrant-db
.
Hi guys, I want to save image in media only without save in database. Is that possible?
Yes, it’s possible. https://docs.djangoproject.com/en/4.2/topics/http/file-uploads/#basic-file-uploads Follow the steps in Basic file uploads only, and stop before you go to Handling uploaded files with a model.
Ohama |
Does it possible sorting by data similarity using mysql full text for pagination?
Shoxrux
Hi guys. I have problem in rendering math equations . I found one cool library django-latexify but it only works for django template but i need in rest api for mobile app in flutter. Have somebody challenged this problem before. Any help appreciated
Sheida
Hi guys I have set ipn url for coinpayment but isnt work, can u help me ?
KingFx
I develop an app I want to receive data from a form and send them to my email account I m using django method Sending email that require to add email credentials in the code I found that is not safe Is there any other method that can use so that I dont have to share password and username to public
KingFx
I use it and add it to the gitignore file
Fauzaan一
I use it and add it to the gitignore file
yeah so when you host on a server you will be creating it. you wont have to hard code the username or password in the code.
M. Hossein
followings = models.ManyToManyField( 'self', symmetrical=False, help_text='Users to follow.', related_name='followers' ) I use this field to track which user follows whom and who are following one specific user. The problem is each user can follow itself, too which I wanna prevent. How should I prevent users to follow themselves?
M. Hossein
Yash
Hello anyone help me solve my problem . How to recive the email from the user to the admin email not send email to customer email i want recive this email query like we send our detail in company career form it send our data from using our email to send company email.
Ajay
Anybody knows how to do internationalization in django
Shanu
Good night 🌌
Zemas
Please Family help me How to runn and set up django project with vertual Environment in cmd
Tamerlan
Tamerlan
followings = models.ManyToManyField( 'self', symmetrical=False, help_text='Users to follow.', related_name='followers' ) I use this field to track which user follows whom and who are following one specific user. The problem is each user can follow itself, too which I wanna prevent. How should I prevent users to follow themselves?
from django.core.exceptions import ValidationError class User(models.Model): # Your other fields here followings = models.ManyToManyField( 'self', symmetrical=False, help_text='Users to follow.', related_name='followers' ) def clean(self): if self in self.followings.all(): raise ValidationError("A user cannot follow itself.") It is help you?
Tamerlan
Thanks a lot
I don't know for sure if it's right or not
Muhammad
Hello everyone, how to prevent multiple login in django? Is there any simle ways to do it?
God.gave
Hello everyone, how to prevent multiple login in django? Is there any simle ways to do it?
if request.user.is_authenticated: return redirect('your_home_view') you can also create a custom decorator for that
Muhammad
Thanks bro, but I mean situation when a user login from multiple devices using same login and password
God.gave
Thanks bro, but I mean situation when a user login from multiple devices using same login and password
Bro just create a field to track it . When someone logged in , you set it to true , when he logged out , set to false , then you can use schedule to logged out every user after 24hours . And also make sure if the Boolean field created is set to true the user is already logged in so you return an error
Muhammad
Thanks I just made similar thing using sessions. Now it is working
narendra
I am new to python Django. I have some basic question. 1. Can we create advance website through Django. 2. I don't want to publish it outside. Just it needs to visible in organization. 3. Adding in point 2. Do I need to publish on SharePoint or where it should be kept.? Please guide me.
Supra
I am new to python Django. I have some basic question. 1. Can we create advance website through Django. 2. I don't want to publish it outside. Just it needs to visible in organization. 3. Adding in point 2. Do I need to publish on SharePoint or where it should be kept.? Please guide me.
Here are your answers: 1) You can 2) You can using 'ngrok' or 'Localtunnel'. All users need to be connected to the same network. Google these for more info. I have personally never tried it 3) Not needed. Just make sure the app is executed from a system/PC that is running 24/7 in case the app needs to be accessible all the time
Supra
Hello everyone, how to prevent multiple login in django? Is there any simle ways to do it?
You can do it by creating a custom middleware. Someone has already created it, just Google it, you can find it. What it does is makes sure user is active in only one session at a time. If user tries to access the app from 2 different locations, it will automatically close the old session and only keep the new connection active. Search "Allowing only single active session per user in Django app". You will find an answer already available in StackOverflow.
Muhammad
Thanks I did exactly the same
Supra
Thanks I did exactly the same
Also check out django-single-session. You can simply add it as an app. It does all the heavy lifting for you.
Uzumaki
Hii
Uzumaki
I have a problem in my django code can some one tell me what to do..
Uzumaki
I cant save my contacts in my database
Uzumaki
Else every function is running and it dont even give me error
Uzumaki
Can some one help me with it
r d
Hi Would you please give me a keyword. I have a socket coonection and i want to send sth eath 1 sec to clients . How can i do it?
Seva
I've add user on my-service-XXXX.onrender.com/admin Added user was disappeared soon. How to add users correctly?
Seva
Impossible to help without details.
There are details in questrion. Render.com. cdn. How to use admin pannel of the django? All changes in db.sqlight3 was disappeared.
Д.....
Hello! I'am using pytest-django for testing my django projects. Here is my code - https://dpaste.org/ku4O2 . Idk why my formset is not valid. Can anybody help me pls ?
Д.....
Which line
the error is on 345 line
Д.....
Nerd
the error is on 345 line
this is what is on 345 assert response.url == reverse('myapp:order_success')
Д.....
this is what is on 345 assert response.url == reverse('myapp:order_success')
response.url == '/make_order/' and reverse('myapp:order_success') == '/success-order/'. however response.url must be /success-order/
Maxim
@bobik300 what do you think reverse() does with this string?
Maxim
spoiler: just rearranges the characters in reverse order
Д.....
@bobik300 what do you think reverse() does with this string?
it takes the name of path and returns it's URL address. yes ?
Д.....
spoiler: just rearranges the characters in reverse order
ok. I'm gonna try with the actual URL address, but I don't think it will change something
Rimka
Hi all. Please I am looking for python site hosting platforms
Д.....
uh, no, I'm confused
as I told - " > assert response.url == '/success-order/' E AssertionError: assert '/make_order/' == '/success-order/' E - /success-order/ E + /make_order/ tests/myapp/test_views.py:483: AssertionError ------------------------------------------------ Captured stdout call ------------------------------------------------- [] =============================================== short test summary info =============================================== FAILED tests/myapp/test_views.py::TestOrderView::test_post_valid_data - AssertionError: assert '/make_order/' == '/success-order/' "
Victor
I recommend fly.io too
Victor
But heroku is better
Д.....
Hi all. Please I am looking for python site hosting platforms
https://fly.io https://www.pythonanywhere.com/ https://www.back4app.com/ https://vercel.com/ https://www.netlify.com/