Rohan Ekke
psycopg2.OperationalError: could not translate host name "db" to address: Temporary failure in name resolution Can someone help me
Ali
Hi everyone I'm working on project that... Step 1. I have an script that generates many simulation data and send to server. Step 2. The server get data and update ui realtime. I'm using django channels and drf. My question is In which step I should use api and and in which websocket? Step 1 or 2???
Muflone
solution?
Pass the correct server running postgres
Rohan Ekke
Where can i change DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'postgres', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': 'db', 'PORT': 5432, } }
Rohan Ekke
but what should i put insted 'db'
Muflone
but what should i put insted 'db'
Have you installed postgres?
Rohan Ekke
yes
Muflone
yes
Where is installed?
Rohan Ekke
i nstalled where the manage.py file is
Muflone
i nstalled where the manage.py file is
postgres? It's a database, not a python script
Muflone
I bet you haven't installed it really
Rohan Ekke
pip install psycopg2-binary right? i installed
Charly
that's the library for postgres, you need an actual postgres server
Muflone
pip install psycopg2-binary right? i installed
No, you installed only the parts which allow you to access from python to it, but you still lack postgres If you're starting then you might prefer to begin with sqlite
Deidara
Hey, what's the best way to encrypt a model field in django. I don't really have preferences, as long as its secure and not a hassle to implement. Searched on Google and found django-cryptography, overwriting the setter and getter functions with the field as a @property, and one other implementation using a custom model field class. Which do you think is best/ any other opinions?
DeathLikeSilence
hey everyone, How can I have a PDF output? I have a project for which I want to receive the received information as a text and a PDF file. Is it possible in Django?
Newton
This project is based on Django live search In this front end product can be search with parameter of product name. But I wanted to make it search based on name and product description. But not getting any clue Search input linked with which jQuery I tried to search solution in stack overflow But logic writen their for live search in jQuery is different than this project I tried to tack the related file of jQuery link with that code but there many local and third party app have Similar parameters used get confused which jQuery file associated with that 'name' based search parameters front end https://github.com/betofleitass/django_point_of_sale/blob/main/django_pos/templates/sales/sales_add.html Input search form : https://pastebin.com/hugLVVLZ Product Search ajax : https://pastebin.com/1LeSXUSa Third party jQuery files used for Live Search : https://pastebin.com/QdBEkDGi Django View Product attributes https://github.com/betofleitass/django_point_of_sale/blob/main/django_pos/products/views.py Third party jQuery file https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js Here 13-16 have used name as parameters I have to download code third party jQuery and test it manually? I tried my best I want to know which jQuery file used parameters as name and which lines In I tried search but too many similar parameters confused me i tried to change it to description to track but nothing change I changed name to description in parameters but nothing changed
Михайло
Yess using celery is a best option
But I need the user to wait for the file to be processed and then I redirect him to the result download page.
Danish
But I need the user to wait for the file to be processed and then I redirect him to the result download page.
Usually when you create a celery task it will you id for that particular task,... Using that id you can check if task is completed or not
Danish
So make a form and after submitting create a task and redirect user to a new page.. After redirecting make use of the task id to check if task is completed or not if completed then display the download option else keep the loader visible
Danish
This*
Михайло
So make a form and after submitting create a task and redirect user to a new page.. After redirecting make use of the task id to check if task is completed or not if completed then display the download option else keep the loader visible
Thank you! But as far as I understand, the advantage of celery is that it can perform tasks in parallel with the web application. As if the user did not have to wait for the completion of some task, but could continue using the site. But if I make it so that the user still waits for the completion of the task, then what benefits will I get from celery in this case? I just don't quite understand something.
Danish
Thank you! But as far as I understand, the advantage of celery is that it can perform tasks in parallel with the web application. As if the user did not have to wait for the completion of some task, but could continue using the site. But if I make it so that the user still waits for the completion of the task, then what benefits will I get from celery in this case? I just don't quite understand something.
See, benefit of this is, the web application usually has more traffic so if a single request take more than expected time than it might block other traffic... So what celery does is it runs the same request but in the background allowing multiple request to process all together
Danish
So making user wait or allowing him to do other stuff on web is totally depends how you want it to be
Михайло
Ah, I understood! Thank you very much!🙂
Danish
No worries😊
/\/\ @ # |) !
hi friends i have problem
/\/\ @ # |) !
' set' object is not reversible what is this error??
cj
' set' object is not reversible what is this error??
that maybe you don't have clear things about some data types in Python
Maxim
in views??
everywhere
محمد عبدالله يوسف
how bluid cart drf
Charly
how bluid cart drf
Please do a proper question explaining in a detailed way what you need help for
محمد عبدالله يوسف
Please do a proper question explaining in a detailed way what you need help for
ok.. I need sources to explain how to create a product basket in django rest framework and is it better to do it in session or in Database?
Newton
This project is based on Django live search In this front end product can be search with parameter of product name. But I wanted to make it search based on name and product description. But not getting any clue Search input linked with which jQuery I tried to search solution in stack overflow But logic writen their for live search in jQuery is different than this project I tried to tack the related file of jQuery link with that code but there many local and third party app have Similar parameters used get confused which jQuery file associated with that 'name' based search parameters front end https://github.com/betofleitass/django_point_of_sale/blob/main/django_pos/templates/sales/sales_add.html Input search form : https://pastebin.com/hugLVVLZ Product Search ajax : https://pastebin.com/1LeSXUSa Third party jQuery files used for Live Search : https://pastebin.com/QdBEkDGi Django View Product attributes https://github.com/betofleitass/django_point_of_sale/blob/main/django_pos/products/views.py Third party jQuery file https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js Here 13-16 have used name as parameters I have to download code third party jQuery and test it manually? I tried my best I want to know which jQuery file used parameters as name and which lines In I tried search but too many similar parameters confused me i tried to change it to description to track but nothing change I changed name to description in parameters but nothing changed
Any solution please guide
Bilal
I have used git clone to clone a repository from GitHub. Now i have made some changes to that same repository, I want to clone it again, but Python anywhere has saved the earlier cloned repository and not allowing me to clone the updated one. Is there a way to undo/delete the earlier clone and copy the updated repository?
lili
hi i have uploaded my django project on a host and befor that i have made debug mode off, now when my app saves a file(taken from user) in a folder, it cant show that file. but when i switch to debuge mode, it gets fixed what is the problem?
Gaston
but what should i put insted 'db'
You have declaraded on djang HOST 'db' wich is a dns name instead of IP, this is very basic problem and not very related to django. Change in database settings of django 'db' for '127.0.0.1' also you have to configure postgre hba to allow connection
Gaston
Psycopg2 is working fine, is Just telling you something like unable to find database host called db
Raj
WHAT IS THIS ERROR
Danny
WHAT IS THIS ERROR
Python isn't installed
Raj
NO
Raj
ALREADY INSTALLED SUCCESFULLY
Raj
ALL PERFECT
Doragonsureiyā
WHAT IS THIS ERROR
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://hastebin.com, https://nekobin.com, https://dpaste.org (or your favorite one)
clouded
ALREADY INSTALLED SUCCESFULLY
There's something wrong with your keyboard.
Raj
OK
clouded
OK
It's not okay if it looks like you're screaming at everyone.
clouded
Please fix it.
.
WHAT IS THIS ERROR
That register instance with the provided id does not exist in the database. Verify what value was assigned to variable ‘user2’, and verify that it exists in the database.
HBS
I have authenticated in django and am developing frontend in react js is compulsory to authentication or not
Peaceful
I i installed django , but i don't know what command to used to get url
Muflone
I have authenticated in django and am developing frontend in react js is compulsory to authentication or not
You shouldn't use authentication with user/password from frontend but prefer to use tokens, for example using DRF
Doragonsureiyā
I i installed django , but i don't know what command to used to get url
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Arslan
Heyy i need some guidance for django i have intermediate knowledge of django and still learning it by making projects
Arslan
DJango
Charly
DJango
Bot for what specifically? If you already habe some intermediate knowledge you just need to rpactice projects
Arslan
Like
Charly
Siva
Hello community, I am currently looking to learn how to create a new project with Django, focusing on multi-tenancy in the database. If anyone has insights or knowledge on this topic, I would greatly appreciate your guidance. Thank you!
Rakshit
Hello community I am create one project Resume bilder can you suggested to how project host in best webhost
Mohit
Hello anyone can help me how to implement translation in django