Thanks, I'll try it now. What does
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
do? I read the documentation here
http://docs.python.org/library/os.html
but I didn't understand.
My app is in
C:.../Documents/PROJECTS/Django/sw2/wkw2.
Do I enter?
os.environ['DJANGO_SETTINGS_MODULE'] = 'sw2.settings'?
from sw2.wkw2.models import School, Lawyer
By INPUT_FILE you mean the file where data I want to upload to sqlite3
is, correct? That file is sw2/csvtest1.csv
What's 'Internal ID'?
....
This is my models.py:
from django.db import models
class School(models.Model):
school = models.CharField(max_length=300)
def __unicode__(self):
return self.school
class Lawyer(models.Model):
firm_url = models.URLField('Bio', max_length=200)
firm_name = models.CharField('Firm', max_length=100)
first = models.CharField('First Name', max_length=50)
last = models.CharField('Last Name', max_length=50)
year_graduated = models.IntegerField('Year graduated')
school = models.CharField(max_length=300)
school = models.ForeignKey(School)
class Meta:
ordering = ('?',)
def __unicode__(self):
return self.first
Thanks!