Skip to content

Commit 80d081d

Browse files
authored
Update README.md (#376)
1 parent aa8db72 commit 80d081d

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,27 @@ Since the admin is an ASGI app, you can either run it standalone like in the dem
5757
For example, using Starlette routes:
5858

5959
```python
60-
from piccolo_admin.endpoints import create_admin
61-
from starlette.routing import Router, Route
6260
import uvicorn
61+
from movies.endpoints import HomeEndpoint
62+
from movies.tables import Director, Movie
63+
from starlette.routing import Mount, Route, Router
6364

64-
from my_project.tables import Director, Movie
65-
65+
from piccolo_admin.endpoints import create_admin
6666

67-
# The `allowed_hosts` argument is required when running under HTTPS. It's used
68-
# for additional CSRF defence.
69-
admin = create_admin([Director, Movie], allowed_hosts=['my_site.com'])
67+
# The `allowed_hosts` argument is required when running under HTTPS. It's
68+
# used for additional CSRF defence.
69+
admin = create_admin([Director, Movie], allowed_hosts=["my_site.com"])
7070

7171

72-
router = Router([
73-
Route(path="/", endpoint=Hello),
74-
Mount(path="/admin/", app=admin),
75-
])
72+
router = Router(
73+
[
74+
Route(path="/", endpoint=HomeEndpoint),
75+
Mount(path="/admin/", app=admin),
76+
]
77+
)
7678

7779

78-
if __name__ == '__main__':
80+
if __name__ == "__main__":
7981
uvicorn.run(router)
8082

8183
```

0 commit comments

Comments
 (0)