Anonymous
One year of Django but you can't tell this is a bot? 🤔
maybe he didn't ask the bot but used the reply just to mention the subject?
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
Komang
Can i make a custom function on my models to add records???
https://docs.djangoproject.com/en/2.1/ref/models/instances/.
Mirco
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
https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html This one could help you imho
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?
Mirco
ok thanks
Hope it helps 😀
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
I have a field in the form named "First Name", I want to change to "This is your name, friend"
https://stackoverflow.com/questions/38724012/django-crispy-forms-set-label-text-for-multiple-fields
Mirco
Using meta labels attribute
R
https://t.co/dFOj4XN0Lz
Combot
Helio (0) has increased reputation of Mirco (1)
Mirco
Thanks
😀😀
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
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
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
Mirco
is there any video tutorial for using x-Accel-redirect with django?
https://wellfire.co/learn/nginx-django-x-accel-redirects/ Can this one help ya ?
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
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
https://pastebin.com/G1LccjYh
Try deleting lines 11 to 14
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...
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
inchidi
https://pastebin.com/Cqvx213j
make sure inside your orders.serializers file you import the correct class
Danil
It's 100% correct, cause i use service serializer
inchidi
It's 100% correct, cause i use service serializer
there is no other ServiceSerializer?
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
And try again
Thank you
Combot
lewis kori (0) has increased reputation of Sinatra (1)
Kori
run python -V and make sure its python 3
It was because of this It downgraded to 2.7 and I was using 3 before
Danil
okay then i'll check again
In shell it works fine
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