Re: logged in and got logout immediately upon reload the page

2020-02-26 Thread Roy Huang
Hi Naveen, thank you once again for the help after days of struggling, finally i've got enlightened all of a sudden ! to put it in simple way, we have a sync mechanism, which sync local code to production, and we've forgot to exclude db.sqlite3 which accounts resides -_- ... what a bummer

Django Image and File

2020-02-26 Thread Soumen Khatua
Hi Folks, Actually I have one image filed called profile_pic and another is file field called documents but I don't know what is best practise to store it. Most importantly how I can make each user details is unique. Thank you in advance Regards, Soumen -- You received this message because yo

Re: relation "django_session" does not exist

2020-02-26 Thread Naveen Arora
Run migrations all over the app again. Plus run -python manage.py syncdb On Thursday, 27 February 2020 06:39:31 UTC+5:30, Hella Nick wrote: > > Me to,My error was is > Traceback (most recent call last): > File > "D:\Python3\lib\site-packages\django\contrib\sessions\backends\base.py", > line 19

Re: logged in and got logout immediately upon reload the page

2020-02-26 Thread Naveen Arora
All you need to do is set AUTH_USER_MODEL = "Yourapp.yourmodelname" in your setttings.py, delete your entire database and run makemigrations and migrate again. Django sets the default user model at first migration only. Hope this helps, you can ask here for your queries. Cheers, Naveen Arora On

Re: Unidirectional association

2020-02-26 Thread Naveen Arora
Hi Manos, Kindly explain the scenario appropriately, What exactly are you trying to achieve? Also read - https://docs.djangoproject.com/en/3.0/topics/db/examples/many_to_many/ Cheers, Naveen Arora On Wednesday, 26 February 2020 20:05:00 UTC+5:30, Manos Zeakis wrote: > > Hi all > > I have crea

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: relation "django_session" does not exist

2020-02-26 Thread Hella Nick
Me to,My error was is Traceback (most recent call last): File "D:\Python3\lib\site-packages\django\contrib\sessions\backends\base.py", line 190, in _get_session return self._session_cache AttributeError: 'SessionStore' object has no attribute '_session_cache' During handling of the above e

Related Queryset filter

2020-02-26 Thread Malik Brahimi
class GridViewset(ModelViewSet): queryset = Grid.objects.all() serializer_class = GridSerial class ItemViewset(ModelViewSet): queryset = Item.objects.all() serializer_class = ItemSerial def get_queryset(self): if self.request.user.is_staff: return Item.obj

Re: Get last instance object per each month and sum per month in Django

2020-02-26 Thread Mario Bisiani
Thank you Agnese , Grazie! I will consider your prompt :-) Il giorno martedì 25 febbraio 2020 23:55:49 UTC+1, Agnese Camellini ha scritto: > > You should search how to make a group by activity and a partition by month > then take each partition and sum the record up, i don't know how to do it

Re: Get last instance object per each month and sum per month in Django

2020-02-26 Thread Mario Bisiani
Thank you a lot for your answer Simon! Your solution is very near to what I need. Next step to complete is to get latest date status per activity and then sum them up. With your code I can get the list for every status. Thank a lot any way! I feel I'm next to the solution :-) Il giorno mercole

Re: allauth- signup redirect

2020-02-26 Thread Tosin Ayoola
thanks i've fixed it, On Wed, Feb 26, 2020 at 8:33 AM Naveen Arora wrote: > Hi Tosin, > > > The simplest way would be to override the template account/signup.html with > your own copy. If you examine that template you will see the following > section: > > {% if redirect_field_value %}{% endif %}

Django values_list queryset returns queryset object instead of list

2020-02-26 Thread Santhosh sridhar
Hi, I have a table named View, I'm filtering values like this : views = View.objects.all().values_list('name',flat=True).order_by('id') I get the output as instead of list of the names. So I face error when try to parse it in jquery : jQuery.parseJSON(JSON.stringify("{{views|safe}}".replace(/'/

Re: consume Google API through REST API

2020-02-26 Thread New Django user
Thanks a lot, Naveen for sharing these tutorials. I will definitely go through them and let you know if I have any additional queries. On Wednesday, February 26, 2020 at 7:44:58 AM UTC-6, Naveen Arora wrote: > > Hi, > > Please refer here how to upload a file through Django - > https://www.geeks

Re: logged in and got logout immediately upon reload the page

2020-02-26 Thread Roy Huang
thanks Naveen wow, how did you even guess that !! yes I did have my own authentication model on top of the original one I will put up more detail first thing tomorrow at work, so glad somebody can help me out (crying ~~) Roy Naveen Arora於 2020年2月26日星期三 UTC+8下午9時46分32秒寫道: > > Hi Roy, > >

Unidirectional association

2020-02-26 Thread Manos Zeakis
Hi all I have created two classes. Instances of class A are timeless and instances of class B are different each year. Each instance of class B is associated with an instance of class A. So I suppose I should do something like this class A(models.Model): name = models.CharField(max_length=

Re: help me please

2020-02-26 Thread Kasper Laudrup
Hi Jana, On 26/02/2020 14.47, Janna_MaMa Rewview ICO wrote: Hello friends. I want to build an extra member application for telegram. but I just knew python. Does anyone guide me to code it? thanks! You are asking the wrong place. This is for Django users which has nothing to do with Telegra

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 simple

help me please

2020-02-26 Thread Janna_MaMa Rewview ICO
Hello friends. I want to build an extra member application for telegram. but I just knew python. Does anyone guide me to code it? thanks! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails f

Re: logged in and got logout immediately upon reload the page

2020-02-26 Thread Naveen Arora
Hi Roy, Share the exact problem with screenshots and code if possible. Did you set default authentication model of user to yours..? Cheers, Naveen Arora On Wednesday, 26 February 2020 18:00:10 UTC+5:30, Roy Huang wrote: > > Hi all, > > any help will be appreciated, i've bee stuck on this for da

Re: consume Google API through REST API

2020-02-26 Thread Naveen Arora
Hi, Please refer here how to upload a file through Django - https://www.geeksforgeeks.org/python-uploading-images-in-django/. Might be this tutorial of mine help you - https://www.geeksforgeeks.org/python-django-google-authentication-and-fetching-mails-from-scratch/ You can ask here too anytim

Re: Admin login problem

2020-02-26 Thread Naveen Arora
Share all of the code related to this model what you have overriden from nodel to admin registeration part also. Also check through terminal if superuser has been created successfully. Did you override something related to login part too..? Share code please. On Wednesday, 26 February 2020 17:5

logged in and got logout immediately upon reload the page

2020-02-26 Thread Roy Huang
Hi all, any help will be appreciated, i've bee stuck on this for days, couldnt find answers ok, here it is, 1) logged in and retrieved data back to a page, all good (got sessionid and csrftoken) 2) make a request on a view which has got @login_required, then got redirect to login (apparently

consume Google API through REST API

2020-02-26 Thread New Django user
I am new to Django and building a simple webpage where the user can upload a file and then that file will be processed using Google API. I am done with creating a user login page but not sure how to start with the 2nd part i.e. file upload and Google API. Can anyone help me or suggest some tuto

Re: Admin login problem

2020-02-26 Thread Naveen Arora
Hi soumen, Are you overriding default user model, if yes check user.is_admin=True. or else, Please post the exact error Cheers Naveen Arora On Wednesday, 26 February 2020 17:43:51 UTC+5:30, Soumen Khatua wrote: > > Hi Folks, > after creating superuser by using this command python manage.py > c

Admin login problem

2020-02-26 Thread Soumen Khatua
Hi Folks, after creating superuser by using this command python manage.py createsuperuser. Whenever I'm entering the same(exact) login credentials.I'm getting this error: Please enter the correct phone number and password for a staff account. Notethat both fields may be case-sensitive .

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 thi

Re: send django channels 2 messages to an individual user who might have more than one browser tab or device connected

2020-02-26 Thread Andréas Kühne
First of all - if you are writing something new - use the latest versions of everything. You shouldn't develop for django 2.2 now - but rather 3.0. The same goes for python and django channels. Make sure you start with the latest versions of everything. Django won't be the issue for what you are p

Re: send django channels 2 messages to an individual user who might have more than one browser tab or device connected

2020-02-26 Thread Levent Engin
Hi Andreas; The Channels2 system that we are using is for connecting couriers to their working customers. This is planned to be a large system using Channels2, which is in pilot phase now. When a courier is connected to channels we create a a database filed to keep the user_name and chan

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 sav

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 sav