first , check your excel file , see what are the columns types ..
then , make a model in django models.py and choose model fields to be the
same type as each column in the excel file ..
in your views.py make a function that will read the excel file from the
file location on your machine ..
in this function use the code provided in Kasper tutorial link
https://www.geeksforgeeks.org/reading-excel-file-using-python/
while you are looping through each row in your excel file you can populate
the model you created in models.py ..
but if the excel file is too large , this will block your code , maybe
cause the database to be locked too ..
if you face this problem consider using threading or asyncio ..

On Sat, May 9, 2020 at 7:09 AM ratnadeep ray <ratnade...@gmail.com> wrote:

> Thanks Derek for this.
>
> On Friday, 8 May 2020 19:20:31 UTC+5:30, Derek wrote:
>>
>> If you can, use an existing app:
>>
>> https://github.com/wq/django-data-wizard
>>
>>
>> On Friday, 8 May 2020 14:57:43 UTC+2, Kasper Laudrup wrote:
>>>
>>> Hi Ratnadeep,
>>>
>>> On 08/05/2020 14.03, ratnadeep ray wrote:
>>> > Hi all,
>>> >
>>> > Can anyone let me know how to push the fetched data from an excel to
>>> any
>>> > DB using Django?
>>> >
>>>
>>> It's not very clear what you mean by "the fetched data". Have you
>>> fetched some data already? In which format?
>>>
>>> If you need to extract data from an excel sheet, this was the first
>>> guide I could find:
>>>
>>> https://www.geeksforgeeks.org/reading-excel-file-using-python/
>>>
>>> Also, "any DB" is extremely vague. Do you have a database already? Or do
>>> you just want to go for whatever database is the best suited for
>>> whatever you are trying to achieve?
>>>
>>> And what exactly do you want to use Django for? Django is a web
>>> framework and nothing in your question mentions anything about that...
>>>
>>> Kind regards,
>>>
>>> Kasper Laudrup
>>>
>>>
>>>
>>>
>>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4cca72a6-1b5d-4fa8-8c60-c3593cdaca90%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4cca72a6-1b5d-4fa8-8c60-c3593cdaca90%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-e5PRygQvW3Hqs_3yq3FCwPnEnL6x%3DPUH3QP-xzgORhug%40mail.gmail.com.

Reply via email to