Right, is there any particular valid reason as to why - despite me doing everything correctly - do I get the error 404 message when I deploy my development server (on port 8000) from PyCharm?
This is the tutorial I am following Youtube Tutorial which I have followed to the letter. Why does it work for him and not for me?
I have confirmation the services has started. I have started this y using the following command
python manage.py runserver
Why is is that when setting my URL paths in the /urls
config file on Django framework, does the browser just decide not to bother to actually read the file?
- I have tried changing the port number in the settings on the PyCharm app - but what would have been way too simple.
- I have tried closing down the app then starting it back up - of course that didn't work because that would have made my life way too easy
- I've tried Googling the problem, it suggested the above
Here is my code below, first first snippet is apparently where the problem lies according to the browser. They're in separate files:
#Filename: pyshop/urls.py
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('products/', include('products.urls'))
]
from django.urls import path
from . import views
urlpatterns = [
path('', views.index)
]
from django.http import HttpResponse
from django.shortcuts import render
def index(request):
return HttpResponse('Hello World')
You will see its not my code. So what is it? And how do I get rid of the 404 problem?
pyshop/urls.py
sounds like it's a predefined plugin, etc. and Django is not set properly with actual URLs or is being taken over by this plugin.