Advertisement
NubeColectiva

Cómo Crear Una Web con FastHTML

Sep 6th, 2024
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. # pip install python-fasthtml
  2.  
  3. from fasthtml.common import FastHTML, serve, Html, Head, Title, Body, Div, A, Img, Br
  4. app = FastHTML()
  5.  
  6. @app.get('/')
  7.  
  8. def home():
  9.     pagina = Html(
  10.  
  11.         Head(Title('Mi Proyecto')),
  12.         Body(
  13.             Div('Bienvenido ! ',
  14.                 A('Web', href='http://nubecolectiva.com'),
  15.                 Br(),
  16.                 Img(src="https://nubecolectiva.com/img/logo.png"),
  17.                 cls='mi-clase'
  18.             )
  19.         )
  20.  
  21.     )
  22.     return pagina
  23.  
  24. serve()
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement