You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.rst
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -404,9 +404,12 @@ See the :ref:`api` below for details on the various prompt functions.
404
404
Default commands
405
405
----------------
406
406
407
+
runserver
408
+
+++++++++
409
+
407
410
**Flask-Script** has a couple of ready commands you can add and customise: ``Server`` and ``Shell``.
408
411
409
-
The ``Server`` command runs the **Flask** development server. It takes an optional ``port`` argument (default **5000**)::
412
+
The ``Server`` command runs the **Flask** development server.
410
413
411
414
from flask.ext.script import Server, Manager
412
415
from myapp import create_app
@@ -427,6 +430,26 @@ The ``Server`` command has a number of command-line arguments - run ``python man
427
430
428
431
Needless to say the development server is not intended for production use.
429
432
433
+
*New in version 2.0.5*
434
+
435
+
The most common use-case for ``runserver`` is to run a debug server for
436
+
investigating problems. Therefore the default, if it is *not* set in the
437
+
configuration file, is to enable debugging and auto-reloading.
438
+
439
+
Unfortunately, Flask currently (as of May 2014) defaults to set the DEBUG
440
+
configuration parameter to ``False``. Until this is changed, you can
441
+
safely add ``DEFAULT=None`` to your Flask configuration. Flask-Script's
442
+
``runserver`` will then turn on debugging, but everything else will treat
443
+
it as being turned off.
444
+
445
+
To prevent misunderstandings -- after all, debug mode is a serious security
446
+
hole --, a warning is printed when Flask-Script treats a ``None`` default
447
+
value as if it were set to ``True``. You can turn on debugging explicitly
448
+
to get rid of this warning.
449
+
450
+
shell
451
+
+++++
452
+
430
453
The ``Shell`` command starts a Python shell. You can pass in a ``make_context`` argument, which must be a ``callable`` returning a ``dict``. By default, this is just a dict returning the your Flask application instance::
0 commit comments