Metadata-Version: 2.1
Name: Magicweb
Version: 0.1.0
Summary: A simple web framework
Home-page: https://replit.com/@IsraelW/webframeworkpypi
Author: Israel Waldner
Author-email: imky171@gmail.com
License: MIT
Download-URL: https://pypi.org/project/magicweb/
Keywords: Web,Web framework,framework
Platform: UNKNOWN
Description-Content-Type: text/markdown
Requires-Dist: parse
Requires-Dist: webob
Requires-Dist: waitress

# Magicweb

Magicweb is a simple web framework that is still under developement. It currently supports route parameters but no html templating.

## Usage
### Installation

To install Magicweb you can run
`pip install Magicweb` or `pip3 install Magicweb`

To install Magicweb from source run

```
git clone https://github.com/mordy-python/magicweb
cd magicweb
python setup.py install
```
### Run a basic app
To create a simple app we need to import Magicweb and create an app instance

```python
import magicweb
app = magicweb.App()
```
Once our app is instantiated we can add routes

```python
```python
import magicweb
app = magicweb.App()

@app.route('/')
def index(request, response):
  response.text = "Hello"
@app.route('/rendered')
def rendered(request, response):
  app.render('index.html')
```

We created two routes, one that returns hello world, and one that renders an html page. All html pages should be in a directory named html, although this can be overrdden when instantiting the App class.

To run our app we need to use the `app.run()` function

```python
...
run(app)
# to run with a different host/port just add those arguments
# run(app, host='0.0.0.0', port=5000)
```

We can also create routes with parameters

```python
import magicweb
app = magicweb.App()

@app.route('/{name}')
def index(request, response, name):
  response.text = "hello " + name
```


