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

117
Vistas
csrftoken tag not working after upgrade to Django 1.11

I have inherited a Django app that I initially got working on Django 1.9. Recently I have migrated it to Django 1.11 and Python 3.4 (from 2.7). Since then, some admin view that I have has started failing with a 403 Forbidden error, CSRF verification failed. I looked at the documentation, and checked the following things:

  1. I'm still using MIDDLEWARE_CLASSES, but django.middleware.csrf.CsrfViewMiddleware is included in my configuration (it's second, after SessionMiddleware and CommonMiddleware).
  2. The template used includes the {% csrf_token %} stuff.
  3. The view uses render_to_response(), and passes RequestContext(request) as the third argument to it.

(None of these changed during or after the Django/Python upgrades, as far as I know.)

I'm not that experienced with Django, although I have quite a bit of Python web programming experience. What am I missing/how could I debug further?

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

0

The context_instance parameter was deprecated in 1.8 and was subsequently removed in 1.10. If you need the request in the context, use render() instead and pass the request as the first argument. You should pass the context as a plain dictionary in the third parameter.

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