Showing posts with label compatibility. Show all posts
Showing posts with label compatibility. Show all posts

Wednesday, January 13, 2016

Python 32bit or 64bit ?

Recently I moved my application from centOS 5 to centOS 7, which had 64bit python installed. It end up crashing my django application because some of the packages I was using were compiled in 32bit python and they weren't compatible.

First thing you need to check whether the python you are running is 32 bit or 64 bit. Here is the simple command to check it -

$ python
Python 2.7.5 (default, Nov 20 2015, 02:00:19) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
>>> print struct.calcsize("P") * 8
64

That means its 64bit!

Wednesday, January 6, 2016

Sentry - That page number is less than 1 [error]

While running sentry, when you click on your project, it throws Internal server error with some random code. If you look at the log, it shows something like following. Only thing stands out is "That page number is less than 1"  

  File "/home/User/.virtualenvs/sentry/lib/python2.7/site-packages/sentry-6.4.4-py2.7.egg/sentry/templatetags/sentry_helpers.py", line 217, in paginator
    result = paginate_func(request, queryset_or_list, per_page, endless=True)
  File "/home/User/.virtualenvs/sentry/lib/python2.7/site-packages/paging/helpers.py", line 24, in paginate
    'paginator': paginator.get_context(page),
  File "/home/User/.virtualenvs/sentry/lib/python2.7/site-packages/paging/paginators.py", line 96, in get_context
    'previous_page': paginator.previous_page_number(),
  File "/home/User/.virtualenvs/sentry/lib/python2.7/site-packages/Django-1.5.8-py2.7.egg/django/core/paginator.py", line 143, in previous_page_number
    return self.paginator.validate_number(self.number - 1)
  File "/home/User/.virtualenvs/sentry/lib/python2.7/site-packages/Django-1.5.8-py2.7.egg/django/core/paginator.py", line 30, in validate_number
    raise EmptyPage('That page number is less than 1')

EmptyPage: That page number is less than 1

This error is because of the django-paging version, you may have version lower than 0.2.5. you need >=0.2.5 

Run the following command -

pip install django-paging==0.2.5

And restart your sentry server (web).