Д
then a plain Serializer, not a ModelSerializer
Bazaroph
ok thank you
Bazaroph
but how to receive data with a post by frontend
Д
but how to receive data with a post by frontend
https://www.django-rest-framework.org/tutorial/3-class-based-views/
LIBIN
Django and react all in one and hosted to aws ec2 using nginx. I accessed all the apis no issue but the home page for react is blank any idea
Shahin
Hi Can I ask a question? I want to use pagination in my blog in this way: I want to open a post in blog page and it goes to 127.0.0.1:8000/blog/number of post I want to check that if has next post and if has previous post show me
ГуНиСе️
cj
There is TypeScript. One can use Brython, it's even closer to the topic.
at the end of the day, all of them end up being JavaScript ¯\_(ツ)_/¯
ГуНиСе️
ГуНиСе️
but the important thing is what a programmer types and sees in editor
Tchondo
Hi guys for my own training I want to make a whatsapp bot with flask or Django and I have just discovered twilio. I wonder if someone doesn't know something else ? Thk
Tchondo
Can you repeat the question?
I want to make whatsapp bot
Charly
I want to make whatsapp bot
thats not a question
Tchondo
thats not a question
I learn that i can easly make it with twilio
Tchondo
still not a question
I want to know if some know something else because twilio is not easy to custom
Charly
I want to know if some know something else because twilio is not easy to custom
There is no other way that is supported by telegram, unless you have a bussines account
Tchondo
Not for telegram it is whatasapp bot
Charly
Not for telegram it is whatasapp bot
yeah, my mistake, still whatsapp is not bot firendly
Tchondo
Not for telegram it is whatasapp bot
But thank for your answer i undertand i will try
Doragonsureiyā
This is not a Python specific question, please delete your offtopic message, move to @PythonOfftopic and ask there.
Mister
hello guys are good open source projects on django?
Suraj
Urgent help needed_ Site can't be reached error after running wsgi.py file. Please suggest
Suraj
I have allowed all hosts and I'm using waitress
Mister
Charly
Mister
I meant your page
Charly
I meant your page
read again my message I never offered you my page
Charly
I was pointing that there are tons of projects on github
Mister
I was looking for well-written projects to learn
Charly
this makes it hard to navigate
https://github.com/topics/django
Mister
Thanks
Shreyas
Guys I need your Help.... Which YouTube channel or Course I should I refer to learn django from a beginner to pro.
Doragonsureiyā
Guys I need your Help.... Which YouTube channel or Course I should I refer to learn django from a beginner to pro.
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Shreyas
Thank you!
Vikas
And drf how to creat a drf api and master it please
Vikas
How to build api
Charly
How to build api
Check drf documentation
Phansivang
Hello guys please help me When i delete the post in my model but the primary key or the URL of ordering my post still there . I mean when I post something and the link will be example / post/12 but when i delete that post and start new post the link still keep going like post/13 . so my main questions is how can do i restart that PK or that list of post after deleted?
Rohan
Why would you care about pk always being sequential
Rohan
Imagine you had 1 million posts. You delete, say number 12
Rohan
Do you want all posts after 12 to shift (n-1)
Phansivang
You don’t.
thanks you so much i'm clear now
RedPilledRebels
@aaxxios models.py from django.contrib.auth.models import User class Customer(models.Model): user = models.OneToOneField(User, null=True, Blank=True, on_delete=models.CASCADE, related_name="customer", related_query_name="customer") class Order(models.Model): customer = models.ForeignKey(Customer, on_delete=models.SET_NULL, null=True, blank=True) views.py customer = request.user.customer <--- This is supposedly the error order, created = Order.objects.get_or_create(customer=customer, complete=False) Everytime I referance request.user.customer I get an error which says: Related Object Does Not Exist User has no customer How do I create a link between user and customer?
ГуНиСе️
you can even recalculate ids with ALTER SEQUENCE post_id_seq RESTART; UPDATE post SET id = DEFAULT;
Anonymous
So what then do you refer to as customer?
RedPilledRebels
So what then do you refer to as customer?
class Order(models.Model): customer = models.ForeignKey(Customer, on_delete=models.SET_NULL, null=True, blank=True)
Vansh
Any Indians Here 🇮🇳..?
Anonymous
class Order(models.Model): customer = models.ForeignKey(Customer, on_delete=models.SET_NULL, null=True, blank=True)
customer is a FK in Order model not User model. But if your Customer model has a FK to User then you have to use the lookup rules to find the data you need
RedPilledRebels
@aaxxios you're so helpful, excuse my noobness 😂 so what you're saying is that my OneToOneField has to change into ForeignKey in order for me too referance user.customer?
RedPilledRebels
Or should I create an Abstract User? And include customer inside of it?
Anonymous
Or should I create an Abstract User? And include customer inside of it?
No! What you really need is to learn how relationships work.
RedPilledRebels
No! What you really need is to learn how relationships work.
Noob Alert right 😂 how do I link User to customer @aaxxios?
RedPilledRebels
I understand that Customer model needs a ForeignKey, does this mean that OneToOne should be replaced?
Anonymous
Noob Alert right 😂 how do I link User to customer @aaxxios?
I can't say that definitely. It depends on how you want your relationship to work. Learn about One to one , Many to many, and one to many relationships
RedPilledRebels
(user=request.user)
Thanks Ivan I'll try that
Menu Rekt
Hi guys is there a french group?
Vansh
Earnn
RedPilledRebels
I can't say that definitely. It depends on how you want your relationship to work. Learn about One to one , Many to many, and one to many relationships
@aaxxios I'd want the relationship to be a OneToOneField because I want user inside Customer Model to relate to the corresponding field inside User from django.auth.models
Rajat
Please anyone can help me to deploy django project with mySql
RedPilledRebels
Do you also know that means one user can only have one customer?
@aaxxios that's precisely what should happen, one user should be one customer
RedPilledRebels
It's my fault for not being more precise @aaxxios this is an e-commerce store
RedPilledRebels
OK good luck!
I appreciate your help @aaxxios thank you
Anonymous
Best machin lerrning Tutorial please
Doragonsureiyā
Best machin lerrning Tutorial please
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Rajat
Best machin lerrning Tutorial please
Campusx Channel on YouTube (in hindi)
Sleeping
i am getting this problem