Mirco
How to do it right?
Nope You need to get the model instance and then access that attribute and save the instance
kuzmich
Middleware is the easiest way to put yourself between request and response so you can have everytime a log of request data , headers etc etc
I see, just to make you understand what i'm telling ya is that my response is about one-time option
kuzmich
u've printed it, saw what's there and moved on
Mirco
I see, just to make you understand what i'm telling ya is that my response is about one-time option
Yup got it but it's better not to give that advice Lot of developers use print in production...
Daniil
Thx u very much!
jay
Does subprocess.run() work in an Django app Like if i have a lib installed in local machine will the same work in django if i use subprocess command?
Mirco
Doragonsureiyā
yup! thx
You're welcome! 😊
Sopan
Used django-request-logging
Mirco
Used django-request-logging
it does what I've explained u under the hood 😊
Doragonsureiyā
🚫 ‎Henry [1077999617] is already banned.
Mirco
yup!
you could do it without a 3rd party app
Sopan
yes... but still it's an effort... write midleware ..helloMidleware and print header & body
Mirco
without an external dependency that can be outdated or not maintained anymore
Sopan
I agree with you
Sopan
👍
Kamal
guys, hello everyone, https: //dpaste.org/8vtZ please help me figure out what the problem is, I write tests to validate the form, the tests do not pass, using the errors method I display an error <ul class = "errorlist"> <li> password < ul class = "errorlist"> <li> This field is required. </li> </ul> </li> </ul> z5z5z5z5z5z5z5 , I also tried to feed the form just username and password, it displays that the data is incorrect
jay
It does
Thank you
Mayur
How can we make nested documents using django in mongoDB
Anonymous
Hi, any Idea how to validate password with validate_password(password, user) with user object . so they wont be similar on register ? because I dont want to make the user object if password was similar and to check that I need user object.
N
Can I call a view function when I click on button on HTML page
N
Or form or anchor tag
N
But I want pass some string to view is it possible I am new to django
N
Pls suggests
Mayur
In this type
Mayur
All the data connected directlly by name no need to Foreign key or id
Mayur
How can we make this type of data in django
Anonymous
Can I change project structure as I want, for example folders, file names and all?
noneofurfuckinbusiness
But I want pass some string to view is it possible I am new to django
Kindly read an article about django, and complete a project completely before starting ur own. I'd suggest "django girls" article for beginners.
William
bookms.Authors: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the BookmsConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. What's this problem is. How can I fix it
William
class Authors(models.Model): SEX_CHOICE = ( (0, '男'), (1, '女'), ) name = models.CharField("姓名", max_length=128) sex = models.IntegerField(choices=SEX_CHOICE) birthday = models.DateField("生日", null=True) date_death = models.DateField(null=True) nation = models.CharField(max_length=128) def __str__(self): return self.name This is Authors in models.py
William
Yes
Anonymous
Yes
But did you create it django 3.1.7?
William
Actually I don't. I am just download this project from the internet. And I try to run it
Mirco
Actually I don't. I am just download this project from the internet. And I try to run it
https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys
William
Ok, thanks
William
I do envy your good English. I am Chinese, I hate English. But I have to study English😭
Zey
how we can render only first 10 items by date
Dem
Hey dudes. Does it exist an app to design a django framework out coding !?
Dem
*web site.
Mohammad
Hello friends I have an advanced filter to display my products Product filter sections vary based on the Json field values of the product How can I write a form whose field varies according to the characteristics of a product? Do I have to use special tools?
Prateek
how we can render only first 10 items by date
First sort that in view . Py and take only 10 items
Zey
First sort that in view . Py and take only 10 items
That's what I am asking how to take only 10 items
Prateek
That's what I am asking how to take only 10 items
Lest suppose Intem= item . object . all () [ : 10]
Prateek
Lest suppose Intem= item . object . all () [ : 10]
And for sorting by data just google the syntax its simple
Zey
Use order_by
I used that but I want only 10
Hitesh
After order_by use [:10]
Anonymous
Hi Everyone. I hope you guys are doing good. I'm Karim Gilani from Pakistan, a Full-Time Freelancer specialist in Full Stack Python Development and coding tutor. I'm here to help new students and startups to grow. You can message me privately with any of your question or query. One more thing, if anyone of you is looking for a personal paid 1-1 coding mentor for web development or python programming can also ping me to get further details and my previous client reviews. Thanks, Karim.
Manik
how get_queryset() and list() gets executed in one viewset
M
how we can render only first 10 items by date
U can use order_by ex:order_by('-date')[:10] django use python slicing so if u order using -date u will take last 10 items if u use just date with take first 10 items
Himanshu
What are the best resources to learn django
Doragonsureiyā
What are the best resources to learn django
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
M
What are the best resources to learn django
I am a doc guy, I love check the documentation and code on githab
Anonymous
I use for this pexpect, but IT SUCKS
Anonymous
Should we use different serializers for login and creating user in django rest