cofin / fastapi-vite

Template helpers for including assets generated by Vite JS. Includes basic support FastAPI / Starlette templates.
25 stars 9 forks source link

Is this project still maintained? #1

Open tclasen opened 2 years ago

tclasen commented 2 years ago

I tried this out and wasn't able to get it working, either by using the example in the readme, and the sample in the repo itself. Neither worked for me.

paolodina commented 2 years ago

Same here

  File ".venv/lib/python3.10/site-packages/fastapi_vite/loader.py", line 10, in <module>
    from jinja2 import Markup
ImportError: cannot import name 'Markup' from 'jinja2' (.venv/lib/python3.10/site-packages/jinja2/__init__.py)

What I did as a workaround to make it work is to change fastapi_vite/loader.py replacing this line

from jinja2 import Markup

with

from markupsafe import Markup
tclasen commented 2 years ago

@paolodina , did you fork this repo or monkey patch it during loading? If you have an example FastAPI project successfully using this library I would love to see it and try it out.

paolodina commented 2 years ago

This one fixed the issue for me https://github.com/paolodina/fastapi-vite/tree/temporary-import-fix. Btw, my branch is not at the latest commit (which, tbh I wasn't even able to install).

I still have to try if it "really works", but at least the server starts without raising the exception.

PS.

If you have an example FastAPI project successfully using this library I would love to see it and try it out.

btw I almost forgot to ask the same just in case.

cofin commented 2 years ago

Hey, all - Sorry that I haven't actively kept this up to date. I have been using this in another larger project and have (very slowly) been peeling it out into it's own package.

I'll publish a full sample project that uses this. I also plan to clean up a few things and finish integrating the Vite Runner process.

Are there any other specific issues you guys are still having?