Now on writing path as sys.path.insert(0,’/home/pooja/Desktop/mysite’), it ran fine asked me for the word tobe searched and gave this error:
Traceback (most recent call last):
File “call.py”, line 32, in
s.save()
File
“/usr/local/lib/python2.6/dist-packages/django/db/models/base.py”,
line 463, in saveself.save_base(using=using, force_insert=force_insert,
force_update=force_update)File
“/usr/local/lib/python2.6/dist-packages/django/db/models/base.py”,
line 524, insave_base
manager.using(using).filter(pk=pk_val).exists())):
File
“/usr/local/lib/python2.6/dist-packages/django/db/models/query.py”,
line 562, in existsreturn self.query.has_results(using=self.db)
File
“/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py”,
line 441, in has_resultsreturn bool(compiler.execute_sql(SINGLE))
File
“/usr/local/lib/python2.6/dist-packages/django/db/models/sql/compiler.py”,
line 818, in execute_sqlcursor.execute(sql, params)
File
“/usr/local/lib/python2.6/dist-packages/django/db/backends/util.py”,
line 40, in executereturn self.cursor.execute(sql, params) File
“/usr/local/lib/python2.6/dist-packages/django/db/backends/sqlite3/base.py”,
line 337, in execute
return Database.Cursor.execute(self, query, params)django.db.utils.DatabaseError: no such table: search_keywords
Please help!!
The exception says:
no such table: search_keywords, which is quite self-explanatory and means that there is no database table with such name. So:You may be using relative path to db file in
settings.py, which resolves to a different db depending on place where you execute the script. Try to use absolute path and see if it helps.You have not synced your models with the database. Run
manage.py syncdbto generate the database tables.