Questions tagged [url-pattern]

The URL-pattern element of servlet-mapping or filter-mapping associates a filter or servlet with a set of URLs. When using this tag on implementation heavy questions - tag the code language the implementation is written in.

379 questions
0
votes
2 answers

How to make unique urls in django with url-pattern that uses multiple parameters?

My url is structured in this way: example.com/category/subcategory/name Right now I'm using a DetailView and it detects the url when I write it but it resolves positively to any address that includes the right name because that name is unique so…
ffuentes
  • 1,042
  • 5
  • 16
  • 36
0
votes
1 answer

Webservlet urlpatterns for index.jsp

I'm stuck with this problem and I can't find a solution for it anywhere, so any ideas are welcome. I want to execute some code on a @WebServlet (javax.servlet.annotation.WebServlet) before it loads my index.jsp. For that I added "/" to the…
Monica
  • 51
  • 1
  • 3
0
votes
0 answers

format_suffix_patterns error in django 2.1 and python 3.6.5

I'm upgrading from Django==1.11 to Django==2.1 and i revise Django Rest Framework documentation and i can't solve this error. This line of code: urlpatterns = format_suffix_patterns(urlpatterns, allowed=['api', 'json', 'xml']) show this…
0
votes
1 answer

JUnit paramterized testing

@Parameters(name = "{0}") public static Collection data() { File folder = new File("src/test/resources/test"); return Arrays.asList(Objects.requireNonNull(folder.listFiles())); } I want to get the names of the files to be name of the…
0
votes
1 answer

NoReverseMatch at / Reverse for 'snippet_detail' with arguments '('1534691562.8842607',)' not found

I'm trying to create a snippet in a django application. I'm getting the following error when creating the snippet NoReverseMatch at / Reverse for 'snippet_detail' with arguments '('1534693093.896782',)' not found. 1 pattern(s) tried:…
Sukumar
  • 811
  • 1
  • 6
  • 7
0
votes
2 answers

Django: cannot import name path

My urls.py looks like this: urlpatterns = [ path('',views.index, name='index'), path('entry/()' , views.details,name='details'), path('admin/', admin.site.urls), ] but when i try to run it i get error as cannot find…
0
votes
1 answer

Django: Redirect if the link doesn't match urlpatterns

How do I make django to redirect from www.example.com to www.example.com/home ? Below you can see my urlpaterns and I'm using url(r'', RedirectView.as_view(pattern_name='home', permanent=False))to redirect to my /home page but when it detects a link…
0
votes
2 answers

Reverse for 'password_reset_done' with arguments with namespace

Under Django 1.8. I added a namespace to my app but now I have problem with registrations pages. Url: http://127.0.0.1:8000/accounts/password_reset/ in myapp/urls.py: ... from django.contrib.auth.views import password_reset, password_reset_done …
kollo
  • 1,285
  • 3
  • 20
  • 33
0
votes
0 answers

URL pattern matching in Android

I want my Instant App to catch a few links and discard rest. So below is the example of URL I want to…
0
votes
1 answer

Django is not calling functions

My django main site urls from django.contrib import admin from django.urls import path,include urlpatterns = [ path('ways/', include('ways.urls')), path('admin/', admin.site.urls), app url urlpatterns = [ path('newWay/',…
enigma
  • 45
  • 1
  • 7
0
votes
0 answers

the request to the context root was intercepted by my filter, how did it happen?

The context of my web app was "/", and the request to it(http://localhost:8080/) was intercepted by my filter(I didn't expect it.). How did it happen? Here is my filter: authorizationFilter
Exprass L
  • 1
  • 1
0
votes
0 answers

Apache Shiro url-pattern matching and redirect

I am having trouble getting Shiro to redirect to both the login page and the desired url once logged in. This may be due to the fact that I do not have Shiro in my main web xml on the root context, but I would like to keep things separate if…
RadamHussein
  • 891
  • 7
  • 9
0
votes
1 answer

is not a valid regular expression: bad character in group name 'int:id' at position 13

from django.conf.urls import url from django.urls import path, re_path from . import views urlpatterns = [ path('', views.index, name='index'), #path('details//', views.details), #re_path(r'^details/(?P\d+)/$',…
meme
  • 13
  • 4
0
votes
1 answer

Why can't I import urlpatterns from urls.py?

I am trying to create a simple Django view that will render a list of links to all of the other views in my app. my plan was to simply import my list of urlpatterns from urls.py like this from urls import urlpatterns and then generate a list of…
jrowe_fl
  • 53
  • 4
0
votes
1 answer

Setup urlManager in Yi2 to work like twitter

Ho can I set up urlManager patterns in a way that it works like twitter or any other social networks? for example I want to have the following routes: http://www.example.com/[user_id] http://www.example.com/[user_id]/[mycontroller]/[myaction] If…
Hamid Ghorashi
  • 1,003
  • 3
  • 14
  • 29