NoReverseMatch at /twitterprojects/datasets/

Multi tool use
up vote
0
down vote
favorite
I have the next url.py:
from django.urls import path
from . import views
from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from two_factor.urls import urlpatterns as tf_urls
urlpatterns = [
path('', views.index, name='index'),
url(r'', include(tf_urls)),
url(r'datasets/$', login_required(views.mostrar_Model_Dataset), name="mostrar_Model_Dataset"),
url(r'datasets/(d+)/$', login_required(views.mostrar_Model_Dataset), name="mostrar_Model_Dataset_i"),
]
And this view:
def mostrar_Model_Dataset(request, Model_Dataset_id=None):
conjuntos_datos = Model_Dataset.objects.all()
...
context = {"conjuntos_datos": conjuntos_datos,
"Dataset_id": Dataset_id,
"datos": paginated_data,
"fixed_pager": page_range,}
return render(request, 'datasets.html', context)
If I try to access to http://localhost/twitterprojects/datasets/1 or http://localhost/twitterprojects/datasets/20 or http://localhost/twitterprojects/datasets/256 this work fine, but when I try to access to http://localhost/twitterprojects/datasets/ (without argument) I receive the next message:
Exception Type: NoReverseMatch
Exception Value: Reverse for 'mostrar_Model_Dataset' with arguments '(1,)' not found. 1 pattern(s) tried: ['twitterprojects/datasets/$']
some idea?
django
add a comment |
up vote
0
down vote
favorite
I have the next url.py:
from django.urls import path
from . import views
from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from two_factor.urls import urlpatterns as tf_urls
urlpatterns = [
path('', views.index, name='index'),
url(r'', include(tf_urls)),
url(r'datasets/$', login_required(views.mostrar_Model_Dataset), name="mostrar_Model_Dataset"),
url(r'datasets/(d+)/$', login_required(views.mostrar_Model_Dataset), name="mostrar_Model_Dataset_i"),
]
And this view:
def mostrar_Model_Dataset(request, Model_Dataset_id=None):
conjuntos_datos = Model_Dataset.objects.all()
...
context = {"conjuntos_datos": conjuntos_datos,
"Dataset_id": Dataset_id,
"datos": paginated_data,
"fixed_pager": page_range,}
return render(request, 'datasets.html', context)
If I try to access to http://localhost/twitterprojects/datasets/1 or http://localhost/twitterprojects/datasets/20 or http://localhost/twitterprojects/datasets/256 this work fine, but when I try to access to http://localhost/twitterprojects/datasets/ (without argument) I receive the next message:
Exception Type: NoReverseMatch
Exception Value: Reverse for 'mostrar_Model_Dataset' with arguments '(1,)' not found. 1 pattern(s) tried: ['twitterprojects/datasets/$']
some idea?
django
Can you postdatasets.html
?
– Will Keeling
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have the next url.py:
from django.urls import path
from . import views
from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from two_factor.urls import urlpatterns as tf_urls
urlpatterns = [
path('', views.index, name='index'),
url(r'', include(tf_urls)),
url(r'datasets/$', login_required(views.mostrar_Model_Dataset), name="mostrar_Model_Dataset"),
url(r'datasets/(d+)/$', login_required(views.mostrar_Model_Dataset), name="mostrar_Model_Dataset_i"),
]
And this view:
def mostrar_Model_Dataset(request, Model_Dataset_id=None):
conjuntos_datos = Model_Dataset.objects.all()
...
context = {"conjuntos_datos": conjuntos_datos,
"Dataset_id": Dataset_id,
"datos": paginated_data,
"fixed_pager": page_range,}
return render(request, 'datasets.html', context)
If I try to access to http://localhost/twitterprojects/datasets/1 or http://localhost/twitterprojects/datasets/20 or http://localhost/twitterprojects/datasets/256 this work fine, but when I try to access to http://localhost/twitterprojects/datasets/ (without argument) I receive the next message:
Exception Type: NoReverseMatch
Exception Value: Reverse for 'mostrar_Model_Dataset' with arguments '(1,)' not found. 1 pattern(s) tried: ['twitterprojects/datasets/$']
some idea?
django
I have the next url.py:
from django.urls import path
from . import views
from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from two_factor.urls import urlpatterns as tf_urls
urlpatterns = [
path('', views.index, name='index'),
url(r'', include(tf_urls)),
url(r'datasets/$', login_required(views.mostrar_Model_Dataset), name="mostrar_Model_Dataset"),
url(r'datasets/(d+)/$', login_required(views.mostrar_Model_Dataset), name="mostrar_Model_Dataset_i"),
]
And this view:
def mostrar_Model_Dataset(request, Model_Dataset_id=None):
conjuntos_datos = Model_Dataset.objects.all()
...
context = {"conjuntos_datos": conjuntos_datos,
"Dataset_id": Dataset_id,
"datos": paginated_data,
"fixed_pager": page_range,}
return render(request, 'datasets.html', context)
If I try to access to http://localhost/twitterprojects/datasets/1 or http://localhost/twitterprojects/datasets/20 or http://localhost/twitterprojects/datasets/256 this work fine, but when I try to access to http://localhost/twitterprojects/datasets/ (without argument) I receive the next message:
Exception Type: NoReverseMatch
Exception Value: Reverse for 'mostrar_Model_Dataset' with arguments '(1,)' not found. 1 pattern(s) tried: ['twitterprojects/datasets/$']
some idea?
django
django
asked 2 days ago
Andrés Fernández
30117
30117
Can you postdatasets.html
?
– Will Keeling
yesterday
add a comment |
Can you postdatasets.html
?
– Will Keeling
yesterday
Can you post
datasets.html
?– Will Keeling
yesterday
Can you post
datasets.html
?– Will Keeling
yesterday
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238238%2fnoreversematch-at-twitterprojects-datasets%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
B66H,Q91OCpItHrXkN1B0TZJwmKRF
Can you post
datasets.html
?– Will Keeling
yesterday