Alex
Okay
I said "by a paste service". My private messages is not a paste service
Alex
xdd
ꪉꫝꪖꪹᦋꪖꪜ
But i am unable to send long text here
Doragonsureiyā
But i am unable to send long text here
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.
Learner
django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal202", "gdal", "GDAL", "gdal3.1.0", "gdal3.0.0", "gdal2.4.0", "gdal2.3.0", "gdal2.2.0", "gdal2.1.0", "gdal2.0.0"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
Maxim
https://stackoverflow.com/questions/65441076/django-python-unable-to-find-gdal-library
try setting GDAL_LIBRARY_PATH in your settings have you tried it?
jetigenov
hello everyone, there is a question, did anyone implement this: if you select a category in the admin panel of the model, then display all its subcategories?
Anonymous
why we define request in view function in django for httpresponse while http response get no argument?
jetigenov
thank you
Anonymous
from django.http import HttpResponse def index(request): return HttpResponse("Hello, world. You're at the polls index.")
Alex
why we define request in view function in django for httpresponse while http response get no argument?
Because, your views are basically callbacks for incoming tcp connects. And in callback programming you have to predefine your callback signature.
Alex
When callback is happening. In function call in view?
I actually don't know that part of the architecture. You can inspect the source code of the built in socketserver module to understand the basic process of how a tcp server works. Here is an article about it https://realpython.com/python-sockets/#echo-server Basically it works that way: you're defining so called server socket and hanging it to listen for incoming tcp connections. When you get one, you will get a client socket, from which you can read incoming data. So basically an http request object represents data regarding that exact connection/request
Alex
But I'm actually not sure if you asked for that thing :)
Alex
Thanks a lot. But i don't understand if request object used in function call and send behind the scene or in other way?
a request is basically passed by a server. Or some of its abstraction layers. So yes, you can consider it as "behind the scene", as far as I understand your question.
Eugene
Hey,guys. I have some trouble. I wanted to push my project files to github repo in order to push my project on heroku,but there are more than 100 files,so i can't do it. What should i do ?
Anonymous
a request is basically passed by a server. Or some of its abstraction layers. So yes, you can consider it as "behind the scene", as far as I understand your question.
My aim was when we define a function with parameters we must using those parameters. And this sample we didn't use parameters in HttpResponse.
Meera
Hello I have created a django application Which basically does CRUD operations using its own admin portal
Anonymous
My aim was when we define a function with parameters we must using those parameters. And this sample we didn't use parameters in HttpResponse.
Ok.i guess it's With socket programming and when we call view.index the request parameter used behind calling. It's just a guess
Meera
Now I wanted to make a relationship between users (used in standard auth login) to my custom table Say model center So every user belongs to some center
Meera
How can I make these provisions for the django provided auth user table
Meera
Its basically a NGO app Which offers food to Poors And doner donates and receive receipts in change So this application will help admins to create receipts But every login user belongs to a specific center
Alex
My aim was when we define a function with parameters we must using those parameters. And this sample we didn't use parameters in HttpResponse.
Not necessarily. As I already said, views are basically callbacks. It's up to you to use the passed args or not.
Alex
Now I wanted to make a relationship between users (used in standard auth login) to my custom table Say model center So every user belongs to some center
Here is the doc https://docs.djangoproject.com/en/3.2/topics/auth/customizing/#extending-the-existing-user-model Basically you can go either composition approach by creating some extending Model like: class Recipient user = OneToOne(User) or create a fully custom model by inheriting some basic user model, as described in the doc
Alex
If i don't send any argument to view.index i will give an error
show the code. Paste it to a pasting service.
Anonymous
from django.http import HttpResponse def index(): return HttpResponse("Hello, world. You're at the polls index.") It will give me an error.
Anonymous
because a request is passed by the server, but you're not receiving it.
Is it true? 1-Client send request to Server and the content of request is compact in request object by server 2-django call view.index with that request object 3-the response will be ready with HttpResponse("hello") base on request object behind the scene
Сергей
Hello I have node js server with sockeio server, I wanna emit to this server form my django app, what can I do in my opinion I need some process with conected socket io client to my nodejs server, and call this proccess from django but I dont konw how it implement
Alex
do you mean it's not called periodically?
Alex
have you launched beat itself?
web
Hello .. I have a question about a school project. For database layout and table relationships; How do we choose the current school year for all schedules (teachers, students, attendance schedule, marks, etc.) So that I have the current year's output and an archive for all the ended years? Do I put in each class the date of the beginning of the school year and the date of the end of the school year? And do a filter? Do I make a class abstract for the date and make it inherit from all the tables? Does the use of class inheritance confuse me and complicate work in the future? Is there a video or lesson explaining a similar project? I need help
Anonymous
My url is returning a 405 for POST method how do i resolve that please?
Doragonsureiyā
My url is returning a 405 for POST method how do i resolve that please?
Read this please: http://catb.org/~esr/faqs/smart-questions.html#intro
Maxim
My url is returning a 405 for POST method how do i resolve that please?
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405
Karma
Any django experts here ready to help me
Karma
I got some issues
Karma
Please your help needed 🙏
Aubdur Rob
for qr_code : {%qr_from_text "http://localhost:8000/product/{{search.id}}" size=5 border=6 %}
Aubdur Rob
but search.id not work
Aubdur Rob
qr code link is : http://localhost:8000/product/%7B%7Bsearch.id%7D%7D
Aubdur Rob
how can i get real search id in qr code link plz anyone hlp me
Gideon
how can i get real search id in qr code link plz anyone hlp me
maybe help for qr_code: {% qr_from_text url 'your_app: your_url_name' search_id = search.id size = 5 border = 6%}
Maset
I'm looking for making the files(images & videos) to links other than something like This: http://127.0.0.1:8000/media/images/image.jpg To this: http://127.0.0.1:8000/users/<image_id>
Maset
Need help
‎𝙼𝚞𝚑𝚊𝚖𝚖𝚎𝚍 𝙽𝚒𝚑𝚊𝚍
Hello all, class Payment(models.Model): MODE = ( ('cash', 'CASH'), ('bank', 'BANK') ) user = models.ForeignKey(User) payment_mode = models.CharField(max_length=10, choices=MODE, default='cash') amount = models.IntegerField From the above model, I need to get the sum of all objects by choices. ie, sum of amount paid by cash and by bank seperately I tried this: received = Payment.objects.aggregate(Sum('amount') this gets me the total amount. I need the sum of amount paid by cash and by bank seperately.
Aman Jain
Best cloud hosting for django suggest
Doragonsureiyā
Best cloud hosting for django suggest
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.
Брат
Hey guys why my data doesn't show it is datum in order?
Брат
https://ibb.co/FXBG9kG
Maset
You need to store the images in some models then only you can retrieve that image using ID
Yes I'm storing it with models and my html now looks like this: <img src="http://127.0.0.1:8000/media/images/image.jpg"> But I want it to be: <img src="http://127.0.0.1:8000/users/<image_id>"> 🙈
Maxim
Hey guys why my data doesn't show it is datum in order?
the serializer knows nothing about your wishes
Maxim
can you help me with that
http://xyproblem.info/
Брат
appreciate that
Maxim
i prefer not to deal with the XY problem
Maset
Is it possible to lock my file (image & videos) only with my website? Like no one with the source link other than my website can access it?
Doragonsureiyā
Maybe anyone is here, yes, but they are not obliged to read everyone's message here neither to reply to everyone's message, if someone wants to reply to your message, they will do that, just don't try to draw attention to your message writing "anyone?" every 5 minutes, that will lead you to be warned for SPAM/Flood, just be patient or use Google/DuckDuckGo to research about your question instead of wasting time here waiting for people to do your work. Have a nice day 😊
Брат
i prefer not to deal with the XY problem
Sry, I've just read everything about that... You meant that I didn't ask properly?
Maxim
Sry, I've just read everything about that... You meant that I didn't ask properly?
i mean, I don't understand why JSON order is important to you, and I'm sure you're solving the wrong problem
Брат
For me surely not
Брат
Im not gonna look after some information look up and down every time, so I could deal with my data