Fetching data from database

51 views
Skip to first unread message

Kiran Bangde

unread,
Oct 28, 2020, 2:43:02 PM10/28/20
to django...@googlegroups.com
Hi everyone,

Iam stuck at a point ...I want to fetch a data from a database , where data should be insert manually , plz help me how to do that how to fire a queries in DB and how to use primary key and foreign key over here. 
Please help me ,Iam new to Django . 

Thanks in advance

Ashutosh Mishra

unread,
Oct 28, 2020, 2:51:18 PM10/28/20
to django...@googlegroups.com
You have go through the django docs,
In django request.method.POST is used to inser data
And Model.objecs.all() this is the way how you fetch data,
You need to study docs

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAH3w0pg60HpYHzta5hjHTw7NaiBbuh7Q1uOfG%2BkZnRAGgQLOYA%40mail.gmail.com.

David Nugent

unread,
Oct 29, 2020, 12:40:09 AM10/29/20
to django...@googlegroups.com, Kiran Bangde
You question isn't very specific, however I'll try to add a couple of touch-points that may provide some direction.

Django manage.py can provide direct access to your models.

python manage.py shell

is your friend, for manually manipulating data, including the database via the Django ORM.

This link to the Django docs could provide a good starting point, particularly further down the page where models are queried using the Django shell.

Secondly are the import and export data commands available in manage.py, in particular the dumpdata and loaddata commands. I suspect this is what you are looking for.



Kiran Bangde

unread,
Oct 29, 2020, 1:34:37 AM10/29/20
to David Nugent, django...@googlegroups.com
Thanks, I'll check them out. 

kern zhou

unread,
Oct 29, 2020, 9:03:54 AM10/29/20
to Django users

Derek

unread,
Oct 29, 2020, 9:23:33 AM10/29/20
to Django users
Reply all
Reply to author
Forward
0 new messages