Maz
Dcruz
Can i make a custom function on my models to add records???
Anonymous
How do i set up registration for admin(who is the seller) and a Buyer using the same Django Model, please help if possible with samples, this has slowed my project for 2 days,Django Docs is not helping. Thanks
R
Mirco
Anonymous
Thanks @iFlare3G , i did try this
Anonymous
interests = forms.ModelMultipleChoiceField(
queryset=Subject.objects.all(),
widget=forms.CheckboxSelectMultiple,
required=True
)
class Meta(UserCreationForm.Meta):
model = User
@transaction.atomic
def save(self):
user = super().save(commit=False)
user.is_student = True
user.save()
student = Student.objects.create(user=user)
student.interests.add(*self.cleaned_data.get('interests'))
return user
Anonymous
in the signupform form field he used the .add() the method to add the interests objects into student, in my case all i have are Single fields which the .add does not work with, what doi do
Mirco
I don't think you need interests
That's just an example for that use case
The main thing you need to understand is the use of a single model ( User ) that handles two types of users
Anonymous
ok thanks
Hélio
Guys, anyone know how to custom cryspi forms labels?
Hélio
I have a field in the form named "First Name", I want to change to "This is your name, friend"
Hélio
ouch, crispy forms*
Dcruz
😐
Mirco
Using meta labels attribute
Maz
R
https://t.co/dFOj4XN0Lz
Hélio
Combot
Helio (0) has increased reputation of Mirco (1)
Mirco
Raghavendra
Hey guys how can we save the audio clip in Django
Abhi
Hey guys, I am getting 500 internal server error.
Looking at nginx logs doesnt help.
My gunicorn logs are blank.
How can look at the logs shown at server like for the local development server
Jimmies San
Jimmies San
smthing like https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
Abhi
https://pastebin.com/r20qNBtk
Abhi
Django Bot
>> Links
- Pycon Australia 2018 - YouTube
Abhi
Hey guys..I want to send a GET data to my server and recieve a download file on my browser through nginx.
How to do it
Abhi
X-Accel-Redirect seems to confuse me
Abhi
is there any video tutorial for using x-Accel-redirect with django?
Django Bot
>> Links
- Building Django Docker Image with Alpine – CODIUM – Medium
Django Bot
>> Links
- Django Content Management System | Wagtail CMS
Abhi
Mirco
Abhi
What i was trying to do was keep the media and protected files in the same folder
Abhi
Actually both we under media folder
Abhi
I think that was the issue
NRC
Hello..
How to create chat app with django.. trying with django channel but facing issues with Redis..
What are all the alternate options...
Kori
hello i'm getting the following error whenever i run python manage.py runserver. could anyone please help.
Kori
python manage.py runserver
File "manage.py", line 14
) from exc
^
SyntaxError: invalid syntax
syam
How to embed ppt or PDF inside a django website
Anonymous
Kori
https://pastebin.com/G1LccjYh
Anonymous
I don't see anything wrong
Kori
the problem started when i updated some packages on anaconda. and thats's where my django is. could that cause an issue?
Anonymous
Anonymous
And try again
NRC
N R C:
Hello..
How to create chat app with django.. trying with django channel but facing issues with Redis..
What are all the alternate options...
ʚɞÇherry Łoveʚɞ
Danil
Hi there guys, so i have a question: my serializer doesn't work
Danil
so
Danil
i have to show code i guess
Danil
oh, i can't send screenshots :(
Mirco
Use pastebin
Danil
https://pastebin.com/Cqvx213j
Danil
so configuration field doesn't work
Danil
https://pastebin.com/hcrqpf5N
Danil
this is my api response
Abhi
inchidi
Abhi
Danil
It's 100% correct, cause i use service serializer
inchidi
Danil
No. there's only one
inchidi
if you are using pycharm you can ctrl+click the class, it will jump to class you are using
Danil
yeah, i've done
inchidi
try it to make it sure
Danil
it's correct serializer
inchidi
okay then i'll check again
Kori
Combot
lewis kori (0) has increased reputation of Sinatra (1)
Danil
inchidi
In shell it works fine
is it because you pass read_only to the serializer? usually i set read_only to certain field, never class so am just guessing here