我有django app名为TrainingData .... 训练数据modeels.py
class TrainingData(models.Model):
UserName= models.CharField(max_length=200,default='')
UserAge=models.TextField(default='')
UserCitiesVisited=models.CharField(max_length=50,default='')
UserLocation=models.CharField(max_length=200,default='')
UserDescription=models.TextField(default='')
UserActivity=models.CharField(max_length=500,default='')
ActivityType=models.CharField(max_length=500,default='')
ActivityDescription=models.TextField(default='')
with open("/home/anish/ElisiyaActivitiesdata/activities/items.csv") as f:
First_Name=""
reader = csv.reader(f)
for row in reader:
Member_Name=row[0],
Member_location=row[1],
Member_age=row[2],
Member_CitiesVisited=row[3]
Member_Description=row[4]
Activity=row[5]
Activity_Type=row[6]
Activity_desc=row[7]
TD=TrainingData(UserName=First_Name,UserLocation=Member_location,UserAge=Member_age)
TD.save()
我能够运行syncdb,完全运行服务器成功 即使我在postgres shell上做了\ dt,我看到我的表中添加了数据
我的问题是为什么我无法访问由django框架创建的表? 当我从shell中选择查询时...... 是因为我的ubuntu可能不允许访问app,即使我使用posgres作为su ..?