loading script deployment

37 views
Skip to first unread message

Leif

unread,
Feb 10, 2018, 10:14:29 AM2/10/18
to Django users
Dear Django,

Sorry if this question has been answered. I have a Django based web application and I just developed a loading script to upload data to database using django model. The code is located under management/commands. Here is the commands to run the script:

$source ./appenv/bin/activate appenv
(appenv)$python manage.py load_data data_file.csv

I would like to deploy this script to my client. I don't want to send the entire code of web application. How do I do it? 

Thank you in advance for your help.

Best,

Leif

Dylan Reinhold

unread,
Feb 10, 2018, 12:56:34 PM2/10/18
to django...@googlegroups.com
What you want to do is build a REST interface for this data load. Then you give them a python script that is just pushing the data into your REST API.
Using the management commands requite most of of your project to be installed on their side and even worse it would need a connection back to the DB.

Dylan

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/08fbd5c7-7b1f-410d-af06-7a5e7802b0e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leif

unread,
Feb 10, 2018, 3:46:01 PM2/10/18
to Django users
Hi Dylan,
Thank you for the great input. Hopefully django REST interface will be able to handle the post for large amount of data (~500k rows) without problem.
Best,
Leif 

Jani Tiainen

unread,
Feb 11, 2018, 6:28:08 AM2/11/18
to django...@googlegroups.com
Hi.

Since you have so much data to pass and it's in CSV format I would suggest that instead of pushing data row by row over network upload that data in CSV format to your API.

Then parse file using forms and save to database.


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Leif

unread,
Feb 11, 2018, 7:55:37 PM2/11/18
to Django users
Thank you, Jani,
I will try.
Best,
Leif

On Saturday, February 10, 2018 at 10:14:29 AM UTC-5, Leif wrote:
Reply all
Reply to author
Forward
0 new messages