выплевует ошибку при попытке зайти на http://127.0.0.1:8000/
Exception Type: ViewDoesNotExistпосле обновления страницы - другая ошибка и на этом все:
Exception Value: Tried save_point in module geo.world.views. Error was: ‘module’ object has no attribute ‘save_point’
Exception Location: /home/max/python/geos/parts/instance/django/core/urlresolvers.py in _get_callback, line 135
Exception Type: TypeErrorviews.py
Exception Value: ‘str’ object is not callable
Exception Location: /home/max/python/geos/parts/instance/django/core/handlers/base.py in get_response, line 100
from django.shortcuts import render_to_response
from django.template.loader import render_to_string
from django.http import HttpResponse
from django.template import RequestContext
from uni_form.helpers import FormHelper, Submit, Reset
from uni_form.helpers import Layout, Fieldset, Row, HTML
from geo.world.forms import MyForm
from world.models import World
import simplejson
def index(request):
form = MyForm()
waypoints = World.objects.order_by('name')
#form.helper.
response_dictionary = {
'form':form,
'waypoints': waypoints,
'content': render_to_string('waypoints.html', {'waypoints': waypoints}),
}
return render_to_response('index.html', response_dictionary)
def save_point(request):
"""Save waypoints"""
if request.method == 'POST':
for waypointString in request.POST.get('waypointsPayload', '').splitlines():
waypointID, waypointX, waypointY = waypointString.split()
waypoint = World.objects.get(id=int(waypointID))
waypoint.geometry.set_x(float(waypointX))
waypoint.geometry.set_y(float(waypointY))
waypoint.save()
return HttpResponse(simplejson.dumps(dict(isOk=1)), mimetype='application/json')
from django.conf.urls.defaults import *
urlpatterns = patterns('geo.world.views',
url(r'^$', 'index', name='index_page'),
url(r'^save/$', 'save_point', name='waypoints_save'),
)
url(r'^save/$', 'save_point', name='waypoints_save'),