Unable to rebuild index in django haystack - django

I am trying to run manage.py rebuild_index but getting below error.
`(django_project)deep#deep-ThinkPad-Edge:~/doroko$ python manage.py rebuild_index No handlers could be found for logger "django_facebook.models" /home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/django/utils/image.py:150: RemovedInDjango18Warning: Support for the PIL will be removed in Django 1.8. Please uninstall it & install Pillow instead. RemovedInDjango18Warning
System check identified some issues:
WARNINGS: ?: (1_6.W001) Some project unittests may not execute as expected. HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & behaving as expected. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information. System check identified some issues:
WARNINGS: ?: (1_6.W001) Some project unittests may not execute as expected. HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & behaving as expected. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information.
WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'. Your choices after this are to restore from backups or rebuild via the `rebuild_index` command. Are you sure you wish to continue? [y/N] y Removing all documents from your index because you said so. Failed to clear Elasticsearch index: ConnectionError(('Connection aborted.', error(111, 'Connection refused'))) caused by: ProtocolError(('Connection aborted.', error(111, 'Connection refused'))) All documents removed. System check identified some issues:
WARNINGS: ?: (1_6.W001) Some project unittests may not execute as expected. HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & behaving as expected. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information. Indexing 34 wishs ERROR:root:Error updating feed using default Traceback (most recent call last): File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 189, in handle_label
self.update_backend(label, using) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 234, in update_backend
do_update(backend, index, qs, start, end, total, self.verbosity) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 89, in do_update
backend.update(index, current_qs) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py", line 164, in update
prepped_data = index.full_prepare(obj) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/indexes.py", line 207, in full_prepare
self.prepared_data = self.prepare(obj) File "/home/deep/doroko/feed/search_indexes.py", line 16, in prepare
data = super(feedIndex, self).prepare(obj) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/indexes.py", line 198, in prepare
self.prepared_data[field.index_fieldname] = field.prepare(obj) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/fields.py", line 159, in prepare
return self.convert(super(CharField, self).prepare(obj)) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/fields.py", line 165, in convert
return six.text_type(value) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/django/db/models/manager.py", line 81, in __str__
in opts.concrete_managers + opts.abstract_managers StopIteration Traceback (most recent call last): File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute() File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/management/commands/rebuild_index.py", line 16, in handle
call_command('update_index', **options) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 115, in call_command
return klass.execute(*args, **defaults) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 184, in handle
return super(Command, self).handle(*items, **options) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/django/core/management/base.py", line 503, in handle
label_output = self.handle_label(label, **options) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 189, in handle_label
self.update_backend(label, using) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 234, in update_backend
do_update(backend, index, qs, start, end, total, self.verbosity) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/management/commands/update_index.py", line 89, in do_update
backend.update(index, current_qs) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py", line 164, in update
prepped_data = index.full_prepare(obj) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/indexes.py", line 207, in full_prepare
self.prepared_data = self.prepare(obj) File "/home/deep/doroko/feed/search_indexes.py", line 16, in prepare
data = super(feedIndex, self).prepare(obj) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/indexes.py", line 198, in prepare
self.prepared_data[field.index_fieldname] = field.prepare(obj) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/fields.py", line 159, in prepare
return self.convert(super(CharField, self).prepare(obj)) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/haystack/fields.py", line 165, in convert
return six.text_type(value) File "/home/deep/.virtualenvs/django_project/local/lib/python2.7/site-packages/django/db/models/manager.py", line 81, in __str__
in opts.concrete_managers + opts.abstract_managers StopIteration`
This is the search_indexes.py file for model.
import datetime
from haystack import indexes
from feed.models import Wish
class feedIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
wish_text = indexes.CharField(model_attr='wish_text',null=True)
tags = indexes.CharField(model_attr='tags')
added = indexes.DateTimeField(model_attr='added')
def get_model(self):
return Wish
def prepare_wish_text(self, obj):
return "Wish"
def prepare(self, obj):
data = super(feedIndex, self).prepare(obj)
data["_boost"] = 1.5
return data
Following are versions used :
Django==1.7.6
django-haystack==2.3.1
elasticsearch==1.4.0
pyelasticsearch==0.5

Testing seems to suggest this comes up if a search template is incorrectly configured.
Double check all the fields in your search template and find the incorrect one and the issue should resolve.
https://groups.google.com/forum/#!topic/django-haystack/InXrimOyHtQ

Related

Django's remove_stale_contenttypes command fails with DoesNotExist error

I recently tried to run remove_stale_contenttypes in a Django 3.1 app, after deleting some custom permissions. The first time it run it warned me that some entries would be deleted, and I went ahead and entered 'yes'. The command failed with a DoesNotExist error for one of the models, and after that I can't even see the warning, it fails right away, with the following output:
Traceback (most recent call last):
File "C:\Users\Yamil\Google Drive\Proyectos\monely\manage.py", line 22, in <module>
main()
File "C:\Users\Yamil\Google Drive\Proyectos\monely\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\core\management\__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\core\management\base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\core\management\base.py", line 371, in execute
output = self.handle(*args, **options)
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\contrib\contenttypes\management\commands\remove_stale_contenttypes.py", line 55, in handle
collector.collect([ct])
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\db\models\deletion.py", line 295, in collect
if sub_objs:
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\db\models\query.py", line 291, in __bool__
self._fetch_all()
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\db\models\query.py", line 1303, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\polymorphic\query.py", line 64, in _polymorphic_iterator
real_results = self.queryset._get_real_instances(base_result_objects)
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\polymorphic\query.py", line 387, in _get_real_instances
if base_object.polymorphic_ctype_id == self_model_class_id:
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\db\models\query_utils.py", line 149, in __get__
instance.refresh_from_db(fields=[field_name])
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\db\models\base.py", line 635, in refresh_from_db
db_instance = db_instance_qs.get()
File "C:\Users\Yamil\anaconda3\envs\monely\lib\site-packages\django\db\models\query.py", line 429, in get
raise self.model.DoesNotExist(
productos.models.DoesNotExist: Producto matching query does not exist.
Now, I noticed that the model that failed is a PolymorphicModel (django-polymorphic), but I have no idea what could be going on. The application seems to be working fine, it passes the tests. I also briefly checked the database and couldn't really find any unused contenttypes, but the command keeps failing. How can I find the root of this problem?

SQLite objects created in a thread can only be used in that same thread with Django 2.2.2 and ipdb

I updated my Django project to version 2.2.2 and now when I call to ipdb for debugging, the server tell me that error. If I go back to Django 2.2.1, the error disappears.
System check identified no issues (0 silenced).
June 06, 2019 - 08:19:36
Django version 2.2.2, using settings 'laserapp.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
> /home/lynde/public_html/laserapp/gestion/views.py(192)get_context_data()
191 import ipdb; ipdb.set_trace()
--> 192 context = super(ResumeOrderCodeView, self).get_context_data(**kwargs)
193 try:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 60, in execute
super().execute(*args, **options)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 95, in handle
self.run(**options)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 585, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 570, in start_django
reloader.run(django_main_thread)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 288, in run
self.run_loop()
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 294, in run_loop
next(ticker)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 334, in tick
for filepath, mtime in self.snapshot_files():
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 350, in snapshot_files
for file in self.watched_files():
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 249, in watched_files
yield from iter_all_python_module_files()
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 120, in iter_modules_and_files
sys_file_paths.append(module.__file__)
AttributeError: module '__main__' has no attribute '__file__'
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev#python.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/IPython/core/history.py", line 780, in writeout_cache
self._writeout_input_cache(conn)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/IPython/core/history.py", line 764, in _writeout_input_cache
(self.session_number,)+line)
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140030717908736 and this is thread id 140031011022656.
Can somebody know what's the problem there? I'm using django runserver in local machine, with celery and postgresql database.
Thanks!! :)
Try using the --reload flag to run runserver.
./manage.py runserver --noreload
It stops the server reloading on code changes but I think avoids the issue you're having.

Django 2.0 haystack whoosh update index, rebuild index throw error

I am using django 2.0 with haystack+whoosh as a search. I configured as it is said in the documentation. Occurred problem is when i run ./manage.py rebuild_index it shows this error:
Traceback (most recent call last):
File "./manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/management/commands/rebuild_index.py", line 36, in handle
call_command('clear_index', **options)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/django/core/management/__init__.py", line 133, in call_command
', '.join(sorted(valid_options)),
TypeError: Unknown option(s) for clear_index command: batchsize, workers. Valid options are: commit, help, interactive, no_color, nocommit, noinput, pythonpath, settings, skip_checks, stderr, stdout, traceback, using, verbosity, version.
after that i tried update_index it shows me this error:
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 214, in handle self.update_backend(label, using)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 257, in update_backend
commit=self.commit, max_retries=self.max_retries)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/management/commands/update_index.py", line 84, in do_update
backend.update(index, current_qs, commit=commit)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/backends/whoosh_backend.py", line 185, in update
doc = index.full_prepare(obj)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/indexes.py", line 208, in full_prepare
self.prepared_data = self.prepare(obj)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/indexes.py", line 199, in prepare
self.prepared_data[field.index_fieldname] = field.prepare(obj)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/fields.py", line 205, in prepare
return self.convert(super(CharField, self).prepare(obj))
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/fields.py", line 88, in prepare
values = self.resolve_attributes_lookup(current_objects, attrs)
File "/home/zorig/.virtualenvs/ftm/lib/python3.5/site-packages/haystack/fields.py", line 131, in resolve_attributes_lookup
values.append(current_object())
TypeError: __call__() missing 1 required keyword-only argument: 'manager'
So has anyone faced this error? Is it related to django 2.0 because i managed it work well with django 1.11.
Your installed version of Haystack does not support Django 2.0. Support for Django 2.0 was added in Haystack 2.8, which was released in March 2018.

How to install neo4django in virtual environment

I receive the error below when trying to install neo4django in my virtual environment. Not sure what the problem is. The server is running on my machine and py2neo works with the restful api, but not neo4django.
I'm running ubuntu 12.0.4 with the latest version of neo4j installed (1.9-M01) and jdk 1.7 (openjkd) installed with JAVA_HOME pointing to: /usr/lib/jvm/java-7-openjdk-amd64
Traceback (most recent call last): File "manage.py", line 10, in
execute_from_command_line(sys.argv) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/core/management/init.py",
line 443, in execute_from_command_line
utility.execute() File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/core/management/init.py",
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/core/management/base.py",
line 196, in run_from_argv
self.execute(*args, **options.dict) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/core/management/base.py",
line 232, in execute
output = self.handle(*args, **options) File "/home/alan/workspace/neowiki/neowiki/nodes/management/commands/testcmd.py",
line 10, in handle
pete = Person.objects.create(name='Pete') File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/manager.py",
line 41, in create
return self.get_query_set().create(*kwargs) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/query.py",
line 747, in create
return super(NodeQuerySet, self).create(*kwargs) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/db/models/query.py",
line 377, in create
obj.save(force_insert=True, using=self.db) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/base.py",
line 325, in save
return super(NodeModel, self).save(using=using, **kwargs) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/django/db/models/base.py",
line 463, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update) File
"/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/base.py",
line 340, in save_base
self._save_neo4j_node(using) File "", line 2, in _save_neo4j_node File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/base.py",
line 115, in trans_method
ret = func(*args, **kw) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/db/models/base.py",
line 370, in _save_neo4j_node
typesToIndex=type_names_to_index) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/neo4jclient.py",
line 179, in gremlin_tx
return self.gremlin(script, tx=True, **params) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/neo4jclient.py",
line 168, in gremlin
params) File "/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4django/neo4jclient.py",
line 153, in send_script
script_rv = ext.execute_script(s, params=params, **execute_kwargs) File
"/home/alan/workspace/neowiki/venv/local/lib/python2.7/site-packages/neo4jrestclient/client.py",
line 1960, in call
raise StatusException(response.status, msg) neo4jrestclient.request.StatusException: Error [400]: Bad Request. Bad
request syntax or unsupported method. Invalid data sent:
org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed: Script4.groovy: 94: unable to resolve class
org.neo4j.cypher.javacompat.CypherParser # line 94, column 1.
import org.neo4j.cypher.javacompat.CypherParser ^
1 error
My requirements.txt includes:
-e git://github.com/scholrly/neo4django.git#eefdf6a122fdbe26c62b6563f9ff6b30a4de2f93#egg=neo4django-dev
neo4jrestclient==1.7.0
Any help is greatly appreciated!
From what I can see, your installation is fine. The problem is the version of Neo4j.
So far, we only support Neo4j 1.6-1.8. While I try to support all major releases in use, I typically extend support for milestones closer to a general release. For example, I didn't extend support to Neo4j 1.8 until it hit milestone 6.
Is there a particular reason you're using 1.9M01, or would the most recent stable release (1.8GA) suffice?

Django-nonrel: Syntax to Reset an App

To reset my app, I ran this:
./manage.py reset node
It is giving me this error output:
WARNING:root:The rdbms API is not available because the MySQLdb library could not be loaded.
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_manager(settings)
File "/home/a/mywebsites/django/seperolinux/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/a/mywebsites/django/seperolinux/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/a/mywebsites/django/seperolinux/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/a/mywebsites/django/seperolinux/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/home/a/mywebsites/django/seperolinux/django/core/management/base.py", line 286, in handle
app_output = self.handle_app(app, **options)
File "/home/a/mywebsites/django/seperolinux/django/core/management/commands/reset.py", line 35, in handle_app
sql_list = sql_reset(app, self.style, connection)
File "/home/a/mywebsites/django/seperolinux/django/core/management/sql.py", line 107, in sql_reset
return sql_delete(app, style, connection) + sql_all(app, style, connection)
File "/home/a/mywebsites/django/seperolinux/django/core/management/sql.py", line 66, in sql_delete
table_names = connection.introspection.get_table_list(cursor)
AttributeError: 'DatabaseIntrospection' object has no attribute 'get_table_list'
How do I reset a Model in Django-nonrel?
./manage.py reset node
executes sqlreset to create DROPT TABLE and CREATE TABLE SQL
statements for the given app.
https://docs.djangoproject.com/en/1.3/ref/django-admin/#reset-appname-appname
This does not work with the App Engine Datastore, because the Datastore is schemaless so there is no need for CREATE/DROP table commands.
If you want to delete existing model from the datastore, you can use the App Engine Development Console to delete all entities of the model (just make sure you use the correct port when accessing the Development Console) .