Harry gorilla
Uday
Harry gorilla
Harry gorilla
I would be happy if that selection was replaced with a text field. Users are supposed to feed any number they want. That selection way makes it limited
Alex
Harry gorilla
Ivan
does anyone know how to get a session variable from __init__ inside a forms.ModelForm class?
Alex
Ivan
get_form_kwargs
is it available also for ModelForm?
(Pdb) self.get_form_kwargs
*** AttributeError: 'ApiKeyForm' object has no attribute 'get_form_kwargs'
(Pdb) self.__base__
*** AttributeError: 'ApiKeyForm' object has no attribute '__base__'
(Pdb) self.__class__
<class 'app.forms.ApiKeyForm'>
(Pdb) self.__class__.__base__
<class 'django.forms.models.ModelForm'>
Ivan
for instance, I am using django 3.2.12
Alex
Harry gorilla
Alex
Ivan
Harry gorilla
initial=1
Is it possible to make currency look neat, eg, after three zeros, put a comma, example $10,000
AL
when I write this field in the model
order_item = models.OneToOneField('PrepOrderItems', on_delete=models.CASCADE)
does that mean that I'm fetching the PK of that table PrepOrderItems and putting it in this variable/column order_item? If yes, and that means that whenever I write the table/model name as the first parameter in the OneToOneField that will be retrieving the primary key of that second table always?
Kavi
Is it possible to deploy Django app in google cloud functions?
Morteza
Morteza
Kavi
We can deploy using compute engine,app engine,cloud run..but I need to make use of only cloud functions to deploy Django app
Angel
Is there a way to sent a redirect (to remote server) with a custom header… like Auhtorization?
Ravi
Daniel
Hello anyone can help me to realize two step login in admin panel.
1 form is email and password;
after this email code sended to user email;
2 form is code from email and OTP code from GA
I can pay for helping me🙏
Prashant
Hi guys , i want to know how to do the code for category and sub- category , there are 5 columns ... Category id , category name , root category , parent category and technology(T , S , A ,V )
If tech = T ,root category =1 , parent category = 0 , then category details will come in category coloumn , i have done that .
Now if category id = parent category id , then the sub category of that category id will come in sub category coloumn.
Prashant
Can someone pls tell how I can do
Maxim
Richie RH
#ask, which is the most comparable in the scope of cms technology like wordpress but in django / python in general ?
Adhil latheef
In django orm.....how to write an exclude...it exclude objects only satisfy two conditions...???
Example: only exclude If field1=a and field2=b
Rohan
𝒮𝒽𝒶𝓏
Anyone who can help me to find sources to practice writing unit test cases in python
Rohan
Егор
Anyone who used django-oscar here, do you know how to disable payments app from oscar? The idea is to allow users to get an order number from the website and pay for it with our telegram bot.
I know oscar provides “hidden_features” but when I add “payments” there it’s still viewable on the website
Brutus
i want to store multiple selected checkboxes value in jsonfeld in django model. any help ??
Rasul
Rasul
Aydın
hi
I have a url address as follows;
home/heartbeat/
This url is receiving a request from another device (I can't interfere with the device) as follows
home/heartbeat/mac=d8-80-39-e7-dc-27&card=1654637187&protocol=-
here is how i should handle get request starting with mac in django url. Should I apply regex? I can receive the get request manually with a question mark (?mac=d8-80-39-e7-dc-27....), but the device sends the request without a question mark. What path should I follow?
Thank you
Ruchit
Treat mac=d8-80-39-e7-dc-27 as a slug and catch it in your view.
Ruchit
Rest "&" will be your normal get request dict
Anonymous
Why is value_list ('id', flat=True) returning a query set?
Maxim
google lazy evaluation
No one
Hello İ wanna to begin learning Django.
İ don't know anything about Django.
Who can recommend a good tutorial for me?
Alex
Rutherford
I'm trying to serve my django app using gunicorn.
I start gunicorn using the command gunicorn --bind 127.0.0.1:8000 config.wsgi:application --log-level debug.
However when i visit http://127.0.0.1:8000, there's no response.
Heres the dubug log
https://pastebin.com/bpRyaxjD
Please help
Michael the wolf 🐺
you trying to access port 800 ? missing extra 0
Rutherford
Егор
Rutherford
Any logs?
https://pastebin.com/bpRyaxjD
Егор
Set —workers option to configure amount of workers
Neo
How would you implement something like a OneOf validation in a serializer?
Similar to using Union in something like pydantic
D
Guys, has anyone come across this error?
[Errno 2] No such file or directory: 'wkhtmltopdf'
Everything works locally. But on the server I get an error...
wkhtmltopdf added to requirements.txt. Who knows how to fix this?
Neo
D
Neo
Make sure wkhtmltopdf is installed in your remote server. Make sure it's available in path so it can be called if not call it using absolute path
Neo
What problems
D
[Errno 2] No such file or directory: '/usr/bin/wkhtmltopdf'
Neo
Then it's not there
Maxim
Neo
If you installed via pip it won't be in usr/bin i reckon
D
Via pip, and also in startup.sh script,- apt install -y wkhtmltopdf
Neo
Neo
As for pip i believe that it would only be available in path if the venv is activated. I am assuming you have a venv in your production environment
D
Neo
Neo
Although i think you should move to @pythonofftopic
Isha
Docker how to run pip requirements.txt only if there was a change?
Isha
after build i add new package in requirements.txt
Neo