Re: understanding urls, forms, and HTTP ERROR 405

2020-02-21 Thread onlinejudge95
On Fri, Feb 21, 2020 at 2:24 AM Phil Kauffman wrote: > So something like this? > Yes if you are using method based views. You can still do the same using class-based views by referring to the following https://stackoverflow.com/questions/15622354/django-listview-with-post-method > def

Re: understanding urls, forms, and HTTP ERROR 405

2020-02-20 Thread Phil Kauffman
So something like this? def site(request, site_id): site = get_object_or_404(Site.name, pk=site_id) def sitesubmit(request): #site=get_object_or_404(Site, pk=site_id) form = SelectSite() if request.method == 'POST': form = SelectSite(request.POST) if

Re: understanding urls, forms, and HTTP ERROR 405

2020-02-20 Thread onlinejudge95
On Thu, Feb 20, 2020 at 11:38 PM Phil Kauffman wrote: > Hello, > > Newbie in need of a little shove. It seems I need to review the purpose of > the urls.py file. At present I am getting an HTTP Error 405 with the > following: > HTTP 405 error code states the the HTTP method is not allowed on the

understanding urls, forms, and HTTP ERROR 405

2020-02-20 Thread Phil Kauffman
Hello, Newbie in need of a little shove. It seems I need to review the purpose of the urls.py file. At present I am getting an HTTP Error 405 with the following: urls.py: path('', views.show_site, name = 'home'), path('site-view', views.List.as_view(), name='site-view') views.py class