Re: Django Session KeyError

2020-02-26 Thread Naveen Arora
Are you using SESSION_COOKIE_DOMAIN in your settings.py ? Are you on local server only ? Are you logged in while maintaining a session ? Have you run the migrate command ? Without makemigrations and migrate properly session doesn't work ! Run manage.py syncdb from the command line. References -

Re: Django Session KeyError

2020-02-26 Thread Guy NANA
I checked request.session for simple string (by adding *request.session['func_views'] = 'upload_local_dataset' in the upload_local_dataset view*) but it is always have an empty request.session in the second view. Le mercredi 26 février 2020 11:14:23 UTC+1, Naveen Arora a écrit : > > this

Re: Django Session KeyError

2020-02-26 Thread Naveen Arora
this simple means request.session is empty in the view you are trying to access it. Can you test request.session for simple strings if it is working at all. need to checkout what exact problem is. For reference check out - https://docs.djangoproject.com/en/3.0/topics/http/sessions/. One more

Re: Django Session KeyError

2020-02-26 Thread Guy NANA
Hi! Please find bellow the outputs. When I was using sessions stored in cache (specially in Memcached) all things were working good until I wanted to upload a data set with larger volume of data : it wasn't be possible to put them in cache. Training dataset uploaded : Coffee training dataset

Re: Django Session KeyError

2020-02-26 Thread Guy NANA
Hi! Please find bellow the outputs. When I was using sessions stored in cache (specially in Memcached) all things were working good until I wanted to upload a data set with larger volume of data : it wasn't be possible to put them in cache. Training dataset uploaded : Coffee training dataset

Re: Django Session KeyError

2020-02-26 Thread Guy NANA
Hi! Please find bellow the outputs. When I was using sessions stored in cache (specially in Memcached) all things were working good until I wanted to upload a data set with larger volume of data : it wasn't be possible to put them in cache. Training dataset uploaded : Coffee training dataset

Re: Django Session KeyError

2020-02-25 Thread Naveen Arora
Hi, please post the output of debugging the above, print after and before in these views and also check is something else is working using request.session. @csrf_exempt def upload_local_dataset(request): if request.method == 'POST': dataset =

Re: Django Session KeyError

2020-02-25 Thread Guy NANA
Hi! Yes, it is. INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'tsanalysisapp.apps.TsanalysisappConfig', # Django Rest Framework -

Re: Django Session KeyError

2020-02-25 Thread Juan Pablo Romero Bernal
Hi, In your Django application, session middleware is enabled ? [1] [1] https://docs.djangoproject.com/en/3.0/topics/http/sessions/ On Tue, Feb 25, 2020 at 8:16 AM Guy NANA wrote: > I don't understand the first part of your answer : *Make sure your >> line request.session['ts_dataset_copy'],

Re: Django Session KeyError

2020-02-25 Thread Guy NANA
> > I don't understand the first part of your answer : *Make sure your > line request.session['ts_dataset_copy'], print anything above it.* For sending dataset file from angular app to django, I've used a post request. The matter is that when I send the second http crosss-origin from angular

Re: Django Session KeyError

2020-02-25 Thread Pankaj Sharma
Make sure your line request.session['ts_dataset_copy'], print anything above it, also make sure you are using POST method in forms (method = "post") On Tuesday, February 25, 2020 at 3:47:25 AM UTC+5:30, Guy NANA wrote: > > I have an angular frontend app which send file to django backend which

Django Session KeyError

2020-02-24 Thread Guy NANA
I have an angular frontend app which send file to django backend which data is setting in django session. After I send a httprequest to django backend to make ML tratements on that data and get the results. But I've a 500 sever error: keyerror 'ts_dataset_copy': KeyError: 'ts_dataset_copy'