Skip to main content

A simple wsgi web framework

Project description

Dyluna

A very simple wsgi based python web framework

Example:

app = Dyluna()

@app.route
def hello(environ):
	if environ.get("REQUEST_METHOD") == "POST":
		name = environ["POST"].get("name")
		return render_template("index.html",{"name":name})
	return render_template("hello.html")
app.urls.append(["/hello",hello])

@app.route
def hello(environ,name):
	context = {"name":name}
	return render_template("hello2.html",context)
app.urls.append(["/hello/<name>",hello])

app.run()

hello.html

<html>
<head>
	<title>Hello</title>
</head>
<body>
	{% if name %}
		<h1>Hello, {{name}}</h1>
	{% else %}
		<form method="POST">name: 
			<input name="name"><br>
			<button type="submit">Submit</button>
		</form>
	{% endif %}
</body>
</html>

hello2.html

<html>

<head>
	<title>Hello</title>
</head>
<body>
	<h1>Hello, {{name}}</h1>
</body>
</html>

Run the code and visit http://127.0.0.1:8080/

Project details


Release history Release notifications | RSS feed

This version

0.5

Download files

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

Source Distribution

dylunatj-0.5.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dylunatj-0.5-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file dylunatj-0.5.tar.gz.

File metadata

  • Download URL: dylunatj-0.5.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for dylunatj-0.5.tar.gz
Algorithm Hash digest
SHA256 96d8fcc63569e66ea0e59090bcec124b9f6d1791211167a9a7888fc2dd4f25c1
MD5 95a61a089993ddc319f3d6833b2e0bd4
BLAKE2b-256 d1d2517f3f2e63d65c0711194692d81aba6efcdacee4b2f537bf2b76af43716a

See more details on using hashes here.

File details

Details for the file dylunatj-0.5-py3-none-any.whl.

File metadata

  • Download URL: dylunatj-0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for dylunatj-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 db90df1974850ada20fc1614f4ae41636f07f4d34139be6240a28e21afa6f4e5
MD5 b9847be4fde033f0c1e55fa28959c63e
BLAKE2b-256 2e3015b0a4f919cf634d2a376d931fc5017d732b1914801104fadf98281344c7

See more details on using hashes here.

Supported by

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