Giter Site home page Giter Site logo

Comments (8)

aminalaee avatar aminalaee commented on June 2, 2024

Hey,
not sure if I get your question right.
I can think of two points:

  • Use can use Admin(base_url=...) to configure the URL.
  • In your app you don't se the root_path in path, instead that's the prefix in your routers.

Generally I think this makes sense since you want to handle multiple API versionings in your app, running at the same time so setting the version on the whole app might not be a good idea.

from sqladmin.

mmzeynalli avatar mmzeynalli commented on June 2, 2024

Default base_url suits me, however, whenever set any root_path, admin gets messy like I showed in screenshots. You second point would work, but, it is hassle to add api/v1/ to every app's router. I think admin should be independent of root_path and have its url.

from sqladmin.

aminalaee avatar aminalaee commented on June 2, 2024

Anyway if you want to do that you can just modify admin.app which is just another FastAPI app so you can do any config you want.

from sqladmin.

mmzeynalli avatar mmzeynalli commented on June 2, 2024

How? Just adding root_path breaks admin panel. Is it expected?

from sqladmin.

aminalaee avatar aminalaee commented on June 2, 2024

I haven't tested this before, doesn't setting this work?

admin.app["root_path"] = ...

from sqladmin.

mmzeynalli avatar mmzeynalli commented on June 2, 2024

Just checked, no it does not work. Change the line to:
admin.app.root_path = "", but as app passed to admin is the global fastapi app, I am overriding global root_path => All endpoints are without /api/v1/

from sqladmin.

VladBein avatar VladBein commented on June 2, 2024

@mmzeynalli have you solved this problem?

from sqladmin.

mmzeynalli avatar mmzeynalli commented on June 2, 2024

To be honest no, unfortunately, have been super busy for the last couple of months.

from sqladmin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.