python-social-auth getting nothing but 400 Client Error: Bad Request - django

I've been trying to get python-social-auth working and all I ever get is the error Client Error: Bad Request which totally doesn't help me debug the situation. In my research, I've come across some mention of a bug here but there are no real indications of how to resolve it. This question addresses it too, but again, points to the same GitHub thread with no real resolutions.
I can't seem to figure out what is going on. It seems that it's trying to complete the authentication process, but is failing at /complete/facebook/. Here's the trace:
Environment:
Request Method: GET
Request URL: http://23.239.3.97:8000/complete/facebook/?redirect_state=big_long_string_of_letters_and_numbers_i_removed_for_security
Django Version: 1.6.1
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'ms',
'users',
'south',
'social.apps.django_app.default')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
112. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.7/dist-packages/django/views/decorators/csrf.py" in wrapped_view
57. return view_func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/apps/django_app/utils.py" in wrapper
52. return func(request, backend, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/apps/django_app/views.py" in complete
20. redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/actions.py" in do_complete
43. user = backend.complete(user=user, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/backends/base.py" in complete
40. return self.auth_complete(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/social/backends/facebook.py" in auth_complete
69. 'code': self.data['code']
File "/usr/local/lib/python2.7/dist-packages/social/backends/base.py" in get_querystring
229. return parse_qs(self.request(url, *args, **kwargs).text)
File "/usr/local/lib/python2.7/dist-packages/social/backends/base.py" in request
222. response.raise_for_status()
File "/usr/lib/python2.7/dist-packages/requests/models.py" in raise_for_status
773. raise HTTPError(http_error_msg, response=self)
Exception Type: HTTPError at /complete/facebook/
Exception Value: 400 Client Error: Bad Request
Here's the relevant settings.py info:
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
TEMPLATE_CONTEXT_PROCESSORS += (
'social.apps.django_app.context_processors.backends',
'social.apps.django_app.context_processors.login_redirect',
)
AUTHENTICATION_BACKENDS = (
'social.backends.facebook.FacebookOAuth2',
'django.contrib.auth.backends.ModelBackend',
)
SOCIAL_AUTH_FACEBOOK_KEY = '***' #replaced actual with *** for security
SOCIAL_AUTH_FACEBOOK_SECRET = '***' #replaced actual with *** for security
SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL = True
LOGIN_REDIRECT_URL = '/'
SOCIAL_AUTH_LOGIN_URL = '/login/'
SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/logged-in/'
SOCIAL_AUTH_LOGIN_ERROR_URL = '/login-error/'
SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']
SOCIAL_AUTH_URL_NAMESPACE = 'social'
SOCIAL_AUTH_ADMIN_USER_SEARCH_FIELDS = ['username', 'email']
SOCIAL_AUTH_AUTHENTICATION_BACKENDS = (
'social.backends.facebook',
)
SOUTH_MIGRATION_MODULES = {
'default': 'social.apps.django_app.default.south_migrations',
}
The django dev server is returning a 500 error code, so it's something internal I'm guessing. I'm pulling my hair out on this one! Any ideas?

I had a similar error when I failed to set the correct callback URL in the app settings in facebook. You have to indicate "http://www.yourdomain.com/login/facebook" callback url in the advanced settings of the app. Hope this helps.

Related

How to fix social_core.exceptions.AuthMissingParameter error

I am trying to implement a google login onto my project. I already had a relatively working login scheme when I tried to use social_core's oauth with google to log in with a google account. It keeps throwing a social_core.exceptions.AuthMissingParameter error, meaning that somehow, the state isn't being passed at all.
I have been following the walkthrough done here https://fosstack.com/how-to-add-google-authentication-in-django/ as a baseline for how to implement this. When I run the code from this tutorial (besides some basic syntax and version errors), everything runs like a charm. However, when I try to implement it on my project, an error I cannot resolve occurs.
The url.py file I have, I have only imported some files and added the line
path('auth/', include('social_django.urls', namespace='social')),
Other, than that, most of my test code is similar to the blog: like this in my common file.
AUTHENTICATION_BACKENDS = (
'social_core.backends.open_id.OpenIdAuth', # for Google authentication
'social_core.backends.google.GoogleOpenId', # for Google authentication
'social_core.backends.google.GoogleOAuth2', # for Google authentication
'django.contrib.auth.backends.ModelBackend',
)
How the current situation is, is that I can click login, it takes me to a login page where I type in my google account, and then it throws the following exception:
Environment:
Request Method: GET
Request URL: http://localhost:3000/auth/complete/google-oauth2/
Django Version: 2.1.7
Python Version: 3.6.5
Installed Applications:
[##Some personal files###
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'markdownx',
'social_django',
'livereload']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\django\core\handlers\exception.py" in inner
34. response = get_response(request)
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\django\core\handlers\base.py" in _get_response
126. response = self.process_exception_by_middleware(e, request)
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\django\core\handlers\base.py" in _get_response
124. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\django\views\decorators\cache.py" in _wrapped_view_func
44. response = view_func(request, *args, **kwargs)
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\django\views\decorators\csrf.py" in wrapped_view
54. return view_func(*args, **kwargs)
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\social_django\utils.py" in wrapper
49. return func(request, backend, *args, **kwargs)
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\social_django\views.py" in complete
33. *args, **kwargs)
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\social_core\actions.py" in do_complete
43. user = backend.complete(user=user, *args, **kwargs)
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\social_core\backends\base.py" in complete
40. return self.auth_complete(*args, **kwargs)
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\social_core\utils.py" in wrapper
259. return func(*args, **kwargs)
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\social_core\backends\oauth.py" in auth_complete
388. state = self.validate_state()
File "C:\Users\Daniel\.virtualenvs\project-djMFGD5K\lib\site-packages\social_core\backends\oauth.py" in validate_state
88. raise AuthMissingParameter(self, 'state')
Exception Type: AuthMissingParameter at /auth/complete/google-oauth2/
Exception Value: Missing needed parameter state
Where I have edited out some of the more personal information, but those files aren't being used currently. I am pretty sure I have my keys done correctly, because the parameters are correct when I print them in the terminal after I run the server, and for the fact that google manages to send me the redirect at all.
Edit: Pretty sure the keys are correct, since when I remove them or type them incorrectly, I get a server not found error rather than a missing parameter error.

Django-notification invalid literal for int() with base 10

I'm using django-notification to create notifications. based on it's documention I putted:
url(r'^inbox/notifications/', include(notifications.urls, namespace='notifications')),
in my urls.py. I generate a notification for test by using this in my views.py:
guy = User.objects.get(username = 'SirSaleh')
notify.send(sender=User, recipient=guy, verb='you visted the site!')
and I can easily get the number of unread notification in this url:
http://127.0.0.1:8000/inbox/notifications/api/unread_count/
it return {"unread_count": 1} as I want. but with /api/unread_list/ I can not to get the list of notifications and I get this error:
ValueError at /inbox/notifications/
invalid literal for int() with base 10: '<property object at 0x7fe1b56b6e08>'
As I beginner in using django-notifications any help will be appreciated.
Full TraceBack
Environment:
Request Method: GET Request URL:
http://127.0.0.1:8000/inbox/notifications/api/unread_list/
Django Version: 2.0.2 Python Version: 3.5.2 Installed Applications:
['django.contrib.admin', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.staticfiles',
'django.contrib.sites', 'django.forms', 'rest_framework',
'allauth', 'allauth.account', 'allauth.socialaccount', 'guardian',
'axes', 'django_otp', 'django_otp.plugins.otp_static',
'django_otp.plugins.otp_totp', 'two_factor', 'invitations',
'avatar', 'imagekit', 'import_export', 'djmoney', 'captcha',
'dal', 'dal_select2', 'widget_tweaks', 'braces', 'django_tables2',
'phonenumber_field', 'hitcount', 'el_pagination',
'maintenance_mode', 'notifications', 'mathfilters',
'myproject_web', 'Order', 'PhotoGallery', 'Search', 'Social',
'UserAccount', 'UserAuthentication', 'UserAuthorization',
'UserProfile'] Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django_otp.middleware.OTPMiddleware',
'maintenance_mode.middleware.MaintenanceModeMiddleware']
Traceback:
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/core/handlers/exception.py"
in inner
35. response = get_response(request)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/core/handlers/base.py"
in _get_response
128. response = self.process_exception_by_middleware(e, request)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/core/handlers/base.py"
in _get_response
126. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/notifications/views.py"
in live_unread_notification_list
164. if n.actor:
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/contrib/contenttypes/fields.py"
in get
253. rel_obj = ct.get_object_for_this_type(pk=pk_val)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/contrib/contenttypes/models.py"
in get_object_for_this_type
169. return self.model_class()._base_manager.using(self._state.db).get(**kwargs)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/db/models/query.py"
in get
394. clone = self.filter(*args, **kwargs)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/db/models/query.py"
in filter
836. return self._filter_or_exclude(False, *args, **kwargs)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/db/models/query.py"
in _filter_or_exclude
854. clone.query.add_q(Q(*args, **kwargs))
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/db/models/sql/query.py"
in add_q
1253. clause, _ = self._add_q(q_object, self.used_aliases)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/db/models/sql/query.py"
in _add_q
1277. split_subq=split_subq,
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/db/models/sql/query.py"
in build_filter
1215. condition = self.build_lookup(lookups, col, value)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/db/models/sql/query.py"
in build_lookup
1085. lookup = lookup_class(lhs, rhs)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/db/models/lookups.py"
in init
18. self.rhs = self.get_prep_lookup()
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/db/models/lookups.py"
in get_prep_lookup
68. return self.lhs.output_field.get_prep_value(self.rhs)
File
"/home/saleh/Projects/myproject_web/lib/python3.5/site-packages/django/db/models/fields/init.py"
in get_prep_value
947. return int(value)
Exception Type: ValueError at /inbox/notifications/api/unread_list/
Exception Value: invalid literal for int() with base 10: ''
The actor_object_id needs to be a CharField to support UUID based primary keys.
oops! It was my mistake.
I Finally find out what was the problem. actor_object_id was the field of notifications_notification table, which User.objects.get(username = 'SirSaleh') saved in it. It should be Interger (user_id of actor).
So I dropped previous table changed instance to User.objects.get(username = 'SirSaleh') to User ID. Problem solved.
So Why type of actor_object_id is CharField (varchar)? (at least I don't know) ;))
This is old, but I happen to know the answer.
In your code, you wrote:
guy = User.objects.get(username = 'SirSaleh')
notify.send(sender=User, recipient=guy, verb='you visted the site!')
You express that you want guy to be your sender However, in notify.send, you marked the sender as a generic User object, not guy.
So, change your code to:
guy = User.objects.get(username = 'SirSaleh')
notify.send(sender=guy, recipient=guy, verb='you visted the site!')
Notifications will take the user object guy, extrapolate the ID and store it in the database accordingly.

'str' object is not callable - SuccessMessageMixin

I get this error in a project whith SuccessMessageMixin and and not know why. This is my code in view.py.
from django.contrib.messages.views import SuccessMessageMixin
from django.views.generic import CreateView
class CampanaNueva(SuccessMessageMixin, CreateView):
model = Campana
template_name = "licencias_campana_nueva.html"
fields = ['temporada', 'descripcion']
success_message = "a"
And Raise this error on save:
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/licencias/editar/1
Django Version: 1.9.4
Python Version: 3.4.4
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'bootstrap3',
'home',
'widget_tweaks',
'socios',
'equipaciones',
'licencias']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cc_corbelo.middleware.LoginRequiredMiddleware']
Traceback:
File "C:\Python34\lib\site-packages\django\core\handlers\base.py" in get_response
149. response = self.process_exception_by_middleware(e, request)
File "C:\Python34\lib\site-packages\django\core\handlers\base.py" in get_response
147. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Python34\lib\site-packages\django\views\generic\base.py" in view
68. return self.dispatch(request, *args, **kwargs)
File "C:\Python34\lib\site-packages\django\views\generic\base.py" in dispatch
88. return handler(request, *args, **kwargs)
File "C:\Python34\lib\site-packages\django\views\generic\edit.py" in post
279. return super(BaseUpdateView, self).post(request, *args, **kwargs)
File "C:\Python34\lib\site-packages\django\views\generic\edit.py" in post
222. return self.form_valid(form)
File "C:\Python34\lib\site-packages\django\contrib\messages\views.py" in form_valid
14. messages.success(self.request, success_message)
Exception Type: TypeError at /licencias/editar/1
Exception Value: 'str' object is not callable
I have this function working in another project without problems...
I got exactly this same message when I accidentally used the messages framework incorrectly in the form_valid method of a completely different view in my project.
The correct code should have been:
messages.success(request, "Deactivated product")
But what I had written instead was
messages.success = "Deactivated product"
This code doesn't work, but it doesn't cause an error on the page, either! However, as soon as I submitted a different form that used the SuccessMessageMixin, I would see the 'str' object is not callable error.
(Having a problem on one page cause an error on a completely different page was fun to debug.)

Django says OverflowError at /admin/ while trying to access /admin/

I noticed this error while trying to access /admin/. Whenever /admin/model_name or /admin/ or /admin/* is accessed django says OverflowError at /admin/ and regular expression code size limit exceeded. I did a little digging and came across this SO post. I have checked urls.py of app since regex are mostly used in urls. But all I have is a typical admin url, nothing complex.
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
....
]
Stack trace
Environment:
Request Method: GET
Request URL: http://domain/admin/
Django Version: 1.9.8
Python Version: 2.7.6
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'haystack',
'myapp.apps.core',
'myapp.apps.home',
'myapp.apps.accounts',
'myapp.apps.dashboard',
'myapp.apps.app1',
'myapp.apps.app3',
'myapp.apps.app5',
'myapp.apps.app6',
'myapp.apps.app7',
'myapp.apps.app8',
'myapp.apps.app9']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
149. response = self.process_exception_by_middleware(e, request)
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
147. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/contrib/admin/sites.py" in wrapper
265. return self.admin_view(view, cacheable)(*args, **kwargs)
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
149. response = view_func(request, *args, **kwargs)
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
244. return view(request, *args, **kwargs)>
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)>
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/contrib/admin/sites.py" in index
505. app_list = self.get_app_list(request)>
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/contrib/admin/sites.py" in get_app_list
488. app_dict = self._build_app_dict(request)>
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/contrib/admin/sites.py" in _build_app_dict
473. current_app=self.name,
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse
600. return force_text(iri_to_uri(resolver._revers>e_with_prefix(view, prefix, *args, **kwargs)))
File "/home/tuxbox/.virtualenvs/dekkho-qa/lib/python2.7/site-packages/django/core/urlresolvers.py" in _reverse_with_prefix>
488. if re.search('^%s%s' % (re.escape(_prefix), pattern), candidate_pat % candidate_subs, re.UNICODE):
File "/usr/lib/python2.7/re.py" in search>
142. return _compile(pattern, flags).search(string)
File "/usr/lib/python2.7/re.py" in _compile>
242. p = sre_compile.compile(pattern, flags)
File "/usr/lib/python2.7/sre_compile.py" in compile
521. groupindex, indexgroup
Exception Type: OverflowError at /admin/
Exception Value: regular expression code size limit exceeded
We are using django+apache.
Any help is much appreciated.
TIA
I have managed to solve this by restarting apache2 with
sudo service apache2 restart.
Of course, I have inspected apache2 error log with
sudo tail-f /var/logs/apache2/error.log
But that gave me same output as stack trace. Aforementioned is a work around for this issue. I am not marking this question as solved since real issue have not been found yet.
Thanks.

Django index error

Yesterday it worked fine when I ran the server but today I am getting this:
****Environment:
Request Method: GET
Request URL: http://192.168.2.206:8080/home/
Django Version: 1.1.1
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.markup',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.comments',
'mysite.registration',
'mysite.profiles',
'mysite.epw',
'mysite.remember_me',
'mysite.avatar',
'mysite.django_documents',
'mysite.inlines',
'mysite.blog',
'mysite.forum',
'tagging']
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'mysite.remember_me.views.AutoLogout')
Traceback:
File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in get_response
92. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/pymodules/python2.6/django/views/decorators/cache.py" in _wrapped_view_func
44. response = view_func(request, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/django/utils/decorators.py" in _wrapped_view
48. response = view_func(request, *args, **kwargs)
File "/home/karthik/Desktop/EPW_LOCAL/mysite/../mysite/remember_me/views.py" in remember_me_login
81. result_of_update, result_of_category, result_of_cover, result_of_latest, result_of_block, result_of_footer, result_of_research = common_blocks()
File "/home/karthik/Desktop/EPW_LOCAL/mysite/../mysite/epw/views.py" in common_blocks
332. result_of_update = display_updated_date()
File "/home/karthik/Desktop/EPW_LOCAL/mysite/../mysite/epw/views.py" in display_updated_date
1357. updated_obj = pdf_database.objects.filter(updated_date__gte = previous_datetime, updated_date__lte = cur_datetime).order_by("-updated_date")[0]
File "/usr/lib/pymodules/python2.6/django/db/models/query.py" in __getitem__
159. return list(qs)[0]
**Exception Type: IndexError at /home/
Exception Value: list index out of range******
Your queryset has 0 results. specifically this one:
updated_obj = pdf_database.objects.filter(updated_date__gte = previous_datetime, updated_date__lte = cur_datetime).order_by("-updated_date")
yesterday its working fine when run server today i am getting like this
Add a new pdf_database object from the admin or console and this view should be back running fine like yesterday