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 trialzishen cao
3,337 PointsHello 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]
1 Answer
serafinsanchez13
1,540 PointsI was having this same problem and found that my workspace was missing some text from the preloaded code in the urls.py file.
-
Was missing "include" form this line:
from django.conf.urls import include, url
I also saw that my views.py file was in the pycache folder and not the learning_site folder.
Alex Koumparos
Python Development Techdegree Student 36,887 PointsAlex Koumparos
Python Development Techdegree Student 36,887 PointsHi 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