Flask-Ext
=========
Some extensions of Flask.
Subdomain
---------
- Configure ``app`` attributes
```
app.static_url_path = '/static'
app.static_folder = 'static'
app.add_url_rule(app.static_url_path + '/<path:filename>',
endpoint='static',
view_func=app.send_static_file)
```
- Configure ``settings.py``
```
SERVER_NAME = 'project_name.test:5000'
SESSION_COOKIE_DOMAIN = "." + SERVER_NAME
```
- Configure ``views.py``
```
blueprint = Blueprint('portal', __name__, subdomain='<subdomain>')
add_subdomain_support(blueprint)
```
- Configure ``RequireJS`` and ``Layer``
```
<script>
requirejs.config({
baseUrl: '{{ '%s%s' | format('http://', config.SERVER_NAME) }}'
});
</script>
```
```
<script>
require(['layer'], function(layer){
layer.config({
path: "{{ '%s%s%s' | format('http://', config.SERVER_NAME, '/static/plugins/layer-3.1.1/') }}"
});
});
</script>
```
* Notice: You can use ``g.subdomain`` to get current subdomain.
Raw data
{
"_id": null,
"home_page": "https://github.com/zengqiu/flask-ext",
"name": "Flask-Ext",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "zengqiu",
"author_email": "zengqiu@qq.com",
"download_url": "https://files.pythonhosted.org/packages/2c/86/3e66c46d170bead21a50627256df8784e6e910a3de614a4fcb11d60fc230/Flask-Ext-0.1.tar.gz",
"platform": "any",
"description": "Flask-Ext\n=========\n\nSome extensions of Flask.\n\nSubdomain\n---------\n\n- Configure ``app`` attributes\n\n```\napp.static_url_path = '/static'\napp.static_folder = 'static'\napp.add_url_rule(app.static_url_path + '/<path:filename>',\n endpoint='static',\n view_func=app.send_static_file)\n```\n\n- Configure ``settings.py``\n\n```\nSERVER_NAME = 'project_name.test:5000'\nSESSION_COOKIE_DOMAIN = \".\" + SERVER_NAME\n```\n\n- Configure ``views.py``\n\n```\nblueprint = Blueprint('portal', __name__, subdomain='<subdomain>')\nadd_subdomain_support(blueprint)\n```\n\n- Configure ``RequireJS`` and ``Layer``\n\n```\n<script>\n requirejs.config({\n baseUrl: '{{ '%s%s' | format('http://', config.SERVER_NAME) }}'\n });\n</script>\n```\n\n``` \n<script>\n require(['layer'], function(layer){\n layer.config({\n path: \"{{ '%s%s%s' | format('http://', config.SERVER_NAME, '/static/plugins/layer-3.1.1/') }}\"\n });\n });\n</script>\n```\n\n* Notice: You can use ``g.subdomain`` to get current subdomain.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Extensions of Flask",
"version": "0.1",
"project_urls": {
"Homepage": "https://github.com/zengqiu/flask-ext"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d306ad88dff48ce49f2a760c5ac9a618b38a9d4afa0f00c9fbbb9884bf28d06e",
"md5": "45882af3d0770d349305bb8c00b40b6b",
"sha256": "8c497af589054da3746b117ea3d11d9a09c3aa8dfa46dc434eb605b3854e36bc"
},
"downloads": -1,
"filename": "Flask_Ext-0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "45882af3d0770d349305bb8c00b40b6b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3623,
"upload_time": "2019-04-11T09:01:50",
"upload_time_iso_8601": "2019-04-11T09:01:50.463355Z",
"url": "https://files.pythonhosted.org/packages/d3/06/ad88dff48ce49f2a760c5ac9a618b38a9d4afa0f00c9fbbb9884bf28d06e/Flask_Ext-0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2c863e66c46d170bead21a50627256df8784e6e910a3de614a4fcb11d60fc230",
"md5": "62295ba7cb59911a6b92e88f82da131e",
"sha256": "260fc92e7d4563fe65cdd7bf111b93b37a4a8cce6e087ca62787e3e457437439"
},
"downloads": -1,
"filename": "Flask-Ext-0.1.tar.gz",
"has_sig": false,
"md5_digest": "62295ba7cb59911a6b92e88f82da131e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2329,
"upload_time": "2019-04-11T09:01:52",
"upload_time_iso_8601": "2019-04-11T09:01:52.654365Z",
"url": "https://files.pythonhosted.org/packages/2c/86/3e66c46d170bead21a50627256df8784e6e910a3de614a4fcb11d60fc230/Flask-Ext-0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2019-04-11 09:01:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zengqiu",
"github_project": "flask-ext",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "flask-ext"
}