Skip to content

Commit

Permalink
improve readme, include static/ in build
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafaggianelli committed Sep 10, 2024
1 parent 8bdcc24 commit fefa0fb
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include src/dbstudio/static *
include README.md
38 changes: 28 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,45 @@
# DB Studio

DB Studio is a web-based database management tool that allows you to manage your databases, tables, and data. It is designed to be simple and easy to use, with a clean and intuitive user interface.
A web-based database management tool that allows you to manage your databases, tables, and data.

DB Studio is currently compatible with FastAPI, Starlette, SQLAlchemy and SQLModel.
It is designed to be embedded into your Python web applications, is currently compatible with FastAPI,
Starlette, SQLAlchemy and SQLModel.

```
## Get started

Install DB Studio from PyPI using pip or your favorite package manager:

```sh
pip install dbstudio
```

## Get started

After configuring DB Studio, the UI will be available at `/dbstudio`.
After configuring DB Studio, the UI will be available at `http://<your-server>/dbstudio`.

### FastAPI
## FastAPI

```python
from fastapi import FastAPI
from dbstudio import DBStudio
from dbstudio.fastapi import get_fastapi_router

# Be sure to import your DB models before initializing DBStudio
import .models

app = FastAPI()

app.mount("/", get_fastapi_router(Base.metadata))
```
# The router must be mounted at /dbstudio
app.mount("/dbstudio", get_fastapi_router(Base.metadata))
```

## Starlette

```python
from starlette.applications import Starlette
from dbstudio.starlette import get_startlette_mount

# Be sure to import your DB models before initializing DBStudio
import .models

app = Starlette(
routes=[get_startlette_mount(Base.metadata)],
)
```
2 changes: 1 addition & 1 deletion src/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Order(Base):
allow_headers=["*"],
)

app_fa.mount("/", get_fastapi_router(Base.metadata))
app_fa.mount("/dbstudio", get_fastapi_router(Base.metadata))

# Starlette
app_st = Starlette(
Expand Down

0 comments on commit fefa0fb

Please sign in to comment.