Mirco
Mirco
Nope. in consol
you don't use it for your view logic so it's useless
Anonymous
Mirco
it's like print(2) without a sense
Anonymous
I want to get mycid from template and use that in views and then forward it into next html page. For testing purpose I am printing that ID to consol. But it is not coming into views. I can not remove it.
That's the problem.
Aman
Hi all, I need a help in creating recruiting job listing app... In which A Recruiter creates and maintains job listings. A candidate can view all the job listings and apply for a job that he is interested in.
Aman
Mirco
shruti
It is showing no module names rest framework.authentication.?
shruti
Yes
Anonymous
Yes
Try adding rest_framework.authtoken after rest_framework and before djoser in INSTALLED_APPS as per djoser documentation
Anonymous
This is if you are using token based authentication
Luciano
Hello!!!
I'm using requests library to get a JSON response but I'm having a hard time trying to decode some strings like "MARAÃ\x83Â\x91ON" (MARAÑON, in spanish)
I already tried setting some encoding/decoding but I'm confused about which decoding to use and how could I implement it.
Thanks in advance!!!!
Alex
Luciano
Could your share the code? And what is the python interpreter version?
Sorry!
headers = {'User-Agent': 'custom-valid-UA'}
payload = {'format': 'json', 'data': data }
response = requests.get(url, params=payload, headers=headers, timeout=3)
I get a correct JSON response but some strings are encoded like that
Luciano
Python 3.7.4
Alex
Luciano
which should be decoded as "MARAÑON"
Alex
Alex
Luciano
well, if i try this:
request.encoding, I get nothing.
If i try request.apparent_encoding, I get utf-8
Luciano
Vxvek
Do any use vps hosting with Godady with cpanel file manager to host django website?? Anyone can Any one help me with this.?
Luciano
Luciano
Alex
Luciano
Alex
🤷🏻♂️😳
You did great any way.
Luciano
You did great any way.
Thanks! I guess this is one of those wtf moments where I don't know why it works but it does the job haha
Muhammed
Do i need to combine Django with React, Angular or Vue?
Maz
Mirco
edwin
hello good to all, I am making an e-commerce website in Django 3.1.1, but when I want to add an order in the admin I get the following error: str returned non-string (type NoneType). I already tried several methods but none works for me.
edwin
it tells me that the error is in this directory: AppData \ Local \ Programs \ Python \ Python38-32 \ Lib \ site-packages \ django \ forms \ models.py at line 1240
edwin
can someone help me I would appreciate it very much
Anonymous
Anonymous
do you have some __str__ method in models?
Alex
edwin
Anonymous
can you send a full traceback and code of str method
edwin
ok
edwin
class Order(models.Model):
customer = models.ForeignKey(Customer, on_delete=models.CASCADE)
date_orderd = models.DateTimeField(auto_now_add=True)
complete = models.BooleanField(default=False, null=True, blank=False)
transaction_id = models.CharField(max_length=200, null=True)
def str(self):
return str(self.transaction_id) + '-' + str(self.customer.name)
Anonymous
The problem may be that your str method returns a null field, I mean that transaction_id has null=True, and str returns some null field, just try to comment this method, and if error will go away, then you have some null field in models
Alex
@EdwinTzuc please, post that traceback on a paste service (pastebin or any other) and post here the link.
Alex
Anonymous
ok, so he have some models.ForeignKey, and may be that class returns null
edwin
edwin
Expert
Hello!
I need help
I added some parts in template html
base.html
Something like this
<span>{% trans 'Next Step' %}</span>
But the text is not translated to Portuguese when I switch locale to Portugal, others are translated.
How can I add that translation string and where?
Shyamkumar
Taku
Does anyone have experience with Google location APIs?
Андрей
Hello, how to get auth user in gjango?
Андрей
thx
Sarjat
Does anyone has a solution for this?
https://stackoverflow.com/questions/64560113/how-to-accept-all-the-answers-from-form
Anonymous
Hello
I need help.
I am working on a project. And I have setup on path in urls.py( it opens a home page and images are working fine) but when I clicked on a button on that html page, it calls a path in urls.py and take me to the other page. While coming to next page, my images are not coming. Issue is the path in urls.py came between the image path.
Please suggest what I can do ?
So that my images can come easily.
Anonymous
Help
https://pastebin.pl/view/ba494418
Anonymous
how to do if some one comment on my site it will also show to other user on my site without refersh ?
Anonymous
Anonymous
Taku
Does anyone have experience with Google location APIs?
Usmonov M
Hello
Usmonov M
who know how can I make index.html after finishing my django project
Root
Raj__Django
How to do same page navigation using id in django ?
Means in navbar if contact us is there if we tap on contact us then it should go to contact us section at end of page
#!/bin/sh Inَactive
Raj__Django
Sorry it is some css issue
Андрей
Rohan
I want to make a book store site where storemanager can upload books and customers can order and buy books.I want to authenticate who is storemanager and who is customer.I want to user django built in authentication system to authenticate these two users.Can any one suggest how to make this happen?
Doragonsureiyā
Rohan
Trying to understand Abstractuser, i just want to know whether some one faced the same issue.Thanks.