NoReverseMatch at /twitterprojects/datasets/









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?










share|improve this question





















  • Can you post datasets.html?
    – Will Keeling
    2 days ago














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?










share|improve this question





















  • Can you post datasets.html?
    – Will Keeling
    2 days ago












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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 10:56









Andrés Fernández

30117




30117











  • Can you post datasets.html?
    – Will Keeling
    2 days ago
















  • Can you post datasets.html?
    – Will Keeling
    2 days ago















Can you post datasets.html?
– Will Keeling
2 days ago




Can you post datasets.html?
– Will Keeling
2 days ago

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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














































































這個網誌中的熱門文章

What does pagestruct do in Eviews?

Dutch intervention in Lombok and Karangasem

Channel Islands