CHANDRA SHEKHAR
How to find common elements between two querysets ?
CHANDRA SHEKHAR
like for example i have
CHANDRA SHEKHAR
<QuerySet [<MyUser: sam is registered with 1234567890>, <MyUser: sameer is registered with 5678>]>
CHANDRA SHEKHAR
this is first queryset
CHANDRA SHEKHAR
QuerySet [<MyUser: sam is registered with 1234567890>, <MyUser: ramu is registered with 234566543>, <MyUser: Somesh is registered with 9090>, <MyUser: random is registered with 34567890>, <MyUser: random1 is registered with 456789>]>
CHANDRA SHEKHAR
this is second queryset
CHANDRA SHEKHAR
like in this case <MyUser: sam is registered with 1234567890> is common element
Sourab
Please help! I want to set an inline style on a div. <div style=“width: calc({{widthsize}}/5)%” ></div> Here widthsize is passed in an array over which i am iterating. I have also tried using “with” but it didn’t work as well. How to workaround this issue. Much appreciated.
Брат
class FirstClass(models.Model): first_field = models.ForeignKey(FirstModel) second_field = models... class SecondClass(FirstClass): first_field = models.ForeignKey(SecondModel)
Брат
Is it good to have that kind of inheritance?
Брат
Maximiliano Exequiel
https://django-simple-history.readthedocs.io/en/latest/quick_start.html
Димон
Hey, I have a problem with connection MySQL 5.1 with django 4.0 As I see, connector for MySQL in django 4.0 doesn’t support this MySQL version. So, I tried to connect in ODBC mode, but I found out that there isn’t any information about that Can you help me?(
Димон
🚬🦧
Димон
🥺
Димон
But this not my db, I use it only in read mode, to get invite_code of user
Димон
Stupid old MySQL
Neo
Stupid old MySQL
Maybe create an API to access that database with an older version of django?
Mohamadou
Hello guys!!! Please how can use crispy forms module ??🙏🙏🙏
Димон
Maybe create an API to access that database with an older version of django?
As solution it’s ok, thanks But I’m looking for another “in project solution”
~
how can I make it so that when adding to the database, everything is possible, and when editing, only some Django fields
Neo
how can I make it so that when adding to the database, everything is possible, and when editing, only some Django fields
i believe there is a method called get_editable_fields or get_readonly_fields that you can override, confirm the method names i could have made slight mistakes
~
write it in models.py or admin.py??
Neo
write it in models.py or admin.py??
in your ModelAdmin class
~
ok thanks
Димон
maybe sqlalchemy? or peewee?
Oh, I didn’t hear about peewee, I will check
Димон
Thanks, @warpigg
Neo
Oh, I didn’t hear about peewee, I will check
yeah it's pretty lightweight i use it in projects that aren't contained in the django ecosystem. sqlalchemy can be a bit overwhelming
Neo
but peewee should get your job done since you only need to read some data
Azzani
hi everyone , i created django project and now practicing to deploy it into heroku , i try every solutions from web but i still get the same problem ! any one have idea who can help me or advice me with better hosting site ? im stuck here almost 2 weeks on this :(
Azzani
i will copy it and past it here , thanks
Doragonsureiyā
i will copy it and past it here , thanks
To share code or error tracebacks, use a pasting service, like: - https://linkode.org - https://dpaste.org
Azzani
okay
Azzani
this what happened when i try to push it
Azzani
i committed already and i had a Procfile and requirements
Azzani
what can i do ?
Azzani
https://dpaste.org/WDDaN
.
i committed already and i had a Procfile and requirements
I think you forget to create runtime.txt file
Azzani
I try it few days ago and I type on it - python -3.1.0 , something like that but still not working
Azzani
What I remember that I didn't create a API for my project , I don't know if that's the problem or not
Azzani
I can share my whole project it's okay if someone can help me on this ,
.
I can share my whole project it's okay if someone can help me on this ,
copy your error and try paste it in google you will see similar problems App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
Azzani
I try a lot I aswear more than a week now on this issue
Azzani
Is there something better than heroku and free ? Or cheap hosting ?
.
Is there something better than heroku and free ? Or cheap hosting ?
pythonanywhere but give you 3 months only free plan
Azzani
pythonanywhere but give you 3 months only free plan
I will try it , thank you so much for trying to help me 🙏
.
I try a lot I aswear more than a week now on this issue
I think your error in 3 important files requirements.txt or Procfile or runtime.txt I want to see inside it
Azzani
Okay , I will copy it and share the link here
Azzani
https://dpaste.org/vcrUv
Azzani
i included also setting.py file and wsgi.py file in case
.
https://dpaste.org/vcrUv
you have error in runtime file word “python” must be small letter not capital letter
.
https://dpaste.org/vcrUv
Heroku use by default postgres database you must setup it in
Azzani
Ah ok I will now , thank you so much bro , hopefully it will work
.
Ah ok I will now , thank you so much bro , hopefully it will work
you must put two pip packages in requirement.txt dj-database-url psycopg2-binary
Azzani
Ah okay Boss 👍
Azzani
I'm working on it now , I will update you later
Dev
How to create dependable dropdown in django models
kmk
Hi all. can anyone give me an API example on DRF please
Fan / Ac
Hi all. can anyone give me an API example on DRF please
Hi check drf docs https://www.django-rest-framework.org/
Bhawna
Can someone help me to pass I'd data in popup
Ulug'bek | Python Developer
Hi guys. Do you know a resource for making your lessons in Djangoda educational system step-by-step
Greg
Hey guys,. How can I get client domain or subdomain.?
Greg
Or IP address
Greg
Mirco
doesnt work
It works it works
Greg
I get REMOTE_ADDR, HTTP_X_FORWARDED_FOR, HTTP_X_FORWARDED_HOST , REMOTE_ADDR and nothing help me
Greg
How I can check?
Greg
from ngnix?