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 trialRon Yonker
3,314 PointsCode does not work!
Typed everything in exactly in urls.py, and got the error: ImportError: cannot import name 'views'.
NO, this is NOT an indentation issue.
Dustin James
11,364 PointsAnd make sure to add python after the first set of ticks
'' 'python
Jeff Muday
Treehouse Moderator 28,720 PointsNot all the files you need for that step are generated automatically.
Did you create a 'views.py' file in the learning_site project folder? Note, the file "views.py" is not automatically created in the project folder when you run the command below
$ django-admin startproject learning_site
Kenneth adds the 'views.py' file in the previous video called "Hello Django" at about 1:00 minute into the video.
When you do a "startapp" command, the view.py is automatically generated in the app folder. In my opinion, why they did projects and apps differently is to suggest a design approach which promotes "DRY" (don't repeat yourself) and reusability for apps.
Alexander Davison
65,469 PointsActually, it isn't required to put the "python" thing in front of the first set of ticks.
If you don't provide it it will look like this:
print("Hello")
However, if you do, it will look like this:
print("Hello")
To keep things simple I just explained the one without the "python" thing.
2 Answers
Erika Suzuki
20,299 PointsPlease attach your code.
Ikuyasu Usui
36 PointsTry:
from django.http import HttpResponse
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsCan you please post your code? Remember to wrap your code with 3 backticks (```) on the line before and after the code snippet.
Example:
```
print("Hello")
```