Skip to content

Commit

Permalink
tweak blacksheep template
Browse files Browse the repository at this point in the history
  • Loading branch information
sinisaos committed Aug 5, 2021
1 parent 3b3bb2e commit 24c257a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import typing as t

from piccolo_admin.endpoints import create_admin
from piccolo_api.crud.serializers import create_pydantic_model
from piccolo.engine import engine_finder

Expand All @@ -10,11 +11,20 @@ from blacksheep.server.openapi.v3 import OpenAPIHandler
from openapidocs.v3 import Info

from home.endpoints import home
from home.piccolo_app import APP_CONFIG
from home.tables import Task


app = Application()

app.mount(
"/admin/",
create_admin(
tables=APP_CONFIG.table_classes,
# Required when running under HTTPS:
# allowed_hosts=['my_site.com']
),
)

docs = OpenAPIHandler(info=Info(title="Example API", version="0.0.1"))
docs.bind_app(app)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
</ul>
<h3>BlackSheep</h3>
<ul>
<li><a href="/admin/">Admin</a></li>
<li><a href="/docs/">Swagger API</a></li>
</ul>
</section>
Expand Down

0 comments on commit 24c257a

Please sign in to comment.