jazzband / django-ddp

Django/PostgreSQL implementation of the Meteor server.
MIT License
167 stars 29 forks source link

Reduce not found in dddp/views.py #23

Closed Kannaj closed 8 years ago

Kannaj commented 8 years ago

I'm getting the below error

Environment:

Request Method: GET Request URL: http://localhost:8000/

Django Version: 1.8.5 Python Version: 3.4.3 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'dddp', 'todo.django_todos') Installed Middleware: ('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', 'django.middleware.security.SecurityMiddleware')

Traceback: File "/home/kj/.virtualenvs/django-ddp/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response

  1. response = wrapped_callback(request, _callback_args, *_callback_kwargs) File "/home/kj/.virtualenvs/django-ddp/lib/python3.4/site-packages/django/views/generic/base.py" in view
  2. self = cls(initkwargs) File "/home/kj/.virtualenvs/django-ddp/lib/python3.4/site-packages/dddp/views.py" in init**
  3. self.meteor_settings = reduce(

Exception Type: NameError at / Exception Value: name 'reduce' is not defined

Kannaj commented 8 years ago

I've used from functools import reduce to solve the error

There is another error after this -

AttributeError at /

'dict' object has no attribute 'iteritems'

nordbit commented 8 years ago

iteritems() was removed in python3

Package are not compatible with py3 for now

In dirty way - you can try change 'iteritems' to 'items'