```Using the URLconf defined in hms_prj.urls
, Django tried these URL patterns, in this order:
- admin/
- user/
- [name=‘index’]
The current path, % url 'userauths:sign-up' %
, didn’t match any of these.
You’re seeing this error because you have DEBUG = True
in your Django settings file. Change that to False
, and Django will display a standard 404 page.
urls.py(prj)
path('admin/', admin.site.urls),
#Custom URLS
path("user/", include("userauths.urls")),
path("", include("hotel.urls")),
]
```
hotel urls.py
from hotel import views
app_name = "hotel"
urlpatterns = [
path("", views.index, name="index"),
]
hotel.html
<h1>Welcome back {{request.user.username}}</h1>
<a href="">logout</a>
{% else %}
<h1>Welcome back</h1>
<a href="% url 'userauths:sign-up' %">Register</a>
<a href="">Login</a>
{% endif %}
any solution for my problem please
Please post the contents of the urls.py file in userauths.
from userauths import views
app_name = "userauths"
urlpatterns = [
path("sign-up/", views.RegisterView, name="sign-up")
]
You’re missing the braces around the tag. Tags are enclosed by {% ... %}
.
1 Like
okay let me put in that and see