Created
January 22, 2017 01:46
-
-
Save mazz/4b2c9320814f9b7fb69dfaa8063a7e7a to your computer and use it in GitHub Desktop.
NameError: name 'path' is not defined
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from websauna.system.http import Request | |
from websauna.system.core.route import simple_route | |
from cornice.service import Service | |
# Configure view named home at path / using a template xact/home.html | |
@simple_route("/", route_name="home", renderer='xact/home.html') | |
def home(request: Request): | |
"""Render site homepage.""" | |
return {"project": "xact"} | |
trivial = Service(name='resttrivial', | |
path=path('trivial'), | |
renderer='json', | |
accept='application/json') | |
@trivial.get(require_csrf=False) | |
def get_trivial(request): | |
return dict(status='success') | |
Author
mazz
commented
Jan 22, 2017
Change path=path('trivial')
to path='trivial'
The path function is missing in this case. It was probably a custom function in the cornice example and was not shared with the gist.
good
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment