Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tsarchghs/dyluna

Micro framework for building web applications.
https://github.com/tsarchghs/dyluna

python web-framework wsgi

Last synced: about 2 months ago
JSON representation

Micro framework for building web applications.

Awesome Lists containing this project

README

        

# Dyluna
A very simple wsgi based python web framework

Example:
```python
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/",hello])

app.run()
```
hello.html
```html

Hello

{% if name %}

Hello, {{name}}


{% else %}
name:


Submit

{% endif %}

```
hello2.html
```html

Hello

Hello, {{name}}

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