.
Please help !!!
.
For ex- I have included three pizza having some features and it's cost and the no of each pizza now I want to take add total cost and save in db ,how to achieve this
.
Do the input be like nested JSON
F R
Hi, if we want to define swagger documentation (drf-yasg) for generic view in order to see parameter and response serializer in swagger link, what should we add to our view?
Alex
Hi, if we want to define swagger documentation (drf-yasg) for generic view in order to see parameter and response serializer in swagger link, what should we add to our view?
You could follow their quickstart guide https://drf-yasg.readthedocs.io/en/stable/readme.html#quickstart The idea is that yasg will inspect your drf views to generate an open api scheme. Here should be noted that yasg is nearly stopped to maintain. The authors recommend to use drf-spectacular instead.
Hikmet
Hi all. I have such a problem. There are two views detail and export. And I have 2 forms in one template that handles them. In the second form, I marked the url specified in the actions {% url 'export' %} in such a way, but it seems that it sends the post request to the previous view named detail. How can I fix it?
Hikmet
https://dpaste.com/4FRLGSDKH here is the code
ꪉꫝꪖꪹᦋꪖꪜ
Can i add forgot password in default django administration panel, and is it possible to change view ?
Sanjarbek
#help https://dpaste.org/Ud1a
Alex
#help https://dpaste.org/Ud1a
Do not #help. The warning you're getting is self explaining - define your encoding.
Azizbek Xushnazarov
#help https://dpaste.org/Ud1a
its is a server error which means that a compilation error occurred in your code. turn Debug to True in settings.py to see what happened in the code.
Y
Hello Please i want to know how integrate Api in django App?
Alex
Hello Please i want to know how integrate Api in django App?
do you want to integrate someone's api? Or create your?
Äli
Hello Please i want to know how integrate Api in django App?
https://djangorestframework.com/ you will find everything you need here
Y
Yes I want to integrate someone's api
Äli
hello everyone i need somehelp
dคv¡d
How to pass infinite parameters in url_patterns path in django
you mean <int:id>/<int:number>?
Alex
Yes I want to integrate someone's api
You should start from learning the API. Then you should search if there is a python client for that api. If no, you can write your own, otherwise you will end up with tons of code like: token = requests('api-get-token`) headers = <set-headers-with-token> response = requests.get('api/someendpoint', headers=headers) response.raise_for_status() data = response.json()['data']
Alex
https://djangorestframework.com/ you will find everything you need here
1 What the hell this link is? The official drf doc is at https://www.django-rest-framework.org/ 2 How drf is related here?
Äli
I have task to get POST data from request, so that request have many fields I need to store them in different DB_model, I solved it with hard code Serializer create() method by importing Model and create it manually Model.objects.create(bla=validated_data["field"], ...etc ) AnotherModel.objects.create(......etc) it's worked by the create() should return one objects so I can't return : Model AnotherModel and if return one of them I got error in Response: "There a missing fields. thanks
Rahimi | رحیمی
Hello every body! I'm coding a project which should has more than one admin, I have to gave them only a super admin access but make it possible for this super admin to change any user's role to an admin, and define the access level. How can I implement this feature? 🤔 I appreciate any help 🌻
Hunde
https://stackoverflow.com/questions/45895010/display-tomorrows-date-in-django-template/50930093
Alex
I didn't understood register new template
they probably meant custom template tag/filter https://docs.djangoproject.com/en/3.2/howto/custom-template-tags/
Anonymous
I want to learn Django via project based learning with cohort. I have completed Corey-Schafer video, and now looking for 2-3 people. If interested, please dm me
Mani
Hello I am usıng celery and django_celery_beat My task can be created in celery when I create them manually. but when i create them with django_celery_beat, they are not passed to my redis. What should I do?
Mani
Have you set up beat itself?
I didn't do any set-up, according to celery document I used pip install and then added it to my installed apps, do I need to do more? I have added my celery itself, and it's working when I do task.delay()
Alex
I didn't do any set-up, according to celery document I used pip install and then added it to my installed apps, do I need to do more? I have added my celery itself, and it's working when I do task.delay()
celery is a workers manager. Kinda like systemd in unix. To run tasks periodically you have to set up beat which will periodically send predefined tasks to celery. https://docs.celeryproject.org/en/stable/userguide/periodic-tasks.html#starting-the-scheduler https://github.com/celery/django-celery-beat#example-running-periodic-tasks > Both the worker and beat services need to be running at the same time.
Alex
yes they were running at the same time, after few time I restarted, it's now working. no idea why it wasn't before.
then I advice you to set up logging in your project. At least to log in files https://docs.djangoproject.com/en/3.2/topics/logging/ https://docs.djangoproject.com/en/3.2/topics/logging/#configuring-logging
Anonymous
please explain need of def str(self): return self.title what exactly it does?
Alex
please explain need of def str(self): return self.title what exactly it does?
https://www.educative.io/edpresso/what-is-the-str-method-in-python
Pixel
please explain need of def str(self): return self.title what exactly it does?
this is actually a method, it returns title field of a class
Cleiton
Hello I have a view with a form and formset. Is it possible to validate form fields based on the number of formset forms entered? Example: if len(cleaned_data['formset'].forms) > 2: raise ValidationError(...)
F R
Hi, although i installed drf_yasg, openapi when i write this code it has red underline for drf_yasg and openapi from drf_yasg import openapi why this happens and how can i solve it?
Stefan
please explain need of def str(self): return self.title what exactly it does?
This is actually a string method. It is rendered when an item has been saved in your database. So if your return self.title, it will return the title that item. And it will also be displayed on your model ymif you didn't overwrite it with ModelAdmin class with list_display = [] in your admin.py file.
Alex
Hi, although i installed drf_yasg, openapi when i write this code it has red underline for drf_yasg and openapi from drf_yasg import openapi why this happens and how can i solve it?
It happens probably because your IDE cannot find that packaged in the defined path. The solution depends on your setup. How do you manage your project envirement? virtualenv, docker?
F R
It happens probably because your IDE cannot find that packaged in the defined path. The solution depends on your setup. How do you manage your project envirement? virtualenv, docker?
virtualenv. the installed package is in venv lib. when i code pip freeze it is in installed package list. but in pycharm setting interpreter it is not in the list of packages. i dont know if the last one is related to this issue.
Alex
virtualenv. the installed package is in venv lib. when i code pip freeze it is in installed package list. but in pycharm setting interpreter it is not in the list of packages. i dont know if the last one is related to this issue.
Are you sure that you're installing packages in the same environment you specified in pycharm? File > Settings > Project > python interpreter
∫ 𝔞𝔪𝔞𝔫
Hello Is there any way to refer to static files in css files?
4candels support
Are you sure that you're installing packages in the same environment you specified in pycharm? File > Settings > Project > python interpreter
hi alex can u help me in my issuse, I have a form with several information, including email for the customer, when registering the information, including the email, I want the user to receive an automatic welcome message on his email
Gideon
hi alex can u help me in my issuse, I have a form with several information, including email for the customer, when registering the information, including the email, I want the user to receive an automatic welcome message on his email
https://docs.sendgrid.com/for-developers/sending-email/django but, you have to configure SMTP, here is the instruction. register on this service, get your api key and us
Gideon
there is still a library, but you can do without it https://github.com/sklarsa/django-sendgrid-v5
Anonymous
I want to use two databases for my Django project. Is it possible to use multiple databases?
Talha
I have a problem with image name ? the file name is Pencil_jeans (1).jpg but when i upload this file by using RestApi it changs the name with " Pencil_jeans_1.jpg " Here this is the code of save serializer.save() how to resolve this issue?
Jitendra Kumar
Registration number already exists before submitting I want showing like message , that's instance help-block error . Please help me
Anonymous
Node js or Django?
Jitendra Kumar
Django
𝓡𝓪𝓶𝔃𝓲𝓭𝓭𝓲𝓷
Hi guys. I came across the problem with models. Problem is that I can not load my photos when i click to the main photo. It should show me the all photos which are related to the main photo by FK but it is not working. Please help me with this problem if you can.
Doragonsureiyā
Hi guys. I came across the problem with models. Problem is that I can not load my photos when i click to the main photo. It should show me the all photos which are related to the main photo by FK but it is not working. Please help me with this problem if you can.
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://del.dog - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
#1375
Hello guys i need help every time I initiat the payment in by development server in django I got this error....you are accessing the development server over HTTPS, but it's only suppor HTTP
TheTanweer
I want to use two databases for my Django project. Is it possible to use multiple databases?
Multiple databases? But which scenario would Multiple databases need in?
Anonymous
Multiple databases? But which scenario would Multiple databases need in?
Actually I am developing a platform for CyberSecurity competitions. So, I need one database for user data and the other one is meant to make SQL Injection challenges
F R
hi, although i installed django and it is in my venv folder in Lib site packages when i migrate it says ModuleNotFoundError: No module named ' django'. for pip install dajango : Requirement already satisfied. should i delete my venv and reinstall all packages again? thanks
Ashish
How use rest api in browser in django
ILYOSBEK
and check python path
Mirco
How use rest api in browser in django
build a frontend that calls those APIs
ILYOSBEK
youtube dennis ivy reactjs
Ashish
Sorry authentication system in rest api...to add api key in browser and get data like Google api
Ashish
Not postman or terminal
Anonymous
what are some best site that translate python code into plain english?
Anonymous
wtf this means super().form_valid(form), especially super() ?
Alex
wtf this means super().form_valid(form), especially super() ?
super is a function to access super class of the current class.
Anonymous
yes😅