help

35 views
Skip to first unread message

Tosin Ayoola

unread,
Dec 10, 2018, 1:20:05 PM12/10/18
to django...@googlegroups.com
good day developers i'm working on a to do list app but and i'm getting this error, hoping anyone can help me out below is my views, url and  error im getting

def dailyactivities(request):
  tasks = DailyTaskForm(request.method == 'POST' or None)
  if request.method == 'POST' and tasks.is_valid()\
    and tasks.cleaned_data():
      tasks.save()
      return render(request, '')

  return redirect(render('dailychoresform.html'))

urlpatterns = [
  path('', views.index, name = 'index'),
  path('dailytask',views.dailyactivities, name = 'dailyactivities'),

]

Screenshot from 2018-12-10 14-18-49.png

Jason

unread,
Dec 10, 2018, 1:33:26 PM12/10/18
to Django users
that is an invalid URL you have in the browser address bar.  you don't need the curly braces or dict format.

Tosin Ayoola

unread,
Dec 11, 2018, 2:25:55 PM12/11/18
to django...@googlegroups.com
getting this error when i click on a new link i just added please can anyone help out below is my codes, views, url


##url
from django.urls import path
from . import views


urlpatterns = [
path('', views.index, name = 'index'),
path('dailytask', views.dailyactivities, name = 'dailyactivities'),

]

## views 

from django.shortcuts import render, redirect
from . import models
from . forms import DailyTaskForm
def index(request):
return render(request, 'index.html')


def dailyactivities(request):
tasks = DailyTaskForm(request.method == 'POST' or None)
if request.method == 'POST' and tasks.is_valid()\
and tasks.cleaned_data():
tasks.save()
      return render(request, 'index')

return redirect(request, 'dailychoresform.html')


Screenshot from 2018-12-11 15-16-57.png
Screenshot from 2018-12-11 15-23-59.png
Screenshot from 2018-12-11 15-24-14.png

Yarving Liu

unread,
Dec 11, 2018, 2:40:32 PM12/11/18
to django...@googlegroups.com
Please show me the content of personal/urls.py?

Need to check content there.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHLKn70uUYa4j5Bd-6fv8UeuitLx0W4JefAi7Hid84%2BP1SzMLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Harryxon Ndegwa

unread,
Dec 11, 2018, 5:26:12 PM12/11/18
to django...@googlegroups.com
add a slash after the dailytask ie 'dailytask/' in your url

#%£&

shiva kumar

unread,
Dec 20, 2018, 2:55:23 AM12/20/18
to django...@googlegroups.com
Once post ur forms.py file. Check views and url files. There are errrors

Reply all
Reply to author
Forward
0 new messages