Flask-Ext
Some extensions of Flask.
Subdomain
- Configure
appattributes
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
RequireJSandLayer
<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.subdomainto get current subdomain.
Metadata
Release files for Flask-Ext 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Flask-Ext-0.1.tar.gz | 2.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Flask_Ext-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / Flask-Ext-0.1.tar.gz
| Download URL | Flask-Ext-0.1.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
260fc92e7d4563fe65cdd7bf111b93b37a4a8cce6e087ca62787e3e457437439
|
|
BLAKE2b-256 checksum How to use checksums |
2c863e66c46d170bead21a50627256df8784e6e910a3de614a4fcb11d60fc230
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
|
Release files / Flask_Ext-0.1-py3-none-any.whl
| Download URL | Flask_Ext-0.1-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c497af589054da3746b117ea3d11d9a09c3aa8dfa46dc434eb605b3854e36bc
|
|
BLAKE2b-256 checksum How to use checksums |
d306ad88dff48ce49f2a760c5ac9a618b38a9d4afa0f00c9fbbb9884bf28d06e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
|