https://github.com/carlosmatheus/python-web-framework
A HTTP Python web framework implementation
https://github.com/carlosmatheus/python-web-framework
framework http python restful-framework
Last synced: 3 months ago
JSON representation
A HTTP Python web framework implementation
- Host: GitHub
- URL: https://github.com/carlosmatheus/python-web-framework
- Owner: CarlosMatheus
- License: mit
- Created: 2019-11-02T22:22:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-17T00:00:40.000Z (about 1 year ago)
- Last Synced: 2025-01-17T07:13:59.880Z (5 months ago)
- Topics: framework, http, python, restful-framework
- Language: HTML
- Size: 6.94 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python-Web-Framework
An HTTP Python web framework implementation that supports routering and templates like flask.> Project in early development stage, not stable for production :construction:
## Usage
Create a `server.py` file as on the example of this repository.
On the file import the `WebFramework` class.
Define the routes and pages.
The framework also supports templates files similarly to flask, put them on templates folder.
Call the `start_server()` method at the end and run the `server.py` file.
## Example
```python
from web_framework import WebFrameworkserver = WebFramework()
@server.route("/")
def home(request):
return "Hello from the HOME page"@server.route("/about")
def about(request):
return server.open_template('index')server.start_server()
```