Skip to main content

Hy Macros for Flask

Project description

Version 0.0.2.

Horn is a collection of Hy macros for use with Flask. It will be developed further to provide further convenience. It is on a very early stage. DO NOT USE IN PRODUCTION.

install with

pip install git+git://github.com/Hylands/horn.git

for the very latest version, or

pip install horn

for the more stable version.

Then use the macros in hy using

(require horn.flask)

and then use the route macro.

(route "/" "home.html")
(route "/"  (defn womethods [] ("hello, world")))
(route "/" ["GET" "POST"] (defn wmethods [] ("hello, world")))
(route "/" ["GET" "POST"] "templatewmethods.html")
(route "/<name>/<address>" "template.html" [name] [[address "N/A"]])

The syntax is for a template:

(route *route-endpoint* [*possibly a list of methods*] *template* [*required args*] [*optional args*])

where optional args can be of the form [arg1 arg2] for the default value of None or [[arg1 42] arg2] where arg1 would have the default value of 42, but arg2 would have the default value of None.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Horn-0.0.2.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file Horn-0.0.2.tar.gz.

File metadata

  • Download URL: Horn-0.0.2.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Horn-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a3e9fa22061b512c031f740bae0e2b0135e87a9558058e598b9e6024b44d425c
MD5 e5a320031c0ea8cfcae9fe49c2296812
BLAKE2b-256 ea947c543d0f520af256db96b0a33e0805c1c256bab51aa5ac70b70a8f7f5aa7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page