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
1
vote
1 answer

How can I personalize an URL path in Django?

I am trying to build an website which renders some books and the corresponding pages. I want to make possible to access a page like this: path('/-/', views.TestClass.as_view(), name='book-test') I want a user to access…
geekt
  • 1,979
  • 3
  • 10
  • 20
1
vote
1 answer

How to include part of the url patterns from an Django app

I have two django apps with URLs app_name = 'app1' urlpatterns = [ path('url1/', ..., name='name1') path('/', ..., name='name2') ] and app_name = 'app2' urlpatterns = [ path('url2/', ..., name='name3') …
user2283347
  • 670
  • 8
  • 12
1
vote
2 answers

Reverse for 'hobbieswithCSS.html' not found. 'hobbieswithCSS.html' is not a valid view function or pattern name

I am trying to attach hobbieswithCSS.html file to my website, while using Django. I am a beginner when it comes to Django, so I have naturally came across some problems (in the title) like this. I have this anchor tag on my homepage -
JanKoci
  • 59
  • 11
1
vote
1 answer

Take URL Parameters from a Button in Django

I am trying to get url parameters like this: {% for object in objects %} {{ object.id }} {{ object.user }} {{ object.url }} {{ object.minimum }} {{ object.maximum }} …
Maisum Abbas
  • 317
  • 1
  • 10
1
vote
3 answers

django custom blog post urls

I am learning django by building a simple blogging app. While its all but done, I currently have individual posts having a url in the format https://my_site_dot_com/blog/entry/38/ where the number 38 corresponds to the primary key of said…
Firefinch
  • 29
  • 6
1
vote
1 answer

NoReverseMatch at /login - error with LOGIN_URL or reverse function?

I am developing an app in Django. I am developing users authentication. I have a registration.html and a login.html templates inside path: templates > authentication Everything, including the registering function, works fine, but as I try to access…
Tms91
  • 3,456
  • 6
  • 40
  • 74
1
vote
0 answers

difference between url pattern urls in django

What is the difference between 1. url(r'^$', views.Home.as_view(), name='home'), and 2. url(r'^.*', views.Home.as_view(), name='home'), in view.py: class Home(TemplateView): template_name = "index.html" Output of 1 is it will redirect only…
geek
  • 794
  • 3
  • 16
  • 41
1
vote
0 answers

Appending a url term in Lucee

I would like to add a url-pattern in Lucee 5.x (Tomcat) when visiting a specific url folder a particular script name will be appended at the end of this url folder. For example when i type http://localhost:8888/myApp/*, the browser will be…
asimkon
  • 915
  • 1
  • 14
  • 21
1
vote
1 answer

How to know in a middleware which type of url entered?

Recently I started a new simple project in Django. I wrote some middleware. but in one of the middlewares, I want to know which URL is called because I have to make a decision which is related to URL. I used this code: import os path =…
Saeed
  • 159
  • 3
  • 13
1
vote
1 answer

Java Servlet pattern that starts with a string

I would like to create a servlet pattern that works for URLs like: www.mywebsite.com/@77,aa,bb,cc www.mywebsite.com/@82,zz,dd,cc ... I mean, the symbol "@" and then, any string. I tryied with: @WebServlet(name = "myServlet", urlPatterns =…
Ommadawn
  • 2,450
  • 3
  • 24
  • 48
1
vote
1 answer

tomcat filter url-pattern problem

Hi i have a tomcat server version 5.5.12 and i am using a filter, the problem is that for some files the filter works and for other it doesnt, for example for the path /software/files/generator.7z it works but for path /software/files/tokenizer.7z…
yossi
  • 12,945
  • 28
  • 84
  • 110
1
vote
2 answers

UrlMapping Wildcard for @Pathvariable

I am trying to Define @PathVariable with wildcard in Web.xml for url-mapping. Seems it does not work unless I give the full path in the mapping. Here is my code. TrackingController .java - PSEUDO Code @Controller @RequestMapping(value =…
1
vote
1 answer

Django urlpatterns regex is imprecise, getting 404?

I'm working on Django API URLs, and trying to recognize this type of HTTP request: DELETE http://localhost:8000/api/unassigned_events/dddd-dd-dd/d or dd/ - d for digit, whilst saving each sector in an argument. e.g. DELETE…
Yair V.
  • 109
  • 1
  • 10
1
vote
1 answer

request.POST empty after upgrading from Django 1.11 to Django 2.1

This post is a follow-up of this previous question: Django request.POST empty I had a project up and running with Python 3.5.4 and Django 1.11.13, on Visual Studio 2015. I later updated to Django 2.1.2 because I wanted to import the "path" module,…
VMF
  • 73
  • 1
  • 6
1
vote
1 answer

Wordpress: Media file URL broken due to Duplicator Plugin on localhost

I have downloaded a copy of the website on my local pc using Wordpress Duplicator plugin. Everything is working fine But images are not visible. So I checked with the URL structure and I got the problem. URL Structure should be:…