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 :)
Anonymous
Okay which means?
Anonymous
how my request shipping on with Django framwwork
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
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
Modou-dev
how is that related with Django?
I use django rest frameworkk to send my comand
cj
I use django rest frameworkk to send my comand
nobody is magician to guess what you need, give context, show code and traceback 🤷🏻‍♂️
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
about the validation https://pastebin.com/zCNecPKr
Why are you mixing SOAP and REST ?
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
?
Mirco
is there any service to restart after updating the code directly on aws
There are deploy pipelines on bitbucket, gitlab etc. so you can set some commands on every master branch merge Read more online about that
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
hello, please how to set Blog's fields in models.py so that I can upload multiple images in admin panel ???
https://simpleisbetterthancomplex.com/tutorial/2016/11/22/django-multiple-file-upload-using-ajax.html
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
anybody give me link for learning django from basics to advanced
check pinned message https://t.me/pythonres/21
syedj
Is there any way to debug django forms on ui
syedj
Im not able to display it in the ui
inchidi
Is there any way to debug django forms on ui
not sure but maybe this is what you're looking for
amit
Is celery a high end task ? To automate
Gaurav
Guys i am new to django but want to learn it earnestly. Please suggest me some study material. Thanks.
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
about name field can't be empty
oh yeah sorry this is true
Александр
have you makemigrations it?
yes, but "No migrations to apply."
Александр
try do same in admin and you will get error
yes, in admin there is an error, it's ok. but i have a form, it passes empty fields
Александр
also you can upgrade to 2.2 now 😊
i use manjaro, there's no updates yet, so i don't need to
inchidi
i use manjaro, there's no updates yet, so i don't need to
its update from pypi not os package manager tho
Александр
its update from pypi not os package manager tho
nah, i don't care. is 2.1.7 so bad?
inchidi
its just a suggestion
Александр
nope, still same
Mirco
let me check it out
with null=False ?
Александр
oh, sry
Mirco
oh, sry
No worries 😁
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
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
still same, it creates blank authors
👍🏻👍🏻
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
Александр
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
<form action="{% url 'add' %}" method="POST"> {% csrf_token %} <label for="author">Author</label> <input type="text" name="author" id="author"><br> <label for="book">Book</label> <input type="text" name="book" id="book"><br> <input type="submit" class="button" value="Save"> </form>
Александр
yes, it's "handmade"
Александр
add required to the <input/>
ok, i know it will work, but i thought it will work in shell too, at orm level