Hellow! I have simple code that works on localhost but not working on PythonAnywhere:
models.py (...part of file...)
class Category(MainClass):
class Meta():
db_table = 'category'
parentCategory = models.ForeignKey("Category", blank=True, null=True)
views.py (...part of file...)
args = dict()
all_categories = Category.objects.all()
def categories(request, cats=all_categories):
main_categories = list()
for cat in cats:
if not cat.parentCategory_id:
main_categories.append(cat)
args['main_categories'] = main_categories
else:
args['main_categories'] = cats
return render_to_response('categories.html', args, context_instance=RequestContext(request))
Idea is - to show categories without parentCategory property ( "main categories").
On my mac it filters by
if not cat.parentCategory_id:
On PythonAnywhere - not. Shows all categories... with parentCategory and without.
pip freeze on PythonAnywhere
Django==1.7.4
Pillow==2.7.0
django-admin-bootstrapped==2.3.2
django-appconf==0.6
django-bootstrap3==5.1.1
django-debug-toolbar==1.2.2
django-imagekit==3.2.5
django-simple-captcha==0.4.4
pilkit==1.1.12
six==1.9.0
sqlparse==0.1.14
pip freeze on local mac
Django==1.7.1
Pillow==2.6.1
django-admin-bootstrapped==2.3.1
django-appconf==0.6
django-bootstrap3==5.0.3
django-debug-toolbar==1.2.2
django-imagekit==3.2.5
django-simple-captcha==0.4.3
pilkit==1.1.12
pyserial==2.7
six==1.9.0
sqlparse==0.1.14
So, please, help me to understand the problem.