Mlask brings a bit of django like structure to Flask apps.
Installation:
pip install mlask
Create your first app:
To create the skeleton run:
mlask-admin.py startapp your_apps_name
This command will create a folder named your_apps_name with the following files:
manage.py
config.py
tests.py
views.py
For the “hello world” examples check “views.py” and “tests.py”.
When you’re ok with your first app, start the testing server by running:
python manage.py runserver
Then run the tests I’m sure you’ve written:
python manage.py test
Edit “config.py” to change server settings, add aditional modules to your app and to define your own configuration. All uppercase variables from “config.py” are accessible from “app.config” module. More on Flask configuration: flask.pocoo.org/docs/config/.
And that’s mostly it. For full Flask documentation visit flask.pocoo.org/docs/api/.
All built in commands:
runserver Starts testing server rungunicorn Starts Gunicorn server shell Starts interactive shell with defined app syncdb Creates all tables defined by SQLAlchemy declarative test Runs all tests in "config.TEST_MODULES" startapp Creates an app direcory structure for the given app name in the current directory
Define your own command:
Create a file mycommands.py with the following content:
from mlask.management.commands import BaseCommand
class ExampleCommand(BaseCommand):
__command_name__ = 'example' #optional
__help__ = 'Short help' #optional
def update_parser(self, parser):
# Define rules for parsing the input.
# Check argparse for full documentation.
parser.add_argument('text', help="Text to print")
def run(self, options):
print options.text
Add “your_apps_name.mycommands” module to config.py “MODULES” and test it out by running:
python manage.py example "Hello"
Metadata
Release files for Mlask 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Mlask-0.2.tar.gz | 6.0 kB | Without provenance | Details for Mlask-0.2.tar.gz |
Release files / Mlask-0.2.tar.gz
| Download URL | Mlask-0.2.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa41c0311e97dc83fca7a68b306645ff2e635a25d073db32181b290f3b26994f
|
|
BLAKE2b-256 checksum How to use checksums |
c1cb7100d24a2617e0e0879f4b57eaa704827e5775177f27b76f78934ab7a943
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Mlask 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.