{% extends "base/header.html" %}
{% block content %}
<div class="login">
<h1>Enter Youtube-Link</h1>
<form action=" {% url 'links.views.save_ytlink' %} " method="post">
────mysite ├───links │ ├───templates │ │ └───home.html │ ├───urls.py │ └───views.py └───mainapp ├───templates │ ├───base │ │ └───header.html │ ├───links │ └───register ├───────urls.py └───────views.pyurlpatterns = [
url(r'^', include('links.urls', namespace='ytlinks'), name='index'),
url(r'^admin/', admin.site.urls),
url(r'^register', include('register.urls'), name='register'),
url(r'^ytlinks/', include('links.urls', namespace='ytlinks')),
]
urlpatterns = [
url(r'^save_ytlink', views.save_ytlink, name='save_ytlink'),
url(r'^list$', views.ytlinks_list, name='ytlinks_list'),
url(r'^', views.ytlinks, name='ytlinks'),
]
def save_ytlink(request):
msg = ""
msg_status = "" # possible: 'success', 'info', 'danger', 'warning'
# Check if user came here by form
if request.method == 'GET':
return render(request, 'home.html')
ytlink = request.POST['ytlink']
allow_save = True
# Validation
# ...
return render(request, 'home.html', {'queryset':'', 'msg':msg, 'msg_status':msg_status})
<form action=" {% url 'links.views.save_ytlink' %} " method="post">
<form action=" {% url 'save_ytlink' %} " method="post">
<form action=" {% url save_ytlink %} " method="post">
<form action=" {% url "links.views.save_ytlink" %} " method="post">
<form action=" {% url myapp:save_ytlink %} " method="post">
(and much more)
In your urls.py, you have the url name as “ytlinks” with an s. But your url tag doesn’t have the s.
Try this:
{% url ‘ytlinks.ytlinks’ %}
--
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/8c09cef7-1ee3-4f38-9776-601998692621%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.