[Python] Cannot Access the Local Host on Python 127.0.0.1:8000 in browser

Discussão em 'Python' iniciado por Stack, Março 21, 2025.

  1. Stack

    Stack Membro Participativo

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

    urlpatterns = [
    path('admin/', admin.site.urls),
    path('products/'),include('products.urls') #this line
    ]


    Hi,anyone. sorry to ask this kind of question but this my first time tryin' python. Whats wrong with path('products/'),include('products.urls') ? if i delete that line, i can run the local host in http://127.0.0.1:8000/ in my tutorial explain to add that line to access http://127.0.0.1:8000/products to show Hello World in browser, but if i ad that line, the result on me is problem loading page. With this error shown in terminal:

    File "C:\Users\BinarK\PycharmProjects\PyShop\pyshop\urls.py", line 23, in <module>
    path('products/'),include('products.urls')
    TypeError: _path() missing 1 required positional argument: 'view'


    enter image description here

    Continue reading...

Compartilhe esta Página