Here's the Django view:
def get_date(request):
    if request.method == 'POST':
        form = DateForm(request.POST)
        if form.is_valid():
            date = form.cleaned_data['date']
            print(type(date))
            return HttpResponseRedirect('schedule/{date}')

    else:
        form = DateForm()

    return render(request, 'app/date.html', {'form': form})

Here is the urls.py file:
from django.urls import path
from . import views

urlpatterns = [
    path('', views.get_date),
    path('schedule/<int: date>', views.get_slot),
]


*I want to hit the date URL via the get_date view. But this results in 
error.*

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/2688eaf4-cf47-4cf8-8330-0ec2d032bd52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to