Saturday, May 30, 2020

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

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.

On Saturday, May 30, 2020 at 5:41:52 PM UTC-6, Thomas G. McNeill wrote:
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.








--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3efafd05-7f3b-4afa-8f77-7b81ecdaebdf%40googlegroups.com.

No comments:

Post a Comment