Я работаю через Flask Мигеля Гринберга Megatutorial (приложение для микроблогов), используя микроинстанцию Ubuntu Amazon EC2.
В настоящее время каждый раз, когда я хочу запустить приложение фляги, мне приходится cd
в каталог верхнего уровня ~/microblog/
.
Затем я набираю: flask run -h 0.0.0.0 -p 50000
, чтобы запустить приложение.
Есть ли способ указать каталог в командной строке, поэтому мне не нужно продолжать идти в каталог для запускапрограмма? Кажется, что нет, но, может быть, я что-то упустил. Я также довольно новичок в Linux.
~/microblog$ flask run --help
* Tip: There are .env or .flaskenv files present. Do "pip install python-dotenv" to use them.
Usage: flask run [OPTIONS]
Run a local development server.
This server is for development purposes only. It does not provide the
stability, security, or performance of production WSGI servers.
The reloader and debugger are enabled by default if FLASK_ENV=development
or FLASK_DEBUG=1.
Options:
-h, --host TEXT The interface to bind to.
-p, --port INTEGER The port to bind to.
--cert PATH Specify a certificate file to use HTTPS.
--key FILE The key file to use when specifying a
certificate.
--reload / --no-reload Enable or disable the reloader. By default
the reloader is active if debug is enabled.
--debugger / --no-debugger Enable or disable the debugger. By default
the debugger is active if debug is enabled.
--eager-loading / --lazy-loader
Enable or disable eager loading. By default
eager loading is enabled if the reloader is
disabled.
--with-threads / --without-threads
Enable or disable multithreading.
--extra-files PATH Extra files that trigger a reload on change.
Multiple paths are separated by ':'.
--help Show this message and exit.