Anonymous
Hi Team :) This is Suresh; can you guys help me to understand the request lifecycle of Django httprequests? also, when it comes to REST how it is working? I was breaking my head why I need to write ModelViewSet, routers, models, serializers and so on. It will be very helpful if someone guide me on this. Thanks in advance :)
Mirco
Anonymous
Okay which means?
Anonymous
how my request shipping on with Django framwwork
inchidi
Anonymous
okay you saying me to map directy function with urls in urls.py
Anonymous
then asking me to move forward?
inchidi
then asking me to move forward?
if you are confused, just try start the tutorial from drf official docs https://www.django-rest-framework.org/tutorial/1-serialization/
inchidi
note that basic django knowledge is a must, so if you still confused following drf tutorial, probably you need to re-take django tutorial
Anonymous
inchidi
Anonymous
okay thank you @Inchidi :) for quick answers and references. I'll go through this
Modou-dev
I need a help here https://pastebin.com/zCNecPKr
cj
Modou-dev
so want to send a command with my api and I use soap api to send it
Modou-dev
I have an error with my xml
Modou-dev
about the validation https://pastebin.com/zCNecPKr
Mirco
Rammanoj
I got a weird error. I hosted my django code on aws (with nginx). I updated some part of the code but response I get from the code is not getting updated, whatever the change I do.
Rammanoj
Rammanoj
?
Rammanoj
Anonymous
I want to change something from a package (taggit in this case) should I copy all files and make an app with source code or there's other ways
Disekurity
hello, please how to set Blog's fields in models.py so that I can upload multiple images in admin panel ???
Mirco
Disekurity
Sebuhi
hello there I need help in Queue database, i am working on project on device, let me clarify a bit.:
let say costumer has paid the some amount to make actions to device, but device has another operation currently running, the costumer payment has to move Queue database wait untill the device send the request I am done with last one, if there is another order send it so as it is free currently. if it is free we should forward the another queue in tha database and when it comes back we update it. How am I suppose to do this is there anyone has good expeirnce? I should be using Rabbitmk? or celery , I really dont have any exprience with those, thank you!!
Sebuhi
like Simple databased-backed job queue. I want to use a database table as a queue. I want to insert in it and take elements from it in the inserted order (FIFO).
Anonymous
I have these models but when I want to add a food,categories of other restaurant are also showing up as a option,How can i make to show of only particular restaurant? Thanks
class Restaurant(models.Model):
company_id = models.ForeignKey(Company, on_delete=models.CASCADE)
name = models.CharField(max_length=255)
address = models.CharField(max_length=511)
phone = models.CharField(max_length=100)
logo = models.ImageField(upload_to='restaurant_logo/', blank=False)
class Menu(models.Model):
restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE, primary_key=True,)
name = models.CharField(max_length=500)
description = models.CharField(max_length=500)
image = models.ImageField(upload_to='category_images/', blank=False)
# food_items = models.ManyToManyField(Food)
def __str__(self):
return self.name
class Food(models.Model):
restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE)
category = models.ForeignKey(Menu, on_delete=models.CASCADE,primary_key=True)
name = models.CharField(max_length=150)
# count = models.FloatField(default=0)
description = models.CharField(max_length=500)
image = models.ImageField(upload_to='meal_images/', blank=False)
price = models.IntegerField(default=0)
def __str__(self):
return self.name
Anonymous
😘
Sarath
anybody give me link for learning django from basics to advanced
Sarath
pdf is also okay
inchidi
syedj
Is there any way to debug django forms on ui
syedj
Im not able to display it in the ui
inchidi
I have these models but when I want to add a food,categories of other restaurant are also showing up as a option,How can i make to show of only particular restaurant? Thanks
class Restaurant(models.Model):
company_id = models.ForeignKey(Company, on_delete=models.CASCADE)
name = models.CharField(max_length=255)
address = models.CharField(max_length=511)
phone = models.CharField(max_length=100)
logo = models.ImageField(upload_to='restaurant_logo/', blank=False)
class Menu(models.Model):
restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE, primary_key=True,)
name = models.CharField(max_length=500)
description = models.CharField(max_length=500)
image = models.ImageField(upload_to='category_images/', blank=False)
# food_items = models.ManyToManyField(Food)
def __str__(self):
return self.name
class Food(models.Model):
restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE)
category = models.ForeignKey(Menu, on_delete=models.CASCADE,primary_key=True)
name = models.CharField(max_length=150)
# count = models.FloatField(default=0)
description = models.CharField(max_length=500)
image = models.ImageField(upload_to='meal_images/', blank=False)
price = models.IntegerField(default=0)
def __str__(self):
return self.name
maybe try moving your code to dpaste.de? trust me, it will increase the chances of your question being answered 👍
amit
Is celery a high end task ? To automate
syedj
Gaurav
Guys i am new to django but want to learn it earnestly. Please suggest me some study material. Thanks.
.
Mirco
Alexander
I have no permissions to create polls here so text message...
What is your Docker container OS?
I see 3 options here:
1. Debian and deb-based (Ubuntu? etc.)
2. Alpine
3. I do not use containers for Django-based apps (I do not use Docker & Kubernetes & Nomad etc.)
Alexander
my choice is 2 (because of smaller image sizes [sometimes 😊])
Александр
Hey guys, I learning django 2.1.7. Created model Authors with a field name that is blank=False, then going to ./manage.py shell and trying to Author.objects.create(name="") and suddenly this object was created. Documentstion says "If True, the field is allowed to be blank". What am I doing wrong?
Александр
i expected an exception
Alexander
try do same in admin and you will get error
Alexander
about name field can't be empty
Alexander
also you can upgrade to 2.2 now 😊
inchidi
inchidi
inchidi
Александр
inchidi
its just a suggestion
Mirco
Александр
Александр
nope, still same
Mirco
Александр
oh, sry
Mirco
And make migrations and run them
Alexander
null=False is about your database schema, blank=False is about how admin app works with empty fields
Mirco
Alexander
also you can use model field validatars to check for non empty values
Александр
Migrations for 'baseapp':
baseapp/migrations/0002_auto_20190402_0711.py
- Alter field name on author
- Alter field title on book
all migrations is OK, and i still getting authors with blank names. looks like I really need validators. thanks
Mirco
Александр
Александр
inchidi
but WHY?
https://docs.djangoproject.com/en/2.1/ref/models/fields/#blank
Note that this is different than null. null is purely database-related, whereas blank is validation-related. If a field has blank=True, form validation will allow entry of an empty value. If a field has blank=False, the field will be required.
you should show us your Form to fix this btw
Александр
yes, it's "handmade"
inchidi