Переделал немного исходный код, расширив модель пользователя с помощью userprofile. Скопировал html самой карты с гитхаба (в статику добавил leeflet), вместе с декоратором рендера в json. В view.py сделал вью карты (промежуточный вариант просто чтобы посмотреть будет ли работать):
@login_required
def user_map(request):
user = request.user
other_users = User.objects.all()
user.userprofile1 = UserProfile()
get_position = user.userprofile1.get_position()
if user.is_authenticated():
user_position = get_position
other_users = other_users.exclude(pk=user.pk)
else:
user_position = None
for us in other_users:
us.userprofile2 = UserProfile()
user_profiles = (u.userprofile2 for u in other_users)
other_positions = (u.get_position() for u in user_profiles)
other_positions = [p for p in other_positions if p]
args = {'username': auth.get_user(request).get_username(),
'user_position_json': json.dumps(user_position),
'other_positions_json': json.dumps(other_positions)}
return render('user.html', args, request)
Ошибка IOError at /user/
[Errno 22] Invalid argument: u"E:\PycharmProjects\project\templates\{'username': u'123', 'other_positions_json': '[]', 'user_position_json': 'null'}"
Подскажите что неправильно?
Updated 29 Oct. 2016, 19:08 by smc.