AssertionError: Negative indexing is not supported - django

When i open to click cms-pages , showing error..
File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/contrib/admin/options.py", line 307, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/utils/decorators.py", line 93, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/views/decorators/cache.py", line 79, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/contrib/admin/sites.py", line 197, in inner
return view(request, *args, **kwargs)
File "/home2/devnocco/virtual/lib/python2.6/site-packages/django_cms-2.2-py2.6.egg/cms/admin/pageadmin.py", line 657, in changelist_view
cl.set_items(request)
File "/home2/devnocco/virtual/lib/python2.6/site-packages/django_cms-2.2-py2.6.egg/cms/admin/change_list.py", line 198, in set_items
children[-1].last = False
File "/home2/devnocco/virtual/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/db/models/query.py", line 157, in __getitem__
"Negative indexing is not supported."
AssertionError: Negative indexing is not supported.

This will happen mostly when you are trying some indexing related operation on an empty list. Try this instead:
somelist=[]
last_element = somelist[len(somelist)-1]

It looks like you are coming across this issue in django-cms. It's been fixed now, so you could upgrade to the latest release, or manually apply the patch.
You might have to upgrade django-mptt to 0.5.2 at the same time.

Related

Wagtail / Django - Animated GIFs not working with many frames in the GIF

Issue Summary
Install Wagtail with all required dependencies. In order to use a GIF, WAND and imagemagick must be installed.
All steps have been implemented as specified in the documentation. (https://docs.wagtail.org/en/stable/advanced_topics/images/animated_gifs.html)
It seems like too much frames in the GIF will cause the error. I tried it with a GIF with less frames and it worked.
Unfortunately, the GIF handling with Wagtail currently does not work must be set more, which is not documented?
When uploading a GIF file I now get the following error message:
Error Message
2022-08-23 10:29:53,630 ERROR [django.request:241] log 73 140094513477440 Internal Server Error: /admin/images/multiple/add/
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.8/site-packages/django/views/decorators/cache.py", line 62, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/wagtail/admin/urls/__init__.py", line 161, in wrapper
return view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/wagtail/admin/auth.py", line 182, in decorated_view
response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", line 84, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/django/utils/decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/django/views/decorators/vary.py", line 21, in inner_func
response = func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/wagtail/admin/views/generic/multiple_upload.py", line 44, in dispatch
return super().dispatch(request)
File "/usr/local/lib/python3.8/site-packages/wagtail/admin/views/generic/permissions.py", line 36, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", line 119, in dispatch
return handler(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/wagtail/admin/views/generic/multiple_upload.py", line 144, in post
if form.is_valid():
File "/usr/local/lib/python3.8/site-packages/django/forms/forms.py", line 205, in is_valid
return self.is_bound and not self.errors
File "/usr/local/lib/python3.8/site-packages/django/forms/forms.py", line 200, in errors
self.full_clean()
File "/usr/local/lib/python3.8/site-packages/django/forms/forms.py", line 433, in full_clean
self._clean_fields()
File "/usr/local/lib/python3.8/site-packages/django/forms/forms.py", line 443, in _clean_fields
value = field.clean(value, bf.initial)
File "/usr/local/lib/python3.8/site-packages/django/forms/fields.py", line 670, in clean
return super().clean(data)
File "/usr/local/lib/python3.8/site-packages/django/forms/fields.py", line 198, in clean
value = self.to_python(value)
File "/usr/local/lib/python3.8/site-packages/wagtail/images/fields.py", line 122, in to_python
self.check_image_pixel_size(f)
File "/usr/local/lib/python3.8/site-packages/wagtail/images/fields.py", line 112, in check_image_pixel_size
self.error_messages["file_too_many_pixels"] % (num_pixels),
ValueError: unsupported format character ')' (0x29) at index 33
Steps to Reproduce
Install Wagtail with all the libraries in techincal details
I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: yes
Technical details
Django>=4.0,<4.1
wagtail>3
wagtail_localize==1.2.1
django-extensions==3.2.0
psycopg2==2.9.3
loglevel==0.1.2
Wand==0.6.10
Ubunutu Server: sudo apt-get install libmagickwand-dev
Local MacOS: brew install imagemagick
Thank you very much in advance.
I look forward to your feedback.
I found the problem: WAGTAILIMAGES_MAX_IMAGE_PIXELS = 128000000.
I had to set the WAGTAILIMAGES_MAX_IMAGE_PIXELS higher than the default.

TypeError at /oauth/complete/mediawiki/ when upgrading to social-auth-app-django 3.3.0

I'm running:
Python 3.7.3
Django 3.1.14
social-auth-app-django 3.1.0
When I try to upgrade social-auth-app-django to 3.3.0 or 3.4.0, I get:
Traceback (most recent call last):
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_django/utils.py", line 49, in wrapper
return func(request, backend, *args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_django/views.py", line 33, in complete
*args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_core/actions.py", line 45, in do_complete
user = backend.complete(user=user, *args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_core/backends/base.py", line 40, in complete
return self.auth_complete(*args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_core/utils.py", line 247, in wrapper
return func(*args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_core/backends/oauth.py", line 181, in auth_complete
return self.do_auth(access_token, *args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_core/utils.py", line 247, in wrapper
return func(*args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_core/backends/oauth.py", line 192, in do_auth
return self.strategy.authenticate(*args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_django/strategy.py", line 107, in authenticate
return authenticate(*args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/django/contrib/auth/__init__.py", line 73, in authenticate
user = backend.authenticate(request, **credentials)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_core/backends/base.py", line 80, in authenticate
return self.pipeline(pipeline, *args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_core/backends/base.py", line 83, in pipeline
out = self.run_pipeline(pipeline, pipeline_index, *args, **kwargs)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_core/backends/base.py", line 113, in run_pipeline
result = func(*args, **out) or {}
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/social_core/pipeline/user.py", line 119, in user_details
setattr(user, name, value)
File "/data/project/spi-tools-dev/www/python/venv/lib/python3.7/site-packages/django/db/models/fields/related_descriptors.py", line 547, in __set__
% self._get_set_deprecation_msg_params(),
Exception Type: TypeError at /oauth/complete/mediawiki/
Exception Value: Direct assignment to the forward side of a many-to-many set is prohibited. Use groups.set() instead.
when I try to authenticate. Any idea what's going on?
The TL;DR is to add
SOCIAL_AUTH_PROTECTED_USER_FIELDS = ['groups']
to settings.py. See here for the longer version.

Django ModelAdmin admin_order_field with nulls_last

I am trying to sort column of ModelAdmin list field with admin_order_field with nulls_last such as:
class UserProfileAdmin(admin.ModelAdmin):
def get_sum_amount(self, obj):
return obj.sum_amount
get_sum_amount.admin_order_field = F('sum_amount').desc(nulls_last=True)
But I am getting following error:
Traceback (most recent call last):
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/contrib/admin/options.py", line 606, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/utils/decorators.py", line 142, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/contrib/admin/sites.py", line 223, in inner
return view(request, *args, **kwargs)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/utils/decorators.py", line 45, in _wrapper
return bound_method(*args, **kwargs)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/utils/decorators.py", line 142, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/contrib/admin/options.py", line 1672, in changelist_view
cl = self.get_changelist_instance(request)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/contrib/admin/options.py", line 744, in get_changelist_instance
sortable_by,
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/contrib/admin/views/main.py", line 81, in __init__
self.queryset = self.get_queryset(request)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/contrib/admin/views/main.py", line 436, in get_queryset
qs = qs.order_by(*ordering)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/db/models/query.py", line 1074, in order_by
obj.query.add_ordering(*field_names)
File "/home/petr/.local/share/virtualenvs/aklub_project-HrPEZ5ak/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1804, in add_ordering
if not hasattr(item, 'resolve_expression') and not ORDER_PATTERN.match(item):
TypeError: expected string or bytes-like object
I am using Django 2.2. Is this issue in Django or am I doing something wrong?
This is now possible in Django starting with version 3.1.

openEdx server error on exchange_access_token with azuread-oauth2

I'm now working on deploying openEdx system and encounter an error while logging in via Azure AD from the mobile device.
The web Azure AD login is working fine and I can also get access_token from azure ad.
But, when I try to exchange azure token with openEdx token via /oauth2/exchange_access_token/azuread-oauth2/ url, I'm getting the following error due to the empty response.
AttributeError: 'NoneType' object has no attribute 'get'
Hence I'm fairly new to the openEdx, I have a hard time figuring out to fix the issue. Please help to direct me into the right path to fixing this issue. Following is the detail error log.
Thanks in advance
Apr 1 12:38:45 edxapp [service_variant=lms][django.request][env:sandbox] ERROR [edxapp 24509] [exception.py:135] - Internal Server Error: /oauth2/exchange_access_token/azuread-oauth2/
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
response = self._get_response(request)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 185, in inner
return func(*args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/oauth_dispatch/views.py", line 57, in dispatch
return view(request, *args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.__get__(self, type(self))(*args2, **kwargs2)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/social_django/utils.py", line 49, in wrapper
return func(request, backend, *args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.__get__(self, type(self))(*args2, **kwargs2)
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/auth_exchange/views.py", line 44, in dispatch
return super(AccessTokenExchangeBase, self).dispatch(*args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/views.py", line 489, in dispatch
response = self.handle_exception(exc)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/views.py", line 449, in handle_exception
self.raise_uncaught_exception(exc)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/rest_framework/views.py", line 486, in dispatch
response = handler(request, *args, **kwargs)
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/auth_exchange/views.py", line 57, in post
if not form.is_valid():
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/forms/forms.py", line 183, in is_valid
return self.is_bound and not self.errors
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/forms/forms.py", line 175, in errors
self.full_clean()
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/forms/forms.py", line 385, in full_clean
self._clean_form()
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/provider/forms.py", line 63, in _clean_form
super(OAuthForm, self)._clean_form()
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/forms/forms.py", line 412, in _clean_form
cleaned_data = self.clean()
File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/auth_exchange/forms.py", line 95, in clean
user = backend.do_auth(access_token, allow_inactive_user=True)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/social_core/utils.py", line 252, in wrapper
return func(*args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/social_core/backends/oauth.py", line 410, in do_auth
data = self.user_data(access_token, *args, **kwargs)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/social_core/backends/azuread.py", line 80, in user_data
id_token = response.get('id_token')
AttributeError: 'NoneType' object has no attribute 'get'
social-core is throwing the error because the response is NoneType. It makes sense that social-core is responsible here as you are aiming for 3rd party oAuth2.
If it works on web, then the None response is explainable only if the configuration is wrong.
Now, steps to troubleshoot:
Check edx.properties to ensure that the config directory is properly set.
Check your config and local yamls to ensure that oauth config is proper. [instead of simply configuring ios.yaml]
Make sure you followed additional instructions provided here.
If nothing else works, check the config for social-auth as stated here.
Hope that helps! Cheers!

DatabaseError: no such table

Going insane here.
So here it goes, the traceback:
Traceback (most recent call last):
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/contrib/admin/options.py", line 366, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/views/decorators/cache.py", line 89, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/contrib/admin/sites.py", line 196, in inner
return view(request, *args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/utils/decorators.py", line 25, in _wrapper
return bound_func(*args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/utils/decorators.py", line 21, in bound_func
return func(self, *args2, **kwargs2)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/transaction.py", line 224, in inner
return func(*args, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/contrib/admin/options.py", line 1274, in delete_view
[obj], opts, request.user, self.admin_site, using)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/contrib/admin/util.py", line 104, in get_deleted_objects
collector.collect(objs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/contrib/admin/util.py", line 155, in collect
return super(NestedObjects, self).collect(objs, source_attr=source_attr, **kwargs)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/deletion.py", line 175, in collect
if not sub_objs:
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/query.py", line 130, in __nonzero__
iter(self).next()
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/query.py", line 118, in _result_iter
self._fill_cache()
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/query.py", line 892, in _fill_cache
self._result_cache.append(self._iter.next())
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/var/www/phaethon/virtualenvs/my_random_website/lib/python2.6/site-packages/django/db/backends/sqlite3/base.py", line 344, in execute
return Database.Cursor.execute(self, query, params)
DatabaseError: no such table: orders_orderline
The strange thing is that this only get shown on admin view, ie:
http://www.myrandomsite.gr/admin/store/product/138/delete/
If I fire up the shell from ./manage.py shell I can call .delete() on the object just fine.
Another strange thing is, that it works fine on my local machine just fine. It only happens on the apache deployment. I have a couple of more websites that use the same stuff and work just fine.
I am mirroring apps, python version and db. I tried recreating everything, virtualenv, db, etc.
Tried ack'ing everywhere to see where that orders_orderline is defined. It's just another app in my project, that is not set in INSTALLED_APPS or anywhere. I only use it in a specific view (the model OrderLine) that is only imported if the app is installed.
edit: I sqlite3 mydb and I also can't find any reference to that table, 'cause it shouldn't exist in the first place, where is admin picking it up?
edit2: This only happens if I set DEBUG, TEMPLATE_DEBUG = FALSE