Un pequeño framework para python
Project description
mauweb
- Un web framework para python
¿Como se usa?
-
Primero instalatelo
pip install MauWeb -
Crea un pequeño set up
from mauweb import MauWeb, Path from mauweb.response import HttpResponse, RenderResponse, JsonResponse, FileResponse app = MauWeb() # Inicializacion app.set_static('/static/', '.') # Se usaria asi (https://github.com/maubg-debug/mauweb/blob/main/examples/ejemplo.html#L4) def print_received(request): # La funcion que quieras. Parametro :: request (Puedes hacer cosas como si es un 'POST' o 'GET'). Haz debuging print(request.query_string) return RenderResponse( # Todos se pueden importar como pone ariba request, # ¡Siempre! 'ejemplo.html', # En este caso el archivo None # Context ) routes = [ Path('/', print_received), # Añade todos los routers # Para mas seguridad pon (Path('/awd/', print_received)) y Path('/algo', print_received) # Para un slash y sin. ] app.set_routes(routes) # Añade los routers if __name__=='__main__': # venga ya app.run(app) # Correr. Puedes poner como argumentos (ademas de app que es abligatorio) :: El puerto, el host
- Mas ejemplos en github
Licencia
- Miralo en nuestro github
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
MauWeb-0.0.2.tar.gz
(5.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
MauWeb-0.0.2-py3-none-any.whl
(19.3 kB
view details)
File details
Details for the file MauWeb-0.0.2.tar.gz.
File metadata
- Download URL: MauWeb-0.0.2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8f403562a7aeba6e604c5d87bef64c91f3e59e591f137785b049fbf85eb3529
|
|
| MD5 |
d3fb014b171e1cd6e7506c4dcb1d181b
|
|
| BLAKE2b-256 |
9cec29807479ef5f972d37bf35c64968c3185d39b6240d165d5bd562395c4ea0
|
File details
Details for the file MauWeb-0.0.2-py3-none-any.whl.
File metadata
- Download URL: MauWeb-0.0.2-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f0542f09e51d21e824f88127bb2f56c6328d8018b4d7caec6f8fafa660a4d94
|
|
| MD5 |
11a31a401d88fa8252f9ae385d5393fd
|
|
| BLAKE2b-256 |
27547b13f5bc5a5e522b6d7a4cc176e5369b8165a5c4c959495473c9bed53f23
|