app_name = 'profs'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^contact/', views.contact, name='contact'),
url(r'^check_login/', views.check_login, name='check_login'),
url(r'^(?P<url_name_para>[a-zA-Z]+)/edit_news/$', views.edit_news, name='edit_news'),
url(r'^(?P<url_name_para>[a-zA-Z]+)/$', views.show, name='show'),
]urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('profs.urls')),
]def check_login(request):
if request.method == 'POST':
if request.POST.get('username') != '' and request.POST.get('password') != '' and request.POST.get('password') != 'free':
prof = get_object_or_404(Professional, url_name=request.POST.get('username'))
if prof.subscription == request.POST.get('password'):
return redirect('edit_news', url_name_para = request.POST.get('username'))
#return render(request, 'profs/edit_news.html', {'prof': prof})
else:
return render(request, 'profs/test.html', {'val': 1})
else:
return render(request, 'profs/test.html', {'val': 2})
else:
return render(request, 'profs/test.html', {'val': 3})
def edit_news(request, url_name_para): if request.method == 'POST': Professional.objects.filter(url_name=request.POST.get('url_name')).update(update_news=request.POST.get('editor1')) return render(request, 'profs/index.html')
prof = get_object_or_404(Professional, url_name=url_name_para) return render(request, 'profs/edit_news.html', {'prof': prof})NoReverseMatch at /dtsik/edit_news/
Reverse for 'edit_news' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: ['(?P<url_name_para>[a-zA-Z]+)/edit_news/$']
NoReverseMatch at /check_login/
Reverse for 'edit_news' with arguments '()' and keyword arguments '{'url_name_para': 'dtsik'}' not found. 0 pattern(s) tried: []
What is the problem? Though is something with url pattern but cant figure it out
Also please add your templates. Looks like you are using URLs in the templates
> email to django-users+unsubscribe@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/061336d6-7ff2-4cc1-bad5-907fe3b5a988%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Cordialement, Coues Ludovic
+336 148 743 42
--
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+unsubscribe@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/CAEuG%2BTbCG1h7qWKat6vj%2BVo3d6SQo%3DfWU9%2Bp5c%3DkgtgVzbN3YA%40mail.gmail.com.