Anonymous
Hi, when i want to post a user (it has a field that is foreign key(postname) for position table) the serialized data is valid, but it doesn't save or create. any help will be appreciated
Sayed
Hi guys, i have an api endpoint that takes an excel file as a request, how can i write a unit test to this api
Arezoo
hi , how can i learn write makefile?
Arezoo
what is syntax of makefile?
Mirco
what is syntax of makefile?
1. you are OT 2. Have a look at Fabric instead of Makefile, at least you can keep using Python 😊
Sasha
Hi! using Postman, I got "detail": "CSRF Failed: CSRF cookie not set." . I turned off csrf from middlewware, but still getting this response. I am getting correct response with requests library.
Arezoo
what is OT?
Giacomo
Does someone feel comfortable with django-filter? Or write filters on their own? Im looking for best practices
Maxim
what is OT?
offtopic
Mirco
sorry?
it's normal, the session auth Django uses excepts the CSRF token everytime you POST data Read the full topic about it on official doc
Sasha
you are working with Django Rest ?
yes the endpoint is django rest
Mirco
yes the endpoint is django rest
Ok so, you have the handle the authentication classes The SessionAuthentication requires the CSRF token passed via headers Maybe you wanna use some other auth ways like token one
Varun
how can we capture the time spent by user in a specific page ..
Baljinder
How to add data into your database in django project how to use frontend website to add data in database in django any solution for that
SnipThinK
What best way to make chat application using DRF?
Mirco
What best way to make chat application using DRF?
by using websockets and django-channels
SnipThinK
by using websockets and django-channels
Any available resources to learn and implement?
Mirco
Any available resources to learn and implement?
The official doc of Django channels
SnipThinK
Will check thanks
Piyush
I need RDBMS database design for e-commerce websites. Thanks in advance.
Doragonsureiyā
I need RDBMS database design for e-commerce websites. Thanks in advance.
We're not here to do your job for you. This group is to help you on specific issues you have in YOUR code, so you have to show the code you wrote by yourself and explain where and why you are stuck... as simple as that. 🤷🏻‍♂️
yusof
Hey guys My django web some times stuck on a request any suggestions how to monitor the requests?
William
Hey guys My django web some times stuck on a request any suggestions how to monitor the requests?
Do you mean that API takes a long time and does not give any responses?
William
Actually its not api Its django templates
The issue occurs randomly or frequently? Or for a specific request?
yusof
The issue occurs randomly or frequently? Or for a specific request?
Randomly Website works very well but suddenly it's stuck on loading in any page Its like it stucks on a request with heavy transaction but i don't know where
Олександр
Hello, please tell me how to make a field with a choice of id models in the form. I tried like this but I get an error https://pastebin.com/PTHWmK7V
Raad
Hello everyone, Can you help me to fix long drop down menu? The menu shows all the list which is around 4000 items. It’s a searchable drop down using select2. I didn’t specify anything about it in the form.py
Vaibhav
How to optimise inlines in django, i have a 3 level inline in django and to fetch every object, it hits an query with results in M+N+O queries
NightE
I extended the User built in model to a customer model using one to one relation and I want to show every customer's info in the profile.html page how can I access the extended attributes
NightE
I extended the User built in model to a customer model using one to one relation and I want to show every customer's info in the profile.html page how can I access the extended attributes
here is the view def profile(request,username): user= User.objects.get(username=username) return render(request,'core/profile.html',{'user':user})
NightE
but I want to access other customer attributes
NightE
class Customer(models.Model): user = models.OneToOneField(User, null=False, on_delete=models.CASCADE, blank=False) phone = models.CharField(max_length= 12) city = models.CharField(max_length=20)
NightE
phone and city
NightE
how to access them in the profile page
NightE
any help?
Tez
phone and city
Jinja templating. {% for u in users %} // Displaying username {{ u.user.username }} // Displaying names {{ u.user.first_name }} {{ u.user.last_name }} // Displaying phone {{ u.phone }} // Displaying city {{u.city}} {% endfor %}
Tez
But this is going to be repeated I need this code for profile only for a specific user
This is something you need to do from the views. // The query for the logged in user. user = User.objects.filter(username = request.user) // The query for a selected user user = User.objects.filter(user__id = request.user.id)
Mukul
{ "status" : "ok", "totalResults" : 444, "articles" : [ { "source" : { "id" :"the-times-of-india" "name" : "TOI" }, "author" : null, "title" : "gun", "urlToImage" : "https://bdjd" } How to display title and urlToImage in django with this api please help
VIGNA
Hi everyone In django I wanna execute certain tasks in future at a datetime given by user. How can i do this, Please.
MIRZO
Hello, how can I use this for my models or forms <label for="exampleDataList" class="form-label">Datalist example</label> <input class="form-control" list="datalistOptions" id="exampleDataList" placeholder="Type to search..."> <datalist id="datalistOptions"> <option value="San Francisco"> <option value="New York"> <option value="Seattle"> <option value="Los Angeles"> <option value="Chicago"> </datalist>
MIRZO
I have changed option value to {{ form.value }}. But form is not valid. Please if you know tell me the way
M
Hi ..has anybody worked with drf-yasg b4?, how do u add manual parameters in a serializers? Im using a modelviewset with some sub-serializer for each method
No
Is there any tutorials for hosting django application in aws
Omkar
Omkar
Django deploy with nginx gunicorn
No
Yes but for database
No
I need to use rds..
Dark T
Yes but for database
Aws needs some yml files like the create stack file, so to avoid running into issues might need someone that can help you write those files perfectly
Dani
You've got a dict inside a list inside a dict
Mukul
Dark T
I did a = data['articles'] And then return it {"Data" : a}
Make sure you raise an exception to avoid crashing . Just incase being too careful is never bad.
Conditional elector of HRE
When is the max_length attribute displayed on a form? There is code: error_messages = { 'name': { 'unique': _("This concept already exists."), 'max_length': _("This writer's name is too long."), }, } When the name field overflows, nothing is displayed in errors, but the string is simply cut off.
Conditional elector of HRE
Here is the full code: https://pastebin.com/ATLKeXWj
Tez
{ "status" : "ok", "totalResults" : 444, "articles" : [ { "source" : { "id" :"the-times-of-india" "name" : "TOI" }, "author" : null, "title" : "gun", "urlToImage" : "https://bdjd" } How to display title and urlToImage in django with this api please help
First import json in your view. details = json.loads({ "status" : "ok", "totalResults" : 444, "articles" : [ { "source" : { "id" :"the-times-of-india" "name" : "TOI" }, "author" : null, "title" : "gun", "urlToImage" : "https://bdjd" } .... for detail in details['details']: print detail['articles']['urlToImage']
ChanduAI9
How to backup Django application files with Google Drive API?
Shailesh
From. import views error
Shailesh
Can you give any suggestion regarding From. import views error in django.??
Mirco
Can you give any suggestion regarding From. import views error in django.??
if you don't share code and errors, no suggestions will be helpful
P.
Hello everyone. I'm facing some issues understanding how https://django-allauth-2fa.readthedocs.io works. I would like to implement 2fa into my website and force every user to use it. I've already django all-auth working on the website, and now I've installed django allauth-2fa into the project. Should I trigger the 2fa request on login? Should I send the user to the 2fa configuration after the registration procedure ? Thanks any help is welcome since I have no experience with 2FA and it's the first time I'm implementing it.