Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/tsarchghs/dyluna
- Owner: tsarchghs
- Created: 2018-08-21T23:33:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-06T08:26:06.000Z (almost 6 years ago)
- Last Synced: 2024-10-12T06:49:32.537Z (3 months ago)
- Topics: python, web-framework, wsgi
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dyluna
A very simple wsgi based python web frameworkExample:
```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
```htmlHello
{% if name %}
Hello, {{name}}
{% else %}
name:
Submit
{% endif %}```
hello2.html
```htmlHello
Hello, {{name}}
```
Run the code and visit http://127.0.0.1:8080/