Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

error in django URLconf, I can't start the local server, an error pops up in the screenshot

enter image description here
I have a ready-made html template with css. It seems to have done everything correctly, but it does not work.

project location C:\Projects\brew\brewtopia

location of the application C:\Projects\brew\brewtopia\users

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

location of the main urls.py C:\Projects\brew\brewtopia\brewtopia\urls.py

location urls.py in the app C:\Projects\brew\brewtopia\users\urls.py

location of views.py in the app C:\Projects\brew\brewtopia\users\views.py

html layout C:\Projects\brew\brewtopia\users\templates\users\Brewtopia.

folder static C:\Projects\brew\brewtopia\users\static

version django 4.1
python 3.11

I’ve been sitting with this problem for a day now, I’ve tried everything, people with experiences help me, I just started learning django

here is the code in the urls,py of the main project

`from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('admin/', admin.site.urls),
    path('"', include('users.urls')),
]`

here is the code in urls,py in the application

`from django.urls import path
from . import views

urlpatterns = [
      path('Brewtopia', views.Brewtopia_view, name='brewtopia')
]`

here is the code in views.py in the app


`from django.shortcuts import render

def Brewtopia_view(request):
    return render(request, 'Brewtopia.html')`



in the main settings.py I have completed this

`STATICFILES_DIRS = [BASE_DIR / "static"]`

>Solution :

If you want set localhost:8000/Brewtopia as index, change the code in urls.py in the application like that

`from django.urls import path
 from . import views

 urlpatterns = [
    path('', views.Brewtopia_view, name='brewtopia')
 ]`
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading