Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Basics What a View! What Are URLs?

Hello world is not showing, I think I did all steps correctlly

from django.conf.urls import url,include
from django.contrib import admin

from . import views

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', views.hello_world),
]



from django.http import HttpResponse

def hello_world(request):
    return HttpResponse("Hello World")

[MOD: added ```python formatting -cf]

Alex Koumparos
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Koumparos
Python Development Techdegree Student 36,887 Points

Hi Zishen,

Please ensure that you always use markdown to properly format your code when submitting a question. You can find a link to the markdown cheatsheet below the text entry box when you are creating/editing a question.

Cheers

Alex

1 Answer

I was having this same problem and found that my workspace was missing some text from the preloaded code in the urls.py file.

  1. Was missing "include" form this line:

    from django.conf.urls import include, url

  2. I also saw that my views.py file was in the pycache folder and not the learning_site folder.