Commits

Michele Orrù committed 8559006 Merge

merge

Comments (0)

Files changed (3)

seedswap/seed/views.py

     return render_to_response('about.html', {'logged' : request.user.is_authenticated()})
 
 def register(request):
+    if request.method == 'POST':
+            return HttpResponse('User added!')
+
     return render_to_response('register.html', {'logged' : request.user.is_authenticated()})
 
-def add_user(request):
-    if request.method == 'POST':
-        form = UserForm(request.POST)
-        if form.is_valid():
-            form.save()
-
-    return HttpResponse('User added!')
-
 def search(request):
     all_seeds = Seed.objects.all()
     return render_to_response('search.html', {'data' : all_seeds})

seedswap/settings.py_template

 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
-    'django.middleware.csrf.CsrfViewMiddleware',
+#    'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
 )
         url(r'^seed/search$', 'search'),
         url(r'^contacts$', 'contacts'),
         url(r'^about$', 'about'),
-        url(r'^user/sign_up$', 'register'),
-        url(r'^user/add$', 'add_user'),
+        url(r'^user/signup$', 'register'),
         url(r'^$', 'index'),
         url(r'^seed/(?P<seed_id>\d{10})$', 'view'),
         url(r'^user/dashboard$', 'dashboard'),