Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

300
Views
¿Cómo paso correctamente la dirección IP del servidor en el parámetro de formulario?

Tengo una aplicación escrita en fastapi e implementada en el servidor ubuntu usando uvicorn y supervisor. El comando uvicorn main:app --host 0.0.0.0 --port 8000 inicia la aplicación. Y tengo acceso a la aplicación en la dirección

 myserver_ip:8000

La aplicación tiene un formulario que (GET) se muestra en

 http://myserver_ip:8000/file/ @router.get("/file/") async def file_receive(): content = """ <body> <form action = "http://0.0.0.0:8000/image/uploadfile/" enctype="multipart/form-data" method="post"> <input name="file" type="file" multiple> <input type="submit"> </form> </body> """ return HTMLResponse(content=content)

El parámetro de acción es http://0.0.0.0:8000/image/uploadfile/ pero después de la redirección del formulario, no voy a la página http://myserver_ip:8000/image/uploadfile/. El mismo resultado si configuro action = http://localhost:8000/image/uploadfile/

por supuesto, si configuro la variable de acción directamente = http://myserver_ip:8000/image/uploadfile/ todo comienza a funcionar. Pero entonces no hay forma de ejecutar este código en una máquina local. ¿Cómo configuro la redirección correctamente?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

¿Por qué no usas una URL relativa?

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!