Porter97 / offbrand-tutorial

A social network tutorial built using Flask and Stream!
9 stars 3 forks source link

Requirements.txt missing modules #3

Open Gizmotronn opened 3 years ago

Gizmotronn commented 3 years ago

flask_login & flask_mail are missing

Another problem is that even after installing the modules in a virtual environment, the command flask run returns errors:

flask run
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
Traceback (most recent call last):
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/flask/cli.py", line 966, in main
    cli.main(prog_name="python -m flask" if as_module else None)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/flask/cli.py", line 848, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/flask/cli.py", line 305, in __init__
    self._load_unlocked()
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/flask/cli.py", line 330, in _load_unlocked
    self._app = rv = self.loader()
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/flask/cli.py", line 392, in load_app
    app = locate_app(self, import_name, None, raise_if_not_found=False)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/flask/cli.py", line 257, in locate_app
    return find_best_app(script_info, module)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/flask/cli.py", line 83, in find_best_app
    app = call_factory(script_info, app_factory)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/venv/lib/python3.9/site-packages/flask/cli.py", line 117, in call_factory
    return app_factory(script_info)
  File "/Users/liam/Documents/Webapps/External-Repos/offbrand-tutorial/app/__init__.py", line 8, in create_app
    app.config.from_object(config[config_name])
KeyError: <flask.cli.ScriptInfo object at 0x10b483b80>
Porter97 commented 3 years ago

Hey Liam,

You just need to set your FLASK_APP environment variable before you use the flask run command.