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! First URL

Help, i can't seem to get the import function to high light red when I use "." to specify current directory.

Hi there,

I can't seem to correctly import the views module. Can anyone help?

Cheers,

newspaper/urls.py
from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.hello_world), 
]

1 Answer

John Lack-Wilson
John Lack-Wilson
8,181 Points

Although the error is stating that you have not imported views, your code for importing is correct. I believe the actual problem is related to line 6 with url. Check the views file again to see if you are using it correctly.