next.js, nginx, reverse-proxy, ssl
$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt
class UserLogin(APIView): | |
permission_classes = [AllowAny] | |
authentication_classes = [] | |
user = None | |
def call_login(self): |
REST_FRAMEWORK = { | |
'DEFAULT_PERMISSION_CLASSES': ( | |
'rest_framework.permissions.IsAuthenticated', | |
), | |
'DEFAULT_AUTHENTICATION_CLASSES': ( | |
'budgeter_api.shared.auth.JWTAuthentication', | |
), | |
'DEFAULT_RENDERER_CLASSES': ( | |
'rest_framework.renderers.JSONRenderer', | |
), |
import datetime | |
import jwt | |
from django.conf import settings | |
from django.core.exceptions import ObjectDoesNotExist | |
from rest_framework import authentication, exceptions | |
from user.models import User | |
import json | |
from django.contrib.auth.models import User | |
from rest_framework.authentication import BaseAuthentication | |
from pamoja_admin.shared.auth.enc_dec import decrypt | |
class TokenAuthentication(BaseAuthentication): | |
def authenticate(self, request): |
_carriers = { | |
'Tigo Tanzania': ['071', '065', '067'], | |
'Airtel Tanzania': ['078', '068', '069'], | |
'Vodacom Tanzania': ['075', '076', '074'], | |
'TTCL': ['073'], | |
'Halotel': ['061', '062'], | |
'Zantel': ['077'], | |
} | |
import 'package:flutter/material.dart'; | |
import 'image.dart'; | |
class ImageCarousel extends StatefulWidget { | |
final List images; | |
const ImageCarousel({Key? key, required this.images}) : super(key: key); | |
@override |