Thank you. It works perfect, while when the load is large you need to use window.location.href = url and prevent the default behavior of redirection of the form using Iframe: ...
Hi this video is amazing but I am using another model instead of user, so how would I do this with another model as the foreign key. Please help and thanks in advance. subscribed!
On 30:40, there"s a media folder in the project folder where sales_data.csv gets saved. I can"t find this folder in my project directory. What am I missing? (BTW, the csv file does get uploaded to that folder, but I can"t find it on my file system). Suggestions?
How can we add some logic to avoid duplicate entries for the incoming data. For example I am able to save the excel file in my database using to_sql. I have to validate that no two duplicate entries can be created for a column in this case I have title column and validate if two products have same title or name, the entry does not get added to the database.
Hi, thanks for the nice vedio. I try to follow your instruction and run into a problem at the very end, it pops out "unsupported operand type(s) for *: 'NoneType' and 'int' " Can you provide me some suggestions to deal with it?
Well summarized tutorial on importing csv to DRF API. This was very helpful. Is there a way you can do multiple csv files contents import one after another? That would a nice thing to know. Thank you for sharing. Already liked and subscribed for a while now!
Hi Bijoy. Thanks for the nice words. Regarding your question... if you keep the files in one directory you could probably loop through them and read their content
kept getting "multiple objects Returned at/" when using the Csv.objects.get() method. Would've used filter, but didn't know what to filter on because all the csv's were the same.
@@Pyplane I didn't mention clearly, sorry. I uploaded the file through upload.html. I could see the file in my media folder which means the upload was successful. But I couldn't see the file in my admin page.
I am getting an error django.core.exceptions.FieldError: Unknown fields (filename) specified for Csv. Can anyone tell why such error is occuring? This error is related to forms.py of csvs folder in the class CsvModelForm
I want to upload a file and parse mail ID from that file. After that, those(mail ID) will be saved in my database. I tried with this code bellow and got this error. Here is my views.py and model.py file Please somebody help me out :(
First, I would like to point out the the "Sales data file download" link in your description is broken. In addition to that, I have followed along almost to the end but when I click on confirm the CSV isn't uploaded. I can see no reason why it wouldn't be. My code is almost identical to yours. I am on a windows machine and so I used a different package for obtaining the path but it works just fine with the html templates. I am not sure what the heck is going on. I was hoping I could download your code and go through it line by line but, as I said before, the link is broken. Unfortunate...
Just as a little FYI, I found the error in my code. After putting in some "Print()" statements I was able to track it down. What was happening was my form was coming up blank and therefore invalid. The reason for this was that in my uploads.html file I had "mothod="post"" instead of "method="post". You see, this is why non-compiled code. A compiler would have never let that typo slide. /sigh Took freakin hours to find.
This is by far the best and most complete explanation of importing csvs to a database in django. I also appreciate other videos from the same person.
Thank you Jeffrey! :)
Thank you. It works perfect, while when the load is large you need to use window.location.href = url
and prevent the default behavior of redirection of the form using Iframe:
...
My guy you saved me. Thank you so much!
Thanks for watching! 💪
really awesome tutorial! i tried other ones but none of them worked for csv. Nicely taught!
Thank you Mayur! Very happy you enjoyed it :)
Thank you so much my friend. This course help me more to practice Django.I will follow your channel
this just saved my computer science coursework, thank you!!!
Thank you for this comment :) glad my video helped you out! Cheers!
Thanks man, it was so helpful
Great Job on this !
Thanks! 🙌
Thanks for wonderful tutorial. I just smashed the subscribed button!
Awesome :) thanks!
sir thank you very much for your tutorial.
Thanks for watching! :)
Nice tutorial, thanks a lot! Very professional :) Greetings from Warsaw ;)
Very good idea, thank you for sharing.
Hi this video is amazing but I am using another model instead of user, so how would I do this with another model as the foreign key. Please help and thanks in advance. subscribed!
thanks you are the best
💯 You're the man! Well Explained.
On 30:40, there"s a media folder in the project folder where sales_data.csv gets saved. I can"t find this folder in my project directory. What am I missing? (BTW, the csv file does get uploaded to that folder, but I can"t find it on my file system). Suggestions?
loving this!
Thank you very much @pyplane
thanks for watching:) Cheers!
How do you keep duplicates out when importing a .CSV file?
How can we add some logic to avoid duplicate entries for the incoming data. For example I am able to save the excel file in my database using to_sql. I have to validate that no two duplicate entries can be created for a column in this case I have title column and validate if two products have same title or name, the entry does not get added to the database.
thank you for the tutorial! It works great!!
Good Job.
its very informative.. but how to get "date" types ..apparently it cannot open date type now..anybody knows?
Hi, thanks for the nice vedio. I try to follow your instruction and run into a problem at the very end, it pops out "unsupported operand type(s) for *: 'NoneType' and 'int' " Can you provide me some suggestions to deal with it?
Well summarized tutorial on importing csv to DRF API. This was very helpful.
Is there a way you can do multiple csv files contents import one after another?
That would a nice thing to know.
Thank you for sharing. Already liked and subscribed for a while now!
Hi Bijoy. Thanks for the nice words. Regarding your question... if you keep the files in one directory you could probably loop through them and read their content
On my blog you can find a hint how to do that with this article: blog.pyplane.com/blog/pandas-analysis-concat-multiple-csv-files/
hi it was working while testing locally but once i deployed the app it says expected byte or byte array and not strings please help!
kept getting "multiple objects Returned at/" when using the Csv.objects.get() method. Would've used filter, but didn't know what to filter on because all the csv's were the same.
Hi Luke
How do you create an object from a csv file when there is a foreign key or many to many relationship between two classes ?
Hi have you solved this issue?
@@eesakamaldien1917 not yet
@@rezasadeghi2520 hi is solved issue, let me know if you still having issue
@@eesakamaldien1917 Hello. Can you provide me with a solution? I need it very much. Thank you
@@denisjs4 yes I can provide solution, will shortly
bro, teach us how can we do it from the front end
How can we send that csv file from one function to another ?
so can we create a table for every csv file upload we make ?
sir i have imported all of the module which are used in project it shows syntax erro
r
hello,great video, I had a question, i got my file in /media/ folder but i couldn't see it on my admin page, would you pls help me pls ?
Hi Joel. Did you configure media files in the settings.py and did you include them in the url patterns?
@@Pyplane I didn't mention clearly, sorry. I uploaded the file through upload.html. I could see the file in my media folder which means the upload was successful. But I couldn't see the file in my admin page.
and dod you include media files in the url patterns?
sorry, yes , I add media_url and media_root and import setting and add that sentence after the url_pattern in urls.py
thank you for helping me, I will watch your video again and compare what I did wrong with my code. Thank you, That's very kind of you.
Did exactly the way the tutorial is, but CSRF token missing or incorrect is being shown.
Hi, I need some help
It seems that MultipleObjectsReturned error was shown, How do I fix this
hi did you solve this issue?
Hi guys,
I have problem with running this
I have: '''IndexError: list index out of range''' or errors with types(float, int, None)
I am getting an error
django.core.exceptions.FieldError: Unknown fields (filename) specified for Csv. Can anyone tell why such error is occuring?
This error is related to forms.py of csvs folder in the class CsvModelForm
Hello everyone!. does anybody knows how to upload images if the path is giving in the csv file. Thank you
Can I get this git hub like for this
nice!hope it's can help me with my task.And why don't you use Pycharm? Just for some notice:it's free if using jetbrains-agent.jar
I'm getting a Sale() got an unexpected keyword argument 'salesman' error. Not sure why. Everything else was working.
is_valid function inside of csvs/views.py keeps returning false....what am I doing wrong?
raise TypeError('context must be a dict rather than %s.' % context.__class__.__name__)
I want to upload a file and parse mail ID from that file. After that, those(mail ID) will be saved in my database. I tried with this code bellow and got this error. Here is my views.py and model.py file
Please somebody help me out :(
I get an error, can I get the full source code in this video?
Hi Muhammad. I will do the uploads of at least main projects to github probably next week.
First, I would like to point out the the "Sales data file download" link in your description is broken. In addition to that, I have followed along almost to the end but when I click on confirm the CSV isn't uploaded. I can see no reason why it wouldn't be. My code is almost identical to yours. I am on a windows machine and so I used a different package for obtaining the path but it works just fine with the html templates. I am not sure what the heck is going on. I was hoping I could download your code and go through it line by line but, as I said before, the link is broken. Unfortunate...
Just as a little FYI, I found the error in my code. After putting in some "Print()" statements I was able to track it down. What was happening was my form was coming up blank and therefore invalid. The reason for this was that in my uploads.html file I had "mothod="post"" instead of "method="post". You see, this is why non-compiled code. A compiler would have never let that typo slide. /sigh Took freakin hours to find.