Coder Social home page Coder Social logo

incomeexpensesapi's Introduction

Income Expenses API

Installation steps

  1. Ensure you have python3 installed

  2. Clone the repository

  3. create a virtual environment using virtualenv venv

  4. Activate the virtual environment by running source venv/bin/activate

  • On Windows use source venv\Scripts\activate
  1. Install the dependencies using pip install -r requirements.txt

  2. Migrate existing db tables by running python manage.py migrate

  3. Run the django development server using python manage.py runserver

incomeexpensesapi's People

Contributors

crycetruly avatar jewells07 avatar onuvob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

incomeexpensesapi's Issues

I can't delete users even with superuser access

This error comes up:

Cannot delete user
Deleting the selected user would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:

outstanding token

How do I fix this? Thanks!

RegisterView

I fond an issue in your RegisterView view in authentication app, even if the data is not valide i find the user in my admin User model.

"invalid token" or "session_expired" occurs in order to verify the email by using your code.

kindly help me how to solve the issue to verify the email.:
@swagger_auto_schema(manual_parameters=[token_param_config])
def get(self, request):
token = request.GET.get('token')
try:
payload = jwt.decode(token, settings.SECRET_KEY)
user = User.objects.get(id=payload['user_id'])
if not user.is_verified:
user.is_verified = True
user.save()
return Response({'email': 'Successfully activated'}, status=status.HTTP_200_OK)
except jwt.ExpiredSignatureError as identifier:
return Response({'error': 'Activation Expired'}, status=status.HTTP_400_BAD_REQUEST)
except jwt.exceptions.DecodeError as identifier:
return Response({'error': 'Invalid token'}, status=status.HTTP_400_BAD_REQUEST)

Verify Email View

Hello Cryce

I am getting an 'Invalid Token' error with my VerifyEMail

I do get an email with a verification link - but when i follow the link it keeps throwing the 'Invalid Token'

My code below :

class VerifyEmail(views.APIView):
     
    serializer_class  = EmailVerificationSerializer
    token_param_config = openapi.Parameter('token',in_ = openapi.IN_QUERY, description='Description', type = openapi.TYPE_STRING)
    
    @swagger_auto_schema(manual_parameters=[token_param_config])
    def get(self,request):
        token = request.GET.get('token')
        try:
            payload = jwt.decode(token,settings.SECRET_KEY)
            user = User.objects.get(id=payload['user_id'])
            
            if not user.is_verified: 
                user.is_verified = True
                user.save()        
            return Response({'email':'Successfully activated'},status=status.HTTP_200_OK)
        
        except jwt.ExpiredSignatureError as indentifier:
            return Response({'error':'Activation Expired'},status=status.HTTP_400_BAD_REQUEST)
        except jwt.exceptions.DecodeError as indentifier:
            return Response({'error':'Invalid Token'},status=status.HTTP_400_BAD_REQUEST)

Login Issues

The LoginSerializer raises "Invalid credentials" even though the username is in the database. Kindly check it.
Also, line 88 if the loginserializer raises an "unreachable code error" for the "return Super().validate(attrs).
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.