Almaz
Is there some flags to do it, like -d flag in docker
Anonymous
Override to_representation method of serializer
Almaz
Hamouda
Override to_representation method of serializer
is there a documentation on how to use this function please
Anonymous
Whatever you see in your response, it is organised by to_representation method of serializer
Anonymous
There is an argument in this function named 'instance'..see source code on cdrf.co
Anonymous
This instance is your User's instance
Anonymous
And then assign values to key using instance..like instance.name, instance.phone_number etc..then return the dict or whatever it is.. better you first learn about that method
Arslan
Hi guys, how to run celery worker and beat in the background on the Ubuntu server, who know, please help)
https://channels.readthedocs.io/en/stable/deploying.html you can write same thing for celery worker and celery beat
Arslan
read this one too https://dev.to/idrisrampurawala/deploying-django-with-celery-and-redis-on-ubuntu-3fo6
Almaz
🙏Thanks
Mandeep
Can anybody send project in python django??with sources code
Doragonsureiyā
Can anybody send project in python django??with sources code
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box, write down the same words you asked here Step 4: Read the first results
Jeff
hi folks
Mirco
hi folks
!hello
Doragonsureiyā
hi folks
Please move your "Hello" and other social talk to @PythonOfftopic.
Jeff
I have a requests.get inside a view, but the content is huge and it takes several seconds to load. How can I mank django wait for that? I have no async support.
Mirco
I have no async support, it's pre 3.1.
so just use queues like Celery or Django Q and u can spawn async tasks
Doragonsureiyā
thank you
You're welcome! 😊
Faxmodem
hi how to Limit a single record in model for django ? my model : class FeaturesSection(models.Model): img = models.ImageField(upload_to='blog/' ) title = models.CharField(max_length=50 ) description = models.TextField() features_id = models.IntegerField()
Faxmodem
limit what ?
im need 1 object(row) in model ! user can't create 2 row » only 1 row
Mirco
im need 1 object(row) in model ! user can't create 2 row » only 1 row
it's up to your UI/UX to block users to create new section
Mirco
not at the model level
Mirco
but you can override the save() and enforce the check on the count()
Bharathwajan
auth.authendicate () is not working for me can someone help me
Guri
I am not able to render form in HTML
ThunderCore Community
Consider product table having 100 records Under A category B C are there To display C category products only Please help which orm query I can use
âshîsh
Consider product table having 100 records Under A category B C are there To display C category products only Please help which orm query I can use
it should be like your_model.objects.filter("category"=C) Then you can access all sub fields of category C
ThunderCore Community
Ok thanks
Bharathwajan
authendicate function always returns none to me can anyone say why i done everything correctly my registration form can update data to the table but i cant fetch data from database please help !!!!!
Shanks
Can I make a big e-commerce site using sqlite3 and Django or shall I use mysql?
Caesar
how can I use conditions in templates when i want to compare with some data? for example something like this {% if vendor == 'vendor' %}
Bharathwajan
Hi what is your query please could you elaborate
actually i am using authenticate function to authticate username and password with database ( postgres) but it always returns me none
Bharathwajan
Bharathwajan
Charanjit Singh
Yes
Bharathwajan
Yes
i send message bro plzz check
AMIN
Can any one tell me a project for learning Django rest
AMIN
I have done a project in django can anyone check it and tell me how can i make it better?
Anonymous
Can we make Android app using django?
Anonymous
Can't even with django rest framework?
cj
Can't even with django rest framework?
that's not "making an Android app"... that will be building an API to be consumed by an external client —that can be an Android app, iOS app, an SPA, other website, a desktop app, and so on—
Anonymous
Okay, so drf is fine for backend of an Android app?
Shanks
me too
Why so?
cj
Okay, so drf is fine for backend of an Android app?
it's fine to build an REST API to be consumed by any other kind of client
Anonymous
Okay, thankyou
cj
Can I make a big e-commerce site using sqlite3 and Django or shall I use mysql?
big e-commerce with sqlite in the same sentence doesn't make sense at all if you want to build some big app, use PostgreSQL
Bharathwajan
Why so?
If you are building an application with maps or you are storing geographical data, you need to use PostgreSQL, as GeoDjango is only fully compatible with PostgreSQL
Shanks
What if I use mysql?
cj
What if I use mysql?
if you want to use Django, then use PostgreSQL, they both play nice along... can't say the same with MySQL (and it's a toy DB also, if you want a real RDBMS, use PostgreSQL)
Shanks
What's the big benefit?
Prince
What's the big benefit?
better support & more features for psql
Shanks
better support & more features for psql
I'm good with mysql , so switching it postresql is going to be easy?
Koen de
One thing I like about PostgreSQL are the JSONFields https://docs.djangoproject.com/en/3.1/ref/contrib/postgres/fields/
cj
One thing I like about PostgreSQL are the JSONFields https://docs.djangoproject.com/en/3.1/ref/contrib/postgres/fields/
or the even more useful feature: SearchVector https://docs.djangoproject.com/en/3.1/ref/contrib/postgres/search/
Raman
AttributeError: /app/.heroku/python/bin/python: undefined symbol: Error_GetLastErrorNum
Raman
how can i resolve this
Raman
i am trying to deploy my app on heroku
Neo
hi i am doing a e commerce website, for this which is the better option either using default user model and extend it or write the models from scratch like users, session..etc
Neo
Simple extends the default user model. So in future if you want to add something in user model you can do it easily.
Okay, is django user and session models able to handle e commerce web applications
~:$
Okay, is django user and session models able to handle e commerce web applications
E commerce nothing to do with user and session model. They are general purpose things. You have to build your own logic to make whatever you want to make.
Neo
E commerce nothing to do with user and session model. They are general purpose things. You have to build your own logic to make whatever you want to make.
We have two types of users one is internal employees and other is web site users who can register and login