Skip to main content

Dynamic Web Application (DWA)

version license pyversions
donate powered made

Dynamic Web Application (DWA) framework written with Tornado.

Hierarchy

dwa

Example

python

./pages/init.py

from . import root
from . import common

./pages/common.py

from dwa import *


class static_file_page(handlers.StaticFileHandler):
    def validate_absolute_path(self, root, absolute_path):
        return super().validate_absolute_path(root, absolute_path)

    def set_extra_headers(self, path):
        self.set_header('Cache-Control', 'must-revalidate, max-age=0')

./pages/root.py

from dwa import *
from . import common


server_name = "root"


class root_html(handlers.HTML):
    server = server_name


class index_page(root_html):
    file_name = "index"


def get_root_settings(app_root):
    app_root = os.path.join(app_root, server_name)
    return (
        server_name,
        [
            (r"/", index_page),
            (r"/((?:img|js|css|common)/.*)", common.static_file_page, {"path": app_root}),
        ]
    )

./app.py

from dwa import *
import pages


def app_settings_template(app_root: str, domain: str, port: int, cookies_expires_day: float) -> dict:
    settings = {}
    db = "db/db.db"
    settings["cookie_secret"] = open(os.path.join(app_root, "cookie_secret.txt"), "rb").read()
    settings["port"] = port
    settings["db"] = db
    settings["domain"] = domain
    settings["cookies_expires_day"] = cookies_expires_day
    servers = [
        pages.root.get_root_settings(app_root),
    ]
    settings["servers"] = {k: v for k, v in servers}
    return settings


def app_settings(app_root: str) -> dict:
    return app_settings_template(app_root, "your.domain.com", 8888, 1)

./test.py

import dwa

Metadata

Release files for dwa 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dwa 0.0.8
File Size Uploaded Provenance Actions
dwa-0.0.8.tar.gz 7.2 kB Without provenance Details for dwa-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dwa 0.0.8
File Interpreter ABI Platform Actions
dwa-0.0.8-py3-none-any.whl Python 3 none any Details for dwa-0.0.8-py3-none-any.whl

Total release size: 27.2 kB

Release files / dwa-0.0.8.tar.gz

Download URL dwa-0.0.8.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
80b1c200756a0d0a4b79645ddda43fe4b907357ea1d60772724a9f39b2b992cf
BLAKE2b-256 checksum
How to use checksums
4aaee126d501eb7da6379043b8e0440f80ebd7016fc54cea5f8e41cc496fafa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.0

Release files / dwa-0.0.8-py3-none-any.whl

Download URL dwa-0.0.8-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc43df8103ee7dc3db6145865ea660d11102439ff30cb26122f8104499cbaa64
BLAKE2b-256 checksum
How to use checksums
97fda3e6beaa492ad8ef22b66c20c0add4946aa204d81310fb030fae938ad396
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.0

Security for dwa 0.0.8

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.

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page