Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
ValueError: 'name' may not contain a dot '.' character.
I don't understand what this means
raise ValueError("'name' may not contain a dot '.' character.") ValueError: 'name' may not contain a dot '.' character.
Some of my codes which I think might have caused the error are below:
api.add_resource( CourseList, '/api/v1/courses', # URI endpoint = 'courses' # what we are going to call this end point )
Chris FreemanTreehouse Moderator 67,622 Points
Iris Avalon14,477 Points
Adding this comment in case anyone else is having this issue:
The line causing problem in the above snippet is:
courses_api = Blueprint('resources.courses', __name__)
The first argument in the Blueprint constructor cannot have a dot character in it. Looking at the flask documentation for the Blueprint class, the first positional argument in the constructor is prepended to the endpoint name, that's all:
name (str) – The name of the blueprint. Will be prepended to each endpoint name.
So you can change
'resources.courses' to something like just
'course' and the app should build just fine