Why is "Hello World!" alternating with Django welcome page after following tutorial?

8 views
Skip to first unread message

Thomas G. McNeill

unread,
May 30, 2020, 7:41:52 PM5/30/20
to Django users
I just followed this tutorial to create the simplest possible Django application:


I used campaign instead of tutorial and app instead of hello_world because I intend to transform the tutorial into a simple production application.

When I load the app in my browser, I get either "Hello, World!" (the expected result) or the Django welcome page ("The install worked successfully! Congratulations! You are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs"). The two alternate. It's not random -- I always get one and then the other when I reload the page.

campaign/app/urls.py contains:

from django.urls import path
from . import views

urlpatterns = [
     path('', views.index, name='index'),
]

campaign/campaign/urls.py contains:

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

urlpatterns = [
    path('', include('app.urls')),
    path('admin/', admin.site.urls),
]

I don't get how it works as expected every OTHER time. Obviously I can't move on until I get this fixed.








Thomas G. McNeill

unread,
May 30, 2020, 11:11:07 PM5/30/20
to Django users
Well, never mind. I changed some stuff, and then I changed it all back, as far as I know. But now it is working correctly. I have no idea what I changed.
Reply all
Reply to author
Forward
0 new messages