Re: Help me out please

2020-06-20 Thread Alison Mukoma
Hey,

What you need first off will be a geo active db backend,  for that I will
advise you use something like this

Url: https://hub.docker.com/r/kartoza/postgis/

It's a postgres GIS powered db backend,  from there you can design your
models to hold any location type I.e as polygon, multipolygon, lat, long,
specifying of SRID for your map etc, line type etc and you will have all
capacity to search by coordinates and all.

>From there the rest should be convenient to accomplish.

Regards,
Alison

On Sat, 20 Jun 2020, 10:41 Vishesh Mangla, 
wrote:

> Easiest solution
>
> https://www.w3schools.com/html/html5_geolocation.asp
>
>
>
> Otherwise GeoDjango might have something
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *meera gangani 
> *Sent: *20 June 2020 14:03
> *To: *django-users@googlegroups.com
> *Subject: *Help me out please
>
>
>
> Hello ,
>
>
>
> I am working on attendance module in HR Project, So I implement
> something new, so as employee enter in the office and login to his system
> and click on to the check-in button his/her attendance will be marked,
>
>
>
>So that's why we need Map APi, First of all we want to find Longitude
> and latitude of our building, so we can mark his/her attendance,  so please
> can you help me out in troubled situation
>
>
>
> At least you can give some sort of idea of what I will use to
> implement this
>
>
>
> Thanking you in advance
>
> -Meera Gangani
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANaPPPJkTDyd%3DPdW5SoaVCwaKB%2BJKv0kqnid4EXFwYrrPF1X7g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANaPPPJkTDyd%3DPdW5SoaVCwaKB%2BJKv0kqnid4EXFwYrrPF1X7g%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/805D1B9A-9026-46DB-B917-22F7357D325C%40hxcore.ol
> <https://groups.google.com/d/msgid/django-users/805D1B9A-9026-46DB-B917-22F7357D325C%40hxcore.ol?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKLADicxVwTpZytqv6NvtbPwHAc8zt-Fmr4TK%3DGaasHxfHDnRw%40mail.gmail.com.


Re: Blog application

2019-04-01 Thread Alison Mukoma
Hello Thomas,

Pehaps the first thing would be to link your model to your prefered User
model, Django provides you with a default though.
And then you can play with the ORM querysets to filter currently active
user related entries.

But we could be more helpful if you shared more details on your
implementation.

Thanks,
Alison

On Mon, Apr 1, 2019 at 2:19 PM Omar Abou Mrad 
wrote:

> Dear Thomas,
>
> A little bit more information would give us more insight on how to help
> you.
>
> What are you currently struggling with?
> Can you show us your models code?
>
> Regards,
>
> On Mon, Apr 1, 2019 at 3:03 PM Thomas Mathias 
> wrote:
>
>> Hello guys i have a django blog app and wanted to fetch all the post of
>> the logged in user such that he is able to delete them.help guys
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@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/d8223d5e-d22a-47a5-89de-e72b8247f38a%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/d8223d5e-d22a-47a5-89de-e72b8247f38a%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/CAFwtXp0XZ_wBw05DxUQgzRwNit3gzhK1PM8OhEubxZZAYwA6vA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFwtXp0XZ_wBw05DxUQgzRwNit3gzhK1PM8OhEubxZZAYwA6vA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAKLADicg943CDVFa92iZ9RyZEO0-aigpb%2BF2PnDfZ%3DmkcPJ6SA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to read and parse the csv files using pandas in django

2019-03-28 Thread Alison Mukoma
Hi,

It seems that to achieve that you need to put up a django project and maybe
a seperate app for best practices
where you can write that code in views and send your data to templates as
context variables then after put up your routing in URLs
and you can design your dashboard as you like it.

On Thu, Mar 28, 2019 at 1:34 PM naga lokesh 
wrote:

> I have normal python code to plot the graphs for csv data(data
> visualisation).But I need code in django and graphs should display on
> dashboard...
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/1f9488c2-3cb1-4d24-8969-7b320f7ad907%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAKLADieBX-OZYV1u9x3Z%2BFdOzv_df-swV9Q6pQXokJSKCsDCqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Lead Architect / CTO ( Hands on ) - Start Up - Cambridge - 3 Days remote working

2019-03-28 Thread Alison Mukoma
Hi

I would like to help regarding your need for a python engineer.

Kind regards,
Alison

On Thu, Mar 28, 2019 at 1:46 PM Serdar Emirci  wrote:

>
> Hello,
> I would like to help if someone can communicate in Turkish.
>
>
>
> Serdar EMIRCI
>
>
>  adresine sahip kullanıcı 28 Mar 2019 Per, 14:34
> tarihinde şunu yazdı:
>
>> Hi Everyone,
>>
>> I am looking for a candidate who has architectural experience in building
>> a Platform in Python Django.
>>
>> *Software Architect – Part Remote - (Python Django) – Start **Up *
>>
>>
>>
>> £65,000 - £75,000 depending on experience
>>
>> Cambridge
>>
>> Permanent
>>
>>
>>
>>
>>
>> We have established a firm partnership with a really exciting start up
>> that’s going to revolutionise their market.  The company are looking for a
>> candidate to come in and help build a ground-breaking platform that is
>> going to modernise the agricultural sector. This technology is going to
>> bring a once slow-moving market into the 21st century. It’s a very
>> exciting opportunity for anyone who is a team lead or has thought about
>> being a team lead. The perfect candidate will be from an architectural
>> background with lead experience or ambitions to lead a team.
>>
>>
>>
>> They are looking for some with a strong development background in Python
>> Django. The ideal candidate is someone with previous experience in
>> developing backend creating web applications but also has an interest in
>> Machine Learning. The role will entail a very hand son approach to start
>> and as the team grows it will move more into a line management role. If you
>> have some front-end experience it would also be a bonus.
>>
>>
>>
>> A successful candidate must be skilled in:
>>
>> ·Strong experience of creating web applications in Python Django
>>
>> ·Understanding of REST API and GraphQL development
>>
>> ·Experience with Amazon Web Services Or Google Cloud
>>
>> ·Experience in Machine Learning or want to gain the experience
>>
>> ·Understanding of container technology such as Docker
>>
>> ·Architectural Background
>>
>>
>> Desirables:
>>
>> ·Experience with full stack development – React or React Native
>>
>> ·Understanding of blockchain technologies
>>
>> ·Had Open source experience
>>
>> ·Team Lead Experience
>>
>>
>>
>> The Company has really got hold of something really exciting with this
>> platform. This role is perfect for anyone who is looking for a new
>> challenge or is thinking about developing themselves further. They have a
>> beautiful new office in Cambridge with the potential to grow further. After
>> meeting with them you get a real feeling that they are a fantastic company
>> to work for and their benefits package is also very attractive.
>>
>>
>>
>> If you are interested in applying for this role, please email
>> sc...@socode.co.uk.
>>
>>
>> If you email I am more than happy to get the full spec over to you and
>> more information about the company.
>>
>>
>> Best wishes
>>
>> Scott
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@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/f4c094df-1781-45e4-8087-14566ba12f61%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/f4c094df-1781-45e4-8087-14566ba12f61%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/CACUOqnYbLaF2Oy2m%3DistRP4umTTxAnh39w6K3SdOJPeR0w7bAQ%

Re: Looking for a Django Co-Founder.

2019-02-01 Thread Alison Mukoma
Hello Zack,
Perhaps we could all meet using zoom which is also free and effective.
we may only need a meeting room/link for the active meeting and all will be
able to join on the scheduled timestamp.

Thanks,
Alison

On Fri, Feb 1, 2019 at 6:27 PM 'Amitesh Sahay' via Django users <
django-users@googlegroups.com> wrote:

> Hello Zack,
>
> I have been saying that I am interested since one month now. Still you
> keep asking the same question. Please schedule a conference call with all
> the interested stakeholder. There are many free online software that allows
> conference call free of cost e.g. SKYPE.
>
> Let me know. My number is already in my signature you may text me at your
> convenience.
>
> Regards,
> Amitesh Sahay
> *91-750 797 8619*
>
>
> On Tuesday, 22 January, 2019, 8:44:42 AM IST, Zack Amaral <
> zack.j.ama...@gmail.com> wrote:
>
>
> Django Community,
>
> Hey you guys, I'm trying to build a platform as a service similar to
> twitch.tv, are their any django developers out there that would be
> interested in co-founding my company and helping me develop a MVP to get a
> seed round of funding? If you're interested I can send you a link to my
> business plan and UI/UX Design.
>
> Respectfully,
>
> Zack Amaral
> We Love Music, LLC
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/894392e9-e171-47fd-9f2b-17335c7b9189%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/894392e9-e171-47fd-9f2b-17335c7b9189%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@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/1806414169.1549192.1549038453218%40mail.yahoo.com
> <https://groups.google.com/d/msgid/django-users/1806414169.1549192.1549038453218%40mail.yahoo.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/CAKLADicjFY-Og97HA%2BypYt8aimOttQMaK9%2BVpOhXaWPGz_HZ9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Looking for a Django Co-Founder.

2019-01-31 Thread Alison
Hi Zack,

Yes I am still interested.

Thanks
Alison

On Sunday, November 18, 2018 at 12:29:14 AM UTC+2, Zack Amaral wrote:
>
> Hi,
>
> I have an idea for a next generation PaaS. I was wondering if there are 
> any Django developers that would be interested in being a co-founder with 
> my company. I'm an AWS Architect but sadly a really bad developer. If 
> there's anybody on this forum that would be interested please let me know 
> and we can setup a time to talk about the details of the project.
>
> Thanks,
>
> Zack
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/fdad48fe-765d-4585-941a-67bb4f1a6f45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django API requests

2019-01-31 Thread Alison
Hi all, I use Django mostly and recently started working with APIs, I am 
trying to use the cat API 

https://cataas.com/ and get cats by tag like cute, brown ... from within 
Django but I seem to be getting errors even when I try with postman testing 
tool, as well as after authenticating with my username and password.

Anyone with advise on how I can get the api to work?
Thank you in advance

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/c6759dc2-6b8a-41de-a6dd-0eac7e0b9a5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Looking for a Django Co-Founder.

2018-11-18 Thread Alison Mukoma
Hi,

I am a python dev and use django a lot,
I would like to be part of this.

Alison Mukoma

On Sun, Nov 18, 2018 at 9:13 PM ALLAN NJOROGE 
wrote:

> Hey Zack,
>
> I am available, my question is are you looking for just django developers
> or any one who has the same motivation to see something through despite the
> means? I’m a crapy developer but i get things done.
>
> On Sun, Nov 18, 2018 at 12:04 PM Zack Amaral 
> wrote:
>
>> What time are you available today?
>>
>> On Sun, Nov 18, 2018 at 12:03 PM Erol DEMİRHAN 
>> wrote:
>>
>>> Hi Zack,
>>>
>>> I'm interested in setting up a video conference whenever you and other
>>> people are available. We'd better set an hour for the meeting.
>>> By the way can we use Slack app for the communication? If everybody okay
>>> with that?
>>>
>>> Sincerely
>>>
>>> Erol DEMİRHAN
>>>
>>> On Sun, 18 Nov 2018 at 06:17, Zack Amaral 
>>> wrote:
>>>
>>>> Let me know if you guys are interested in setting up a video
>>>> conference. I'd love to tell you more about it. I can show you the UI/UX
>>>> I've been working on.
>>>>
>>>> Thank you for your consideration,
>>>>
>>>> Zack Amaral
>>>>
>>>> On Sat, Nov 17, 2018 at 8:10 PM Zack Amaral 
>>>> wrote:
>>>>
>>>>> Erol,
>>>>>
>>>>> Here's a link to the plan:
>>>>> https://app.liveplan.com/accept-invitation?ic=107ef0ab-8bc5-4b9d-aeea-bf72324a0261
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Zack Amaral
>>>>>
>>>>> On Sat, Nov 17, 2018 at 8:04 PM Erol DEMİRHAN 
>>>>> wrote:
>>>>>
>>>>>> Hi Zack,
>>>>>>
>>>>>> My name is Erol DEMIRHAN,
>>>>>>
>>>>>> I received your email. It sounds interesting. I'm waiting for
>>>>>> your reply about the details of the project.
>>>>>>
>>>>>> Sincerely
>>>>>>
>>>>>> On Sun, 18 Nov 2018 at 05:32, Lucas G. Navarro <
>>>>>> lucasgnava...@gmail.com> wrote:
>>>>>>
>>>>>>> Hi! How are you? Can you tell us more about this?
>>>>>>>
>>>>>>> Regards!
>>>>>>>
>>>>>>> El sáb., 17 nov. 2018 7:29 PM, Zack Amaral 
>>>>>>> escribió:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I have an idea for a next generation PaaS. I was wondering if there
>>>>>>>> are any Django developers that would be interested in being a 
>>>>>>>> co-founder
>>>>>>>> with my company. I'm an AWS Architect but sadly a really bad 
>>>>>>>> developer. If
>>>>>>>> there's anybody on this forum that would be interested please let me 
>>>>>>>> know
>>>>>>>> and we can setup a time to talk about the details of the project.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> Zack
>>>>>>>>
>>>>>>>> --
>>>>>>>> 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+unsubscr...@googlegroups.com.
>>>>>>>> To post to this group, send email to django-users@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/987d359b-263b-4ecf-957c-f2537f2d4ad1%40googlegroups.com
>>>>>>>> <https://groups.google.com/d/msgid/django-users/987d359b-263b-4ecf-957c-f2537f2d4ad1%40googlegroups.com?utm_medium=email_source=footer>
>>>>>>>> .
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>

Re: Authentication backend - serialization

2017-06-08 Thread Alison P
Hi!

Ludovic, Melvyn, thank you for your responses. I could not make Melvyn's 
example work for me, but it put me on the right track.

Solution: right under the "reset the one time password" comment, add the 
line "user.backend = 'path.to.OneTimePasswordBackend' ", and everything 
works as it should be! 

Have a nice day!
A.

On Monday, June 5, 2017 at 1:33:28 PM UTC+2, Alison P wrote:
>
> Hi everyone,
>
> I have written a custom authentication backend, the code is below. It 
> allows a user to click "email me a one-time password" on the home page, 
> which is saved on the "Person" model (which extends User through a foreign 
> key) and then log in with that password. This backend verifies the password 
> and then erases it from the database. 
> This whole thing works when I put 
> SESSION_SERIALIZER='django.contrib.sessions.serializers.PickleSerializer' 
> in settings.py, but I don't want that since PickleSerializer is unsafe. 
>
> If I use the default session serializer, I get the following error: 
> TypeError at /login/ 
>
>  is not JSON serializable
>
>
> how do I solve this? Do I need to write a custom serializer, and if yes, 
> how? Can I add serialize/deserialize methods on this class, and what 
> exactly do they need to do? Do they need to be classmethods or something?
>
> I would really appreciate some help with this. Thanks in advance!
>
> from django.contrib.auth.models import User
> from allauth.account.models import EmailAddress
> from passlib.hash import pbkdf2_sha256
> from api import models
> from base.settings import ACCOUNT_PASSWORD_MIN_LENGTH
>
> class OneTimePasswordBackend(object):
> def authenticate(self, email=None, one_time_password=None):
> if len(one_time_password) < ACCOUNT_PASSWORD_MIN_LENGTH or 
> one_time_password==None:
> return None
> try:
> email_obj = EmailAddress.objects.get(email=email)
> except EmailAddress.DoesNotExist:
> return None
> user = email_obj.user
> person = models.Person.objects.get(user_account=user)
> saved_pw = person.one_time_password
> try:
> verify = pbkdf2_sha256.verify(one_time_password, saved_pw)
> except Exception as e:
> print(e)
> verify = False
> else:
> """reset the one time password"""
> person.one_time_password = ""
> person.save()
> return user
> return None
>
> def get_user(self, user_id):
> try:
> return User.objects.get(pk=user_id)
> except User.DoesNotExist:
> return None
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/98447391-5986-4986-b025-1e1a0aa9e462%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Authentication backend - serialization

2017-06-05 Thread Alison P
Hi everyone,

I have written a custom authentication backend, the code is below. It 
allows a user to click "email me a one-time password" on the home page, 
which is saved on the "Person" model (which extends User through a foreign 
key) and then log in with that password. This backend verifies the password 
and then erases it from the database. 
This whole thing works when I put 
SESSION_SERIALIZER='django.contrib.sessions.serializers.PickleSerializer' 
in settings.py, but I don't want that since PickleSerializer is unsafe. 

If I use the default session serializer, I get the following error: 
TypeError at /login/ 

 is not JSON serializable


how do I solve this? Do I need to write a custom serializer, and if yes, 
how? Can I add serialize/deserialize methods on this class, and what 
exactly do they need to do? Do they need to be classmethods or something?

I would really appreciate some help with this. Thanks in advance!

from django.contrib.auth.models import User
from allauth.account.models import EmailAddress
from passlib.hash import pbkdf2_sha256
from api import models
from base.settings import ACCOUNT_PASSWORD_MIN_LENGTH

class OneTimePasswordBackend(object):
def authenticate(self, email=None, one_time_password=None):
if len(one_time_password) < ACCOUNT_PASSWORD_MIN_LENGTH or 
one_time_password==None:
return None
try:
email_obj = EmailAddress.objects.get(email=email)
except EmailAddress.DoesNotExist:
return None
user = email_obj.user
person = models.Person.objects.get(user_account=user)
saved_pw = person.one_time_password
try:
verify = pbkdf2_sha256.verify(one_time_password, saved_pw)
except Exception as e:
print(e)
verify = False
else:
"""reset the one time password"""
person.one_time_password = ""
person.save()
return user
return None

def get_user(self, user_id):
try:
return User.objects.get(pk=user_id)
except User.DoesNotExist:
return None

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/69b91fa4-aca9-458e-9a83-d7b3d3ac35f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.