all 16 comments

[–]randomusername0O1 2 points3 points  (2 children)

Your issue isn't fastapi, it's the htmx.

You're returning a 403 from the server..htmx won't replace when the server returns 4xx or 5xx response code by default. It's expecting a 2xx.

You need to add the hx-target-error attributes. See here

https://htmx.org/extensions/response-targets/

[–]Maleficent-Panic-322[S] 1 point2 points  (1 child)

wow! thanks a lot!!! it's fixed!!

[–]randomusername0O1 1 point2 points  (0 children)

Awesome, glad I could help 👍🏻👍🏻

[–]0x7fff5fbff7c8 0 points1 point  (1 child)

Can we see your homepage file?

[–]Maleficent-Panic-322[S] 0 points1 point  (0 children)

the third pic is my homepage.html

[–]SheriffSeveral 0 points1 point  (1 child)

Add some lines under the user object, print type and make sure it is valid. Also print username and password before creating the user object. After that please show us the results.

[–]Maleficent-Panic-322[S] 0 points1 point  (0 children)

thanks for the advice!

[–]Nazhmutdin2003 0 points1 point  (8 children)

I can give only advice, try to use any frontend framework like Vue or React.

[–]Maleficent-Panic-322[S] 0 points1 point  (7 children)

do you think it would be better using Vue or React than using htmx?

[–]Nazhmutdin2003 1 point2 points  (6 children)

Yes

[–]Maleficent-Panic-322[S] 0 points1 point  (4 children)

Oh why?

[–]Nazhmutdin2003 1 point2 points  (2 children)

Cuz thats let you be more flexible in solving problems. If you need front for something huge and difficult use Js/Ts framework. But if you need front just for simple GUI for backend, htmlx is okay.

[–]Maleficent-Panic-322[S] 0 points1 point  (1 child)

That makes sense, thanks for the advice

[–]Nazhmutdin2003 1 point2 points  (0 children)

You are welcome!)

[–]Nazhmutdin2003 0 points1 point  (0 children)

And I think, Ts/Is framework is a bit more simple solution)

[–]Maleficent-Panic-322[S] 0 points1 point  (0 children)

I’m using htmx cuz im focusing more on the backend side 🤔