I have a site that relies on checking if a cookie exists for service_id
and if it does checks if you can upload files for service... this works nicely offline but on pushing changes to server it created a bug where even though the cookie can be seen (on the dev console)
and I assign the cookie to a context variable which ends up saying None
even though I can see the cookie from the dev console.
class PictureCreateView(CreateView):
model = Picture
fields = "__all__"
template_name = 'accounts/upload-file.html'
def get_context_data(self, **kwargs):
context = super(PictureCreateView, self).get_context_data(**kwargs)
context['service_id'] = self.request.COOKIES.get('service_id', None)
return context
on the template
{% if service_id %}
#display form
{% else %}
Sorry it seems you're missing some vital data needed before ...
{% endif %}
any ideas?
here's a screen record (local & live): https://youtu.be/aud59Avp1aI
can you show the code where you set the cookie before retrieving it
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fd1f686b-dded-4aaa-8f6b-274419afa0a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/mSWmg0HVxz0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMGzuy-N_znhTLZqD0zc4ED78pFNAgCH3ns17eYR3ZR0xOrcyQ%40mail.gmail.com.
Best Regards,Samuel Muiruri.Web Designer
| +254 738 940064