NoReverseMatch error even though view and url path already existCheck if a given key already exists in a dictionaryGeneric Views NoReverseMatch when using % url % in DjangoCannot display HTML stringNoReverseMatch at Reverse for … with arguments '()' and keyword arguments '' not found. 0 pattern(s) tried: []NoReverseMatch at/ something wrong with url with slugWhat is a NoReverseMatch error, and how do I fix it?NoReverseMatch when trying to access view from templateNoReverseMatch Exception in Django template URL pathNoReverseMatch: Unable to pass parameter from template to view.NoReverseMatch with Django urls
Can inductive kick be discharged without freewheeling diode, in this example?
What should be done with the carbon when using magic to get oxygen from carbon dioxide?
What is the motivation behind designing a control stick that does not move?
Why don't 3D printer heads use ceramic inner walls?
Is Borg adaptation only temporary?
Should a TA point out a professor's mistake while attending their lecture?
Why doesn't Starship have four landing legs?
Why do presidential pardons exist in a country having a clear separation of powers?
“all of who” or “all of whom”?
Eliminate key lookup in execution plan
Why do IR remotes influence AM radios?
What is the following VRP?
'Horseshoes' for Deer?
Find the logic in first 2 statements to give the answer for the third statement
Small RAM 4 KB on the early Apple II?
Coupling two 15 Amp circuit breaker for 20 Amp
Stock Volatility with Uncertain Probability
Why haven't the British protested Brexit as ardently like Hong Kongers protest?
Sum and average calculator
What is the practical impact of using System.Random which is not cryptographically random?
What was Captain Marvel supposed to do once she reached her destination?
Can two aircraft be allowed to stay on the same runway at the same time?
Can I leave a large suitcase at TPE during a 4-hour layover, and pick it up 4.5 days later when I come back to TPE on my way to Taipei downtown?
Printing a list as "a, b, c." using Python
NoReverseMatch error even though view and url path already exist
Check if a given key already exists in a dictionaryGeneric Views NoReverseMatch when using % url % in DjangoCannot display HTML stringNoReverseMatch at Reverse for … with arguments '()' and keyword arguments '' not found. 0 pattern(s) tried: []NoReverseMatch at/ something wrong with url with slugWhat is a NoReverseMatch error, and how do I fix it?NoReverseMatch when trying to access view from templateNoReverseMatch Exception in Django template URL pathNoReverseMatch: Unable to pass parameter from template to view.NoReverseMatch with Django urls
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm still learning the ropes for programming with django and when I try to open up my website on localhost, I'm getting an error message that does not help to point me in the right direction.
This is the error message I'm getting from a file called base.html:
NoReverseMatch at /
Reverse for 'main-createchannel' not found. 'main-createchannel' is not a valid view function or pattern name.
the part of base.html that's calling the urls
<div class="collapse navbar-collapse" id="navbarToggle">
<div class="navbar-nav mr-auto">
<a class="nav-item nav-link" href="% url 'main:main-about' %">About</a>
<a class="nav-item nav-link" href="% url 'main:main-channelsettings' %">Channel Settings</a>
<a class="nav-item nav-link" href="% url 'main:main-channelinfo' %">Channel Information</a>
<a class="nav-item nav-link" href="% url 'main:main-createchannel' %">Create Channel</a>
<a class="nav-item nav-link" href="% url 'main:main-findchannel' %">Find Channel</a>
<a class="nav-item nav-link" href="% url 'main:main-ticketrequest' %">Submit a Ticket</a>
</div>
<!-- Navbar Right Side -->
<div class="navbar-nav">
<a class="nav-item nav-link" href="% url 'main:main-userprofile' %">Login</a>
<a class="nav-item nav-link" href="% url 'main:users-register' %">Register</a>
% if user.is_authenticated %
<a class="nav-item nav-link" href="% url 'main:main-userprofile' %">Profile</a>
% endif %
</div>
</div>
views.py
def createchannelpage(request):
if request.method == 'POST':
form = CreateChannelForm(request.POST)
if form.is_valid():
form.save()
channel_room_name = form.cleaned_data.get('channel_room_name')
#messages.success(request, f'channel_room_name was created!')
return redirect('/')
else:
form = CreateChannelForm()
return render(request, 'main/createChannel.html',
'form': form,
'title': "Create a Channel"
)
and finally, urls.py
from . import views
from users import views as users_views
app_name = 'main'
urlpatterns = [
path('', views.homepage, name='main-home'),
path('register/', users_views.register, name='users-register'),
path('about/', views.aboutpage, name='main-about'),
path('createchannel/', views.createchannelpage, name='main-createchannel'),
path('findchannel/', views.findchannelpage, name='main-findchannel'),
path('channelinfo/', views.channelinfopage, name='main-channelinfo'),
path('channelsettings/', views.channelsettingspage, name='main-channelsettings'),
path('userprofile/', views.userprofilepage, name='main-userprofile'),
path('ticketrequest',views.ticketrequestpage, name='main-ticketrequest'),
re_path(r'^(?P<channel_room_name>[^/]+)/$', views.channelinfopage, name='channel'),
]
When I tried calling the pages using % url views.createchannelpage %, that didn't work. But neither did calling the url by name, like % url 'main-createchannel' %.
I feel like I've tried everything that I can find online to help me out. Is it just something simple that I've missed somewhere? Thank you!
python django django-templates django-views django-urls
add a comment |
I'm still learning the ropes for programming with django and when I try to open up my website on localhost, I'm getting an error message that does not help to point me in the right direction.
This is the error message I'm getting from a file called base.html:
NoReverseMatch at /
Reverse for 'main-createchannel' not found. 'main-createchannel' is not a valid view function or pattern name.
the part of base.html that's calling the urls
<div class="collapse navbar-collapse" id="navbarToggle">
<div class="navbar-nav mr-auto">
<a class="nav-item nav-link" href="% url 'main:main-about' %">About</a>
<a class="nav-item nav-link" href="% url 'main:main-channelsettings' %">Channel Settings</a>
<a class="nav-item nav-link" href="% url 'main:main-channelinfo' %">Channel Information</a>
<a class="nav-item nav-link" href="% url 'main:main-createchannel' %">Create Channel</a>
<a class="nav-item nav-link" href="% url 'main:main-findchannel' %">Find Channel</a>
<a class="nav-item nav-link" href="% url 'main:main-ticketrequest' %">Submit a Ticket</a>
</div>
<!-- Navbar Right Side -->
<div class="navbar-nav">
<a class="nav-item nav-link" href="% url 'main:main-userprofile' %">Login</a>
<a class="nav-item nav-link" href="% url 'main:users-register' %">Register</a>
% if user.is_authenticated %
<a class="nav-item nav-link" href="% url 'main:main-userprofile' %">Profile</a>
% endif %
</div>
</div>
views.py
def createchannelpage(request):
if request.method == 'POST':
form = CreateChannelForm(request.POST)
if form.is_valid():
form.save()
channel_room_name = form.cleaned_data.get('channel_room_name')
#messages.success(request, f'channel_room_name was created!')
return redirect('/')
else:
form = CreateChannelForm()
return render(request, 'main/createChannel.html',
'form': form,
'title': "Create a Channel"
)
and finally, urls.py
from . import views
from users import views as users_views
app_name = 'main'
urlpatterns = [
path('', views.homepage, name='main-home'),
path('register/', users_views.register, name='users-register'),
path('about/', views.aboutpage, name='main-about'),
path('createchannel/', views.createchannelpage, name='main-createchannel'),
path('findchannel/', views.findchannelpage, name='main-findchannel'),
path('channelinfo/', views.channelinfopage, name='main-channelinfo'),
path('channelsettings/', views.channelsettingspage, name='main-channelsettings'),
path('userprofile/', views.userprofilepage, name='main-userprofile'),
path('ticketrequest',views.ticketrequestpage, name='main-ticketrequest'),
re_path(r'^(?P<channel_room_name>[^/]+)/$', views.channelinfopage, name='channel'),
]
When I tried calling the pages using % url views.createchannelpage %, that didn't work. But neither did calling the url by name, like % url 'main-createchannel' %.
I feel like I've tried everything that I can find online to help me out. Is it just something simple that I've missed somewhere? Thank you!
python django django-templates django-views django-urls
1
Does any url of the given urls in the list work, or is it just that one? If no-one works you might have not included them in your base URL:s.
– Johan
Mar 27 at 23:16
add a comment |
I'm still learning the ropes for programming with django and when I try to open up my website on localhost, I'm getting an error message that does not help to point me in the right direction.
This is the error message I'm getting from a file called base.html:
NoReverseMatch at /
Reverse for 'main-createchannel' not found. 'main-createchannel' is not a valid view function or pattern name.
the part of base.html that's calling the urls
<div class="collapse navbar-collapse" id="navbarToggle">
<div class="navbar-nav mr-auto">
<a class="nav-item nav-link" href="% url 'main:main-about' %">About</a>
<a class="nav-item nav-link" href="% url 'main:main-channelsettings' %">Channel Settings</a>
<a class="nav-item nav-link" href="% url 'main:main-channelinfo' %">Channel Information</a>
<a class="nav-item nav-link" href="% url 'main:main-createchannel' %">Create Channel</a>
<a class="nav-item nav-link" href="% url 'main:main-findchannel' %">Find Channel</a>
<a class="nav-item nav-link" href="% url 'main:main-ticketrequest' %">Submit a Ticket</a>
</div>
<!-- Navbar Right Side -->
<div class="navbar-nav">
<a class="nav-item nav-link" href="% url 'main:main-userprofile' %">Login</a>
<a class="nav-item nav-link" href="% url 'main:users-register' %">Register</a>
% if user.is_authenticated %
<a class="nav-item nav-link" href="% url 'main:main-userprofile' %">Profile</a>
% endif %
</div>
</div>
views.py
def createchannelpage(request):
if request.method == 'POST':
form = CreateChannelForm(request.POST)
if form.is_valid():
form.save()
channel_room_name = form.cleaned_data.get('channel_room_name')
#messages.success(request, f'channel_room_name was created!')
return redirect('/')
else:
form = CreateChannelForm()
return render(request, 'main/createChannel.html',
'form': form,
'title': "Create a Channel"
)
and finally, urls.py
from . import views
from users import views as users_views
app_name = 'main'
urlpatterns = [
path('', views.homepage, name='main-home'),
path('register/', users_views.register, name='users-register'),
path('about/', views.aboutpage, name='main-about'),
path('createchannel/', views.createchannelpage, name='main-createchannel'),
path('findchannel/', views.findchannelpage, name='main-findchannel'),
path('channelinfo/', views.channelinfopage, name='main-channelinfo'),
path('channelsettings/', views.channelsettingspage, name='main-channelsettings'),
path('userprofile/', views.userprofilepage, name='main-userprofile'),
path('ticketrequest',views.ticketrequestpage, name='main-ticketrequest'),
re_path(r'^(?P<channel_room_name>[^/]+)/$', views.channelinfopage, name='channel'),
]
When I tried calling the pages using % url views.createchannelpage %, that didn't work. But neither did calling the url by name, like % url 'main-createchannel' %.
I feel like I've tried everything that I can find online to help me out. Is it just something simple that I've missed somewhere? Thank you!
python django django-templates django-views django-urls
I'm still learning the ropes for programming with django and when I try to open up my website on localhost, I'm getting an error message that does not help to point me in the right direction.
This is the error message I'm getting from a file called base.html:
NoReverseMatch at /
Reverse for 'main-createchannel' not found. 'main-createchannel' is not a valid view function or pattern name.
the part of base.html that's calling the urls
<div class="collapse navbar-collapse" id="navbarToggle">
<div class="navbar-nav mr-auto">
<a class="nav-item nav-link" href="% url 'main:main-about' %">About</a>
<a class="nav-item nav-link" href="% url 'main:main-channelsettings' %">Channel Settings</a>
<a class="nav-item nav-link" href="% url 'main:main-channelinfo' %">Channel Information</a>
<a class="nav-item nav-link" href="% url 'main:main-createchannel' %">Create Channel</a>
<a class="nav-item nav-link" href="% url 'main:main-findchannel' %">Find Channel</a>
<a class="nav-item nav-link" href="% url 'main:main-ticketrequest' %">Submit a Ticket</a>
</div>
<!-- Navbar Right Side -->
<div class="navbar-nav">
<a class="nav-item nav-link" href="% url 'main:main-userprofile' %">Login</a>
<a class="nav-item nav-link" href="% url 'main:users-register' %">Register</a>
% if user.is_authenticated %
<a class="nav-item nav-link" href="% url 'main:main-userprofile' %">Profile</a>
% endif %
</div>
</div>
views.py
def createchannelpage(request):
if request.method == 'POST':
form = CreateChannelForm(request.POST)
if form.is_valid():
form.save()
channel_room_name = form.cleaned_data.get('channel_room_name')
#messages.success(request, f'channel_room_name was created!')
return redirect('/')
else:
form = CreateChannelForm()
return render(request, 'main/createChannel.html',
'form': form,
'title': "Create a Channel"
)
and finally, urls.py
from . import views
from users import views as users_views
app_name = 'main'
urlpatterns = [
path('', views.homepage, name='main-home'),
path('register/', users_views.register, name='users-register'),
path('about/', views.aboutpage, name='main-about'),
path('createchannel/', views.createchannelpage, name='main-createchannel'),
path('findchannel/', views.findchannelpage, name='main-findchannel'),
path('channelinfo/', views.channelinfopage, name='main-channelinfo'),
path('channelsettings/', views.channelsettingspage, name='main-channelsettings'),
path('userprofile/', views.userprofilepage, name='main-userprofile'),
path('ticketrequest',views.ticketrequestpage, name='main-ticketrequest'),
re_path(r'^(?P<channel_room_name>[^/]+)/$', views.channelinfopage, name='channel'),
]
When I tried calling the pages using % url views.createchannelpage %, that didn't work. But neither did calling the url by name, like % url 'main-createchannel' %.
I feel like I've tried everything that I can find online to help me out. Is it just something simple that I've missed somewhere? Thank you!
python django django-templates django-views django-urls
python django django-templates django-views django-urls
asked Mar 27 at 23:05
deancantsleepdeancantsleep
1
1
1
Does any url of the given urls in the list work, or is it just that one? If no-one works you might have not included them in your base URL:s.
– Johan
Mar 27 at 23:16
add a comment |
1
Does any url of the given urls in the list work, or is it just that one? If no-one works you might have not included them in your base URL:s.
– Johan
Mar 27 at 23:16
1
1
Does any url of the given urls in the list work, or is it just that one? If no-one works you might have not included them in your base URL:s.
– Johan
Mar 27 at 23:16
Does any url of the given urls in the list work, or is it just that one? If no-one works you might have not included them in your base URL:s.
– Johan
Mar 27 at 23:16
add a comment |
0
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',
autoActivateHeartbeat: false,
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
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387817%2fnoreversematch-error-even-though-view-and-url-path-already-exist%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387817%2fnoreversematch-error-even-though-view-and-url-path-already-exist%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Does any url of the given urls in the list work, or is it just that one? If no-one works you might have not included them in your base URL:s.
– Johan
Mar 27 at 23:16