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 trialAbigail Wicks
620 PointsI'm getting a syntax error: EOL while scanning string literal url(r'^$, views.hello_world), I did it correctly!!!
from django.conf.urls import url from django.contrib import admin
from . import views
urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$, views.hello_world), ]
2 Answers
Xayaseth Boudsady
21,951 Pointsurls.py
from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.hello_world),
]
Note: I am using Python3, and Django 2.0.3
Alfonso Lopez
6,089 PointsYou need to make the following import. It does not appear to be standard in urls.py as of the current version:
from django.conf.urls import url, include
Then your code should work.
Afloarei Andrei
5,163 PointsAfloarei Andrei
5,163 PointsI'm not sure, but, I think that you are missing a ' in the second url.