William
!paste
Doragonsureiyā
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
Hunde
How can i add link to django admin page that redirect to one of my template?
William
https://dpaste.org/WiMW
No tale is related to the user
Anonymous
I am displaying data in a table from two different models
Have you ran this commands: python manage. py makemigrations and python manage.py migrate. If so show us the content of models.py file and the template (the html content)folder content.
Anonymous
https://dpaste.org/WiMW
This is missing at beginning from django import models
Devang_12
This is missing at beginning from django import models
I have imported models form django.db that's it
Devang_12
No tale is related to the user
Should I add this {user = models.ForeignKey('auth.models.User') } to my studentgriev model ?
Anonymous
Does anyone know how to display data from table related to the logged in user?
Do you have forms.py file or a template that handle the post too . Because without uploading or posting content the table wouldn't be able to display or get data .
William
Should I add this {user = models.ForeignKey('auth.models.User') } to my studentgriev model ?
Yes. Instead of auth.models.User Add this from django.conf import settings ForeignKey(settings.AUTH_USER_MODEL)
Anonymous
Does anyone know how to display data from table related to the logged in user?
Do you have forms.py file or a template that handle the post too . Because without uploading or posting content the table wouldn't be able to display or get data .
Chentha
Hi dears, Have anyone know how we can save a data after session lost
Prabhakaran
How to set default selected value in a drop-down ? - I am using model form..
Doragonsureiyā
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
Devang_12
Yes. Instead of auth.models.User Add this from django.conf import settings ForeignKey(settings.AUTH_USER_MODEL)
I did this and while carrying out migrations it is giving me this message " You are trying to add a non-nullable field 'user' to studentgriev without a default; we can't do that (the database needs something to populate existing rows)." What should I add as the default value ?
Luxmi
template https://dpaste.org/DnOd
Luxmi
urls https://dpaste.org/okRe
Devang_12
I had to add on_delete coz it was giving me error
Luxmi
views https://www.toptal.com/developers/hastebin/okoyobewey.rb
Luxmi
error https://www.toptal.com/developers/hastebin/aludofitum.apache
Luxmi
i am trying to make a wishlist using ajax tell me if i am wrong or alternative
Rahkmanuly
Hello there! Are there any ideas how can I speed up my POST view method? The problem is that I make 3 different calls to 3 different resources in my API.
William
I had to add on_delete coz it was giving me error
Yes. For the foreignkey field, you have to add the on_delete flag
Devang_12
Devang_12
models.CASCADE
that's for 'on_delete' right , I am asking for 'default = '
Devang_12
Now I am getting this error while doing migrtions ' django.db.utils.IntegrityError: NOT NULL constraint failed: new__sgrc_studentgriev.user_id ' 🥲🥲
eric
Pls can I get help on how to set up and build a simple app in Django using Virtual studio code. Thank you
Doragonsureiyā
Pls can I get help on how to set up and build a simple app in Django using Virtual studio code. Thank you
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
Serge
@eric kermeh it's very simple, check in Google Vscode extension to be used as well.
Devang_12
Make sure value should be there in previous rows or new rows
There are values in previous rows of the db table
T
Free Django course link plz
Doragonsureiyā
Free Django course link plz
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Sloth
I want to associate a unique id to every api request that hits my django app how can this be done any suggestions? This app is hosted in uwsgi and nginx as a load balancer
назар
Hi to everyone, i have this queryset: orders = Order.objects .annotate(day=TruncDay('date')) .values('day') .annotate(sum=Sum('amount')) .values('day', 'sum') .annotate(customs=Count('customer__name')) .values('day', 'sum', 'customs') How can i get the name of customs, not the count of it?
R.
Does anyone know how to solve this error ⁉️😢
You have null or empty value/s in "new__sgrc_studentgriev.user_id", check for those and delete them before doing the migration
Doragonsureiyā
Does anyone know how to solve this error ⁉️😢
Maybe anyone is here, yes, but they are not obliged to read everyone's message here neither to reply to everyone's message, if someone wants to reply to your message, they will do that, just don't try to draw attention to your message writing "anyone?" every 5 minutes, that will lead you to be warned for SPAM/Flood, just be patient or use Google/DuckDuckGo to research about your question instead of wasting time here waiting for people to do your work. Have a nice day 😊
sarth
hi friends i want to send email to perticular time range, or perticular task in perticular time, so how to.do this with rest framework, please help
Fan / Ac
Use celery....try to read doc on Google..
you should listen to this @sarthak0501 here is a search result 😁 https://stackoverflow.com/questions/63552113/gmail-schedule-send-email-in-django
William
doesn’t working
Share your code. Models and view functions
MeHDI_rh ∞
Hi let's say I have two models: class ExchangeRates(models.Model): ... class Currency(models.Model): ex_rates = models.ManyToManyField(to=ExchangeRates) a Currency can have multiple ExchangeRates, but each ExchangeRates can only be assigned to one Currency. So what should I use instead of ManyToManyField ? as ManyToManyField means a Currency can have multiple ExchangeRates and an ExchangeRates can have multiple Currency !
MeHDI_rh ∞
Foreignkey ?
this way Currency can have only one ExchangeRates
Azizbek Xushnazarov
this way Currency can have only one ExchangeRates
What about creating currency field in ExchangeRates model with FK
Mirco
this way Currency can have only one ExchangeRates
Foreign key is 1 to M One currency can have multiple rates
MeHDI_rh ∞
yes. seems this way it works
MeHDI_rh ∞
thank you
Doragonsureiyā
thank you
You're welcome! 😊
Kishore
What is the difference between self.request.data vs self.initial_data
Kishore
Can anyone explain with simple example pls
Charly
What is the difference between self.request.data vs self.initial_data
request data is the data user sents, inital data is the data which you send to the user
Ahmad
Can anyone teach me python online
Doragonsureiyā
Can anyone teach me python online
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
इमरान عمران Imran
Hi, how to import SQL file in django project
Charly
Hi, how to import SQL file in django project
No that's not how it works
इमरान عمران Imran
No that's not how it works
I mean I've SQL dump file and I want to load it
Charly
I mean I've SQL dump file and I want to load it
use to database manager to do that then
Hunde
How can i add header and footer in django export
इमरान عمران Imran
Anil
How can i add header and footer in django export
https://stackoverflow.com/questions/31456576/django-footer-and-header-on-each-page-with-extends
Vivek
Apart from web3.py, is there any other way to make a django application interact with a smart contract? Like suppose if I am using brownie Framework to deploy and interact with my smart contract can it be integrated into my django app?
Hunde
less = PredictionResult.objects.filter(PatientInformation.firstName=="dinka").count()
Hunde
PredictionResult and PatientInformation have one to many relationship ,I couldn't filter what is wrong with it?
ﹺ ﹺ
I built an app with Quasar using Django backend it works fine on the web, and the apk communicates well with Django Rest Framework, until I login, once I'm logged in, the app freezes until I force close it, then it logs me out. I need help....
Dasa
I have a json data with over a dozen fields. And I need to save all those fields to a model in a single .save() instead of model.field = json_field. Is it possible in Django ?
No
Hello everyone. Can you please tell me how to properly store and work with monetary transactions in the database? How do I recalculate my wallet balance?