emmett-framework / emmett

The web framework for inventors
Other
1.04k stars 70 forks source link

app.config.mailer.suppress = True is ignored #267

Closed vegax87 closed 3 years ago

vegax87 commented 4 years ago

I use Win 10 and Python 3.7, I have tried to add this string in bloggy example

app.config.mailer.suppress = True

but everytime it displays a warning first and then several errors, obviously I can't run the application.

`> WARNING in ext [c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\emmett\tools\auth\ext.py:177]: No mailer seems to be configured. The auth features requiring mailer won't work.

Starting Emmett development server on app app Emmett application app running on http://127.0.0.1:8000 (press CTRL+C to quit) Restarting (stat mode) WARNING in ext [c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\emmett\tools\auth\ext.py:177]: No mailer seems to be configured. The auth features requiring mailer won't work. Traceback (most recent call last): File "c:\users\vegax87\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\vegax87\AppData\Local\Programs\Python\Python37\Scripts\emmett.exe__main.py", line 7, in File "c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\emmett\cli.py", line 510, in main cli.main(prog_name="python -m emmett" if as_module else None) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\emmett\cli.py", line 283, in main return super().main(args, kwargs) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 717, in main rv = self.invoke(ctx) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 956, in invoke return ctx.invoke(self.callback, ctx.params) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 555, in invoke return callback(args, kwargs) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\click\decorators.py", line 64, in new_func return ctx.invoke(f, obj, *args, *kwargs) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 555, in invoke return callback(args, kwargs) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\emmett\cli.py", line 334, in develop_command run_with_reloader(app, host, port) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\emmett_reloader.py", line 155, in run_with_reloader process.start() File "c:\users\vegax87\appdata\local\programs\python\python37\lib\multiprocessing\process.py", line 112, in start self._popen = self._Popen(self) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\multiprocessing\context.py", line 223, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\multiprocessing\context.py", line 322, in _Popen return Popen(process_obj) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\multiprocessing\popen_spawn_win32.py", line 65, in init reduction.dump(process_obj, to_child) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\multiprocessing\reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object 'AuthExtension.register_commands..cli_group' Traceback (most recent call last): File "", line 1, in File "c:\users\vegax87\appdata\local\programs\python\python37\lib\multiprocessing\spawn.py", line 105, in spawn_main exitcode = _main(fd) File "c:\users\vegax87\appdata\local\programs\python\python37\lib\multiprocessing\spawn.py", line 115, in _main self = reduction.pickle.load(from_parent) EOFError: Ran out of input`

josejachuf commented 4 years ago

Hi @vegax87 I have it in a yml file like this

mailer.yml

sender: None

and in python

app.config_from_yaml('mailer.yml', 'mailer')

gi0baro commented 4 years ago

@vegax87 the stacktrace you posted seems more related to the reloader. Can you please try run the application with the --no-reloader option?

vegax87 commented 4 years ago

@gi0baro The app runs without issues so far but it took a while the first time I ran it with --no-reloaded

`> emmett develop --no-reloader

WARNING in ext [c:\users\vegax87\appdata\local\programs\python\python37\lib\site-packages\emmett\tools\auth\ext.py:177]: No mailer seems to be configured. The auth features requiring mailer won't work. Starting Emmett development server on app app Emmett application app running on http://127.0.0.1:8000 (press CTRL+C to quit) [32mINFO[0m: Started server process [[36m11300[0m] [32mINFO[0m: Waiting for application startup. [32mINFO[0m: Application startup complete. [32mINFO[0m: Uvicorn running on [1mhttp://127.0.0.1:8000[0m (Press CTRL+C to quit)`