title: Django: send context to 'base.html'
body: <p>I have a nav bar item that is used to register/login. As, it's gonna be in different pages, I'm thinking of calling this form "once" for every page, in the 'base.html'.</p>
  
  <p>I've found about the 'context processor' (<a href="https://stackoverflow.com/questions/17901341/django-how-to-make-a-variable-available-to-all-templates">Django - How to make a variable available to all templates?</a>), however, as I can see, it passess only a variable to all templates, in a function (<strong>Doesn't</strong> use a View class, with get and post methods).</p>
  
  <p>For that, it uses a function like this one on the file:</p>
  
  <p><strong>view.py</strong>:</p>
  
  <pre><code>def categories_processor(request):
      categories = Category.objects.all()            
      return {'categories': categories}
  </code></pre>
  
  <p>However, I'm using Class Views in my views.py, and, generally, I do pass the 'request', 'url to be rendered', 'context'. Like this:</p>
  
  <p><strong>view.py</strong>:</p>
  
  <pre><code>class RegistroClienteView(View):
      def get(self, request):
          ls_tipos_de_documento = TipoDocumento.objects.values_list('id', 'nombre_corto')
          form = ClienteCreationForm()
          context = {'form': form, 'ls_tipos_de_documento': ls_tipos_de_documento}
          return render(request, 'app_cliente/frontend/ingreso.html', context)
  
      def post(self, request):
          ls_tipos_de_documento = TipoDocumento.objects.values_list('id', 'nombre_corto')
          form = ClienteCreationForm(request.POST)
          if form.is_valid():
              form.save()
              context = {'form': form}
              return render(request, 'app_cliente/frontend/ingreso.html', context)
  
          context = {'form': form, 'ls_tipos_de_documento': ls_tipos_de_documento}
          return render(request, 'app_cliente/frontend/ingreso.html', context)
  </code></pre>
  
  <p>My question is what to return in the View?</p>
  
  <p>After following the steps for seetting up the 'context-processor.py', in this file, I have:</p>
  
  <p>path: <em>app_cliente/context-processor.py</em></p>
  
  <p>File: <strong>context-processor.py</strong>:</p>
  
  <p><em>Please, notice that I'm only returning the context</em></p>
  
  <pre><code>from app_cliente.forms import ClienteCreationForm
  from django.views import View
  from nucleo.models.tipo_documento import TipoDocumento
  
  
  class RegistroClienteView(View):
      def get(self, request):
          ls_tipos_de_documento = TipoDocumento.objects.values_list('id', 'nombre_corto')
          form = ClienteCreationForm()
          context = {'form': form, 'ls_tipos_de_documento': ls_tipos_de_documento}
          return context
  
      def post(self, request):
          ls_tipos_de_documento = TipoDocumento.objects.values_list('id', 'nombre_corto')
          form = ClienteCreationForm(request.POST)
          if form.is_valid():
              form.save()
              context = {'form': form}
              return context
  
          context = {'form': form, 'ls_tipos_de_documento': ls_tipos_de_documento}
          return context
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <p>In my urls.py, in which url should this View called from?</p>
  
  <p>Is this the correct approach?</p>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>Let me clarify my question using this example posted in the comments:</p>
  
  <pre><code>url(r'^any-url-i-want/$', RegistroClienteView.as_view(), name='any-name-i-want'),
  </code></pre>
  
  <p>Here, <code>RegistroClienteView.as_view()</code> would render which template??? Remember that it only returns a context in the <code>context_processor.py</code> file.</p>