bulk_create() and custom user model

30 views
Skip to first unread message

Billy Muller

unread,
Aug 8, 2021, 9:37:16 PM8/8/21
to Django users
Hi, I'd like to create a view in a different app that will allow for someone to upload a csv of users. I already know how to use bulk_create() and CSVs for other things but I'm not sure how to do this with the custom auth model.

Any advice would be greatly appreciated.

Isanur Sardar

unread,
Aug 17, 2021, 12:07:19 PM8/17/21
to Django users
Hey, you can upload the file through a form, and in the backend, you can store the file in temporary memory with the BytesIO method and then read it with CSV library and then loop through row and then use bulk_create
Reply all
Reply to author
Forward
0 new messages