-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration error #5
Comments
@AlexMorra thank you for reporting this. I find this odd. In your make run, are you exposing the ESMERALD_MODULE_SETTINGS to the Dev one? |
Can you provide more details how you setup your configs here, please? Just to replicate and address this. |
Yes, of course. The default configuration from directives
then everything is according to the section Introduction. I can share an example project if it would be an easier way to show it. |
That would be great. This way I can debug it and find the root cause |
here is an example, I used make run |
Thank you, allow us some time to investigate and come back to you |
@tarsil |
@AlexMorra apologies as I got stuck in a few things in the last couple of months. The library is pretty much relevant as I'm actively using it as well. I will come back to you as soon as possible. Apologies for taking so long |
@AlexMorra after checking and testing your code, you actually did everything correctly and there is something I need to update in the library (also needs some internal updates anyway, but more requirements). This is due to the esmerald_simple_jwt imports that you had commented there were correct in the AppSettings. So basically that bit I need to update and the docs as well. In the @property
def simple_jwt(self) -> SimpleJWT:
from esmerald_auth.apps.accounts.backends import (
BackendAuthentication,
RefreshAuthentication,
)
return SimpleJWT(
signing_key=self.secret_key,
backend_authentication=BackendAuthentication,
backend_refresh=RefreshAuthentication,
) This shouldn't impact anything anyway and the reason for it its because its only done once on the up running. Hence also not updating this bit (not sure if the docs actually mention this but I assume not or else this wouldn't be an issue). If you import like you were doing before, that will work. I will try to rework the internals for the future releases but again, this is not performance issue by doing like this. Another thing I noticed. In the Makefile you can change the .PHONY: run
run: ## Starts the local server with production settings
ESMERALD_SETTINGS_MODULE=esmerald_auth.configs.development.settings.DevelopmentAppSettings esmerald runserver -p 8009 I would also strongly advise you to use the latest Esmerald as well. There was a lot of cleaning and nice features that came out. For instance the auto generated Makefile is no longer supported but instead its the taskfile along other new things that came out in the meantime. Apologies for taking so long but you can do as we discussed here and I will also update the next release and docs as it can be misleading. Thank you for reporting this. |
@tarsil Thanks a lot, I got it! |
According to the introduction section, an error occurs when launching the application (make run):
But if you import BackendAuthentication, RefreshAuthentication directly into the simple_jwt method, it will start.
dependencies:
python=3.11
uvicorn=0.30.6
esmerald=3.4.1
esmerald-simple-jwt=0.2.0
The text was updated successfully, but these errors were encountered: