Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"project_name": "restful_api",
"app_name": "myapi",
"python_version": ["3.8", "3.7", "3.6"],
"python_version": ["3.11", "3.10", "3.9", "3.8"],
"tox_python_env": "py{{ cookiecutter.python_version|replace('.','') }}",
"use_celery": ["no", "yes"],
"admin_user_username": "admin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
api.add_resource(UserList, "/users", endpoint="users")


@blueprint.before_app_first_request
def register_views():
apispec.spec.components.schema("UserSchema", schema=UserSchema)
apispec.spec.path(view=UserResource, app=current_app)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def create_app(testing=False):

configure_extensions(app)
configure_cli(app)
configure_apispec(app)
register_blueprints(app)
configure_apispec(app)
{%- if cookiecutter.use_celery == "yes" %}
init_celery(app)
{%- endif %}
Expand Down Expand Up @@ -58,6 +58,9 @@ def configure_apispec(app):
}
},
)
with app.app_context():
api.views.register_views()
auth.views.register_views()


def register_blueprints(app):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ def check_if_token_revoked(jwt_headers, jwt_payload):
return is_token_revoked(jwt_payload)


@blueprint.before_app_first_request
def register_views():
apispec.spec.path(view=login, app=app)
apispec.spec.path(view=refresh, app=app)
Expand Down