-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Swahilipot-Hub-Developers/jilo
updated events management
- Loading branch information
Showing
86 changed files
with
1,125 additions
and
11,507 deletions.
There are no files selected for viewing
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
from django.contrib import admin | ||
from .models import Event | ||
|
||
# Register your models here. | ||
|
||
admin.site.register(Event) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class EventsConfig(AppConfig): | ||
class AuthenticationConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'events' | ||
name = 'authentication' |
File renamed without changes.
Binary file added
BIN
+175 Bytes
backend/authentication/migrations/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# authentication/serializers.py | ||
|
||
from django.contrib.auth.models import User | ||
from rest_framework import serializers | ||
|
||
class UserSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = User | ||
fields = ['id', 'username', 'email', 'password'] | ||
extra_kwargs = {'password': {'write_only': True}} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# authentication/urls.py | ||
|
||
from django.urls import path | ||
#from .views import CustomAuthToken, UserInfoView | ||
from .views import SignupView | ||
|
||
urlpatterns = [ | ||
# path('api-token-auth/', CustomAuthToken.as_view(), name='api_token_auth'), | ||
# path('user-info/', UserInfoView.as_view(), name='user_info'), | ||
path('SignUp/', SignupView.as_view(), name='SignUp'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# from django.shortcuts import render | ||
|
||
# # Create your views here. | ||
# # authentication/views.py | ||
|
||
# from rest_framework.authtoken.views import ObtainAuthToken | ||
# from rest_framework.authtoken.models import Token | ||
# from rest_framework.response import Response | ||
# from rest_framework.views import APIView | ||
# from rest_framework.permissions import IsAuthenticated | ||
|
||
# class CustomAuthToken(ObtainAuthToken): | ||
# def post(self, request, *args, **kwargs): | ||
# serializer = self.serializer_class(data=request.data, context={'request': request}) | ||
# serializer.is_valid(raise_exception=True) | ||
# user = serializer.validated_data['user'] | ||
# token, created = Token.objects.get_or_create(user=user) | ||
# return Response({'token': token.key, 'user_id': user.pk}) | ||
|
||
|
||
# class UserInfoView(APIView): | ||
# permission_classes = [IsAuthenticated] | ||
|
||
# def get(self, request): | ||
# return Response({'user_id': request.user.pk, 'username': request.user.username}) | ||
# authentication/views.py | ||
|
||
from rest_framework import generics | ||
from rest_framework.response import Response | ||
from rest_framework import status | ||
from .serializers import UserSerializer | ||
|
||
class SignupView(generics.CreateAPIView): | ||
serializer_class = UserSerializer |
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
""" | ||
ASGI config for backend2 project. | ||
ASGI config for backend project. | ||
It exposes the ASGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/ | ||
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.asgi import get_asgi_application | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend2.settings') | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') | ||
|
||
application = get_asgi_application() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
""" | ||
WSGI config for backend2 project. | ||
WSGI config for backend project. | ||
It exposes the WSGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/ | ||
https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend2.settings') | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') | ||
|
||
application = get_wsgi_application() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-854 Bytes
backend2/events/migrations/__pycache__/0001_initial.cpython-310.pyc
Binary file not shown.
Binary file removed
BIN
-632 Bytes
backend2/events/migrations/__pycache__/0002_alter_event_banner.cpython-310.pyc
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.