-
Notifications
You must be signed in to change notification settings - Fork 78
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
Can't set RATELIMIT_DEFAULT in .env #134
Comments
Hi, did you try |
Hi @thentgesMindee I tried as you said |
Alright, looking at the code, I think there might be an issue in the code: conf_limits: Optional[StrOrCallableStr] = self.get_app_config(
C.DEFAULT_LIMITS, None
) When looking at the code for def get_app_config(self, key: str, default_value: T = None) -> T:
"""
Place holder until we find a better way to load config from app
"""
return self.app_config(key, default=default_value, cast=type(default_value)) It means, it will try to cast any limit to An alternative, without having to fix the code if your change is urgent, would be to use a different environment variable, and pass it manually with |
Also, this made me see this the comment |
Describe the bug
If i try to set the variable
RATELIMIT_DEFAULT
in my .env file, I get this errorValueError: Config 'RATELIMIT_DEFAULT' has value '["12/10seconds"]'. Not a valid NoneType.
This is how I create the limiter, w/o any other configuration.
limiter = Limiter(key_func=get_remote_address)
Your app:
Additional context
I tried writing the ratelimit string in these ways:
The text was updated successfully, but these errors were encountered: