Re: redirect authenticated user in CreateView

2019-09-25 Thread Randy Hughes
from django.shortcuts import HttpResponseRedirect class ExampleView(TemplateView): template_name = 'pages/example.html' def get(self, request): if not request.user.is_authenticated: return HttpResponseRedirect('login') On Wed, Sep 25, 2019 at 1:09 PM saeed albooyeh wrote: > hi > i used Create

Re: Django - How to add a link to a table that will open another page(django app) from an html template and pass a variable with it.

2019-09-25 Thread Randy Hughes
views.py class *viewLit*(TemplateView): def get(self, request, strategy=None): circuit_id = self.request.query_params.get('circuitid', None) urls.py path('viewlit/', viewlit.as_view(), name='viewlit') search_custom.html {{ circuit.circuitid }} ''' this is an example using a query paramet