Doragonsureiyā
Ali
from django import forms
class AdminUserForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Meta:
model = User
fields = ('first_name', 'last_name', )
fieldsets = (
("Personal Information", {
'classes': ('wide',),
'fields': ('first_name', 'last_name'),
)
fieldsets didn't apply
only fields works
please help 🆘
Chayeb
from django import forms
class AdminUserForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Meta:
model = User
fields = ('first_name', 'last_name', )
fieldsets = (
("Personal Information", {
'classes': ('wide',),
'fields': ('first_name', 'last_name'),
)
fieldsets didn't apply
only fields works
please help 🆘
I think fields must be list or no?
Kelvin
Learn htmx
Mr
Rahat
How to crate customuser admin in drf
Krishnajith US
Hi i amt trying to deploy my website.i have both frontend and backend.i needed to run both gunicorn and Daphne.i am hosting my frontend in netify.The normal https request working fine.It comes to nginx and then passes to gunicorn but the when I use pass request to web socket it tells there no path exist..i already configured the path in nginx
Ray of Hope
Run both usgi and wsgi using supervisor
Krishnajith US
I am using already using systemd
Ray of Hope
Use redis and try
Charly
Ray of Hope
Yh that qn was part of global warming
Ray of Hope
https://youtu.be/zizzeE4Obc0
Ray of Hope
Deploying django channel application using redis and daphne
Ray of Hope
You better do some research
Ray of Hope
Link above
Ray of Hope
Yes sir😄
Charly
Yes sir😄
Then why redis is relevant for the issue?
(₤ام͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـیر͠
Hi i have a problem wiht django forms
i have d ready html template and in this template in Login page i have a <form> for Login users
and in django when we want to create a login page we use form.py and in Html file just write {{ form }} but this this , everything on the front will be destroyed. what can i do?
Vas
(₤ام͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـیر͠
Widgets form
i no but some of these classes are handmade in the front part(in the css)
Vas
(₤ام͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـ͠ـیر͠
Happy
In create view i want to save that data in json format....help me how can i do that
.
How to make values_list return the str for each instance returned?
I know that
model.objects.values_list(‘fk_field’)
returns a list of id’s of the referenced foreign key, e.g., [1, 2, 3, etc]
How to make it return the str reference of each instance instead?
Mirco
.
use the lookup
Is it related to this part of the documentation?
https://docs.djangoproject.com/en/4.1/ref/models/lookups/
Please clarify what lookup do you mean.
Mirco
David
Mirco
Erfán.R
yo guys im getting this error but i dont know why models created correctly
Erfán.R
can anyone help please?
.
so u cannot 😊
Okay thanks guess I’ll just do it separately as inspired by David’s map hint
str_list = [related_model.objects.get(id=val) for val in pk_list]
Mirco
Gosha
Hello!
I want to create a database, but only some of the fields are being created, please help
Gosha
During migration, 2 fields are created, and there are 5 in total
Rutya
Hi I will create change password API in django rest framework but stuck plz guid me
Suren
Dear friends, I have simple subscription form as below:
try:
if Subscribers.objects.values('email').get(email=subscribers_form.data['email']):
messages.error(request, 'Email already exists')
except:
pass
I get this message "Email already exists" only in admin panel, but how have it popped up on website for user?
Now it is not giving any error and just redirecting to homepage.
.
Suren
Suren
Suren
Purushottam
I Want to show the model data in tablist based on status(complete, in progress). Currently it is coming on only in one page snd using filter option to get particular status data..
Purushottam
Can someone help how this can be achieved
virat kohli
Can anyone how create multitenancy using docker way in django
.
In django admin if you have a model called Player and when you want to create an object of this model you need to relate the player object - before you click save - with a team filed and this field is a foreign key in Player model
I want to be able to create a team object within the player form before clicking save.
like what i can do in django admin panel
Doragonsureiyā
.
Hi, is there any way to make to ways to make an account?
I mean I want to make two different types of account
First one when you make it you can buy things and put them on court, the other one when you create it you will have the ability to sell things and receive money.
How can i find how to do that?
Mirco
.
i'm trying to update a staff object that has department forign key and i still get this error
Cannot assign "'1'": "Staff.department" must be a "Department" instance.
Charly
.
before
worker.department = request.POST.get('department')
i tried to do somethind like:
worker.department.name = request.POST.get('department')
the error stop accouring but wehen i click save nothing changed
Charly
.
I don't have problems with the creating of the object, just with the updating
Rutya
How create django rest framework api in django
Rutya
In Change password API
Frank
Please I am new to django
How to i run already created project on my terminal
Ankit
Frank
Frank
Unknown
Hello I want help.
I host my django web application in AWS EC2, but its Media folder is not working, Images that are uploaded by users are not visible on the website. I connect using nignx and gunicorn.
Any idea?
Vladislav
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
Hello, how to decide this problem ?
Vladislav
When i added context_processors this exception appeared
Charly