To resolve this issue, you should check the place in your code where the URL reversal with the name 'add_time_slot' is happening with an empty argument (''). Ensure that the argument being passed to the URL reversing function isn’t empty and correctly matches the URL pattern specified in your URL configuration.
On Wed, Nov 1, 2023 at 5:41 PM Sudharsan <sudharsank...@gmail.com> wrote: > > i getting an error while doing python django project. i was tried many things > but nothing works. Please help me guys. > views.py > # view for adding Turf page > def add_Turf(request): > submitted = False > if request.method == "POST": > form = TurfForm(request.POST) > if form.is_valid(): > var = form.save(commit=False) > var.created_by = request.user > var.save() > messages.info(request, ' Your Turf has added successfully') > turf_id=var.id > return redirect('add_time_slot',turf_id=turf_id) > else: > form = TurfForm > if 'submitted' in request.GET: > submitted = True > return render(request, 'addvenue.html',{'form': form, 'submitted': submitted}) > > > # view for adding time slot > > def add_time_slot(request,turf_id): > turf = Venue.objects.get(pk=turf_id) > if request.method == 'POST': > form = TimeSlotForm(request.POST) > if form.is_valid(): > timeslot = form.save(commit=False) > timeslot.turf = turf # Set the Turf for this TimeSlot > timeslot.save() > return redirect('add_time_slot', turf_id=turf) > else: > form = TimeSlotForm() > return render(request, 'add_time_slot.html', {'form': form, 'turf': turf}) > > > > > > > > > > > > > > > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/439756cf-9e61-430f-8d28-c72afb9b4a49n%40googlegroups.com. -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJ8cwdvOOKKTg2d4K-wQ6g75oipRfby6waOPT6YdMSfwCbZehg%40mail.gmail.com.