Skip to main content

installing

pip install p4rr0t007

5-minute example

create yourapp folder

mkdir -p yourapp/{templates,static}
touch yourapp/__init__.py
touch yourapp/application.py

create an index.html template

mkdir -p yourapp/{templates,static}
cat > yourapp/templates/index.html << EOF
<html>
    <head>
        <title>hello world</title>
    </head>
    <body>
        <h1>hello world</h1>
        <pre>{{ now }}</pre>
        <br />
        <hr />
        <br />
        <a href="{{ url_for('html') }}">html</a>
        <a href="{{ url_for('text') }}">text</a>
        <a href="{{ url_for('json') }}">json</a>
    </body>
</html>
EOF

create an index.html template

cat > yourapp/application.py << EOF

import os
from plant import Node
from datetime import datetime
from p4rr0t007.web import Application

node = Node(__file__)
server = Application(node)


@server.route('/')
def html():
    return app.template_response('index.html', {'now': datetime.utcnow().isoformat()})


@server.route('/text')
def text():
    return app.text_response('text')


@server.route('/json')
def json():
    return app.json_response({
        'name': 'p4rr0t007'
    }, code=200)


if __name__ == '__main__':
    settings.update(
        SECRET_KEY=os.urandom(32).encode('base64').strip(),
    )
    server.run(debug=True)

EOF

Download files

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

Source Distribution

p4rr0t007-0.1.4.tar.gz (1.1 MB view details)

Uploaded Source

File details

Details for the file p4rr0t007-0.1.4.tar.gz.

File metadata

  • Download URL: p4rr0t007-0.1.4.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for p4rr0t007-0.1.4.tar.gz
Algorithm Hash digest
SHA256 4c5b0cffcb1fc4fb9ff7cdcf1d8086af357ce606dcf281bbaea7322ab69e2870
MD5 af0a764c7c9d11d44b874421df8055dc
BLAKE2b-256 cd99c54f8d3cf0c0657a1bb6902b9288e832a0067f6955561d3d2c4a017cd4a0

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.10

1 file

0.3.9

1 file

0.3.8

1 file

0.3.7

1 file

0.3.6

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.11

1 file

0.2.10

1 file

0.2.9

1 file

0.2.8

1 file

0.2.7

1 file

0.2.6

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.17

1 file

0.1.16

1 file

0.1.15

1 file

0.1.14

1 file

0.1.13

1 file

0.1.12

1 file

0.1.11

1 file

0.1.10

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

This release

0.1.4 This release

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

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