Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

232
Vistas
render() takes exactly 2 arguments (1 given)

I am getting the error "render() takes exactly 2 arguments (1 given)" after migrating my application to new server. Here is content of my urls.py file:

urlpatterns = [
    url(r'^admin/', admin.site.urls),
        url(r'^warlist/', include('warlist.urls')),
        url(r'^warlist/(?P<path>.*)$', serve,{'document_root': settings.MEDIA_ROOT}),
]

and in my views.py i am doing below:

 template = loader.get_template('warlist/index.html')
 image = loader.get_template('warlist/image.html')
 table = loader.get_template('warlist/welcomepage_table.html')
 info = loader.get_template('warlist/info.html')
 return HttpResponse(image.render()+ template.render()+info.render()+table.render()+info_str+table_str)

The above application is working fine in my old server with given code.

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

When you call render():

 return HttpResponse(image.render()+ template.render()+info.render()+table.render()+info_str+table_str)

You need to pass the context into the render() method.

over 4 years ago · Santiago Trujillo Denunciar

0

It means that .render() expects an argument. The 1 given is the object on which you call the method. For instance image.render() will have the definition def render(self, argument): where the self is the image object on which you call the method.

over 4 years ago · Santiago Trujillo Denunciar

0

render takes something like this

return render(request,'template_name.html',context)

if you are trying to use HttpResponse. create one html file and the rest you want to include, include them like this include('addition.html') in your 'template_name.html' and then return the HttpResponse.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda