Model API or load bulk data?
I want to add scrapped data to my database. I like the fact that the API enables validation but I assume that the overhead is too high. I'm writing maybe 10k rows at a time, at most. Is that accurate?
Alright, so one other issue I was having, which was preventing me from testing this hypothesis is that I'm currently unable to import my models module. I get an error message claiming that my DJANGO_SETTINGS_MODULE is undefined.
my django.wsgi script does define it and it works within the context of django. I assume that when I try to execute a python file from the command line, the .wsgi script i开发者_开发百科s not run. Again, assumptions, I know.
Do I have to add my django project to my PYTHONPATH within the bashrc file to make this work?
You'll need to set your project's settings file in ~/.bashrc if you want to use it in a script.
export PYTHONPATH=$PYTHONPATH:/path/to/django/project
export DJANGO_SETTINGS_MODULE=settings
or
export DJANGO_SETTINGS_MODULE=/path/to/django/project/settings
精彩评论