Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Merge branch 'api-testing-branch-voor-axel' into api-working
Browse files Browse the repository at this point in the history
  • Loading branch information
PJDeSmijter committed Mar 12, 2024
2 parents 88a52a1 + 59723ce commit dd0110b
Show file tree
Hide file tree
Showing 20 changed files with 1,532 additions and 262 deletions.
4 changes: 2 additions & 2 deletions backend/pigeonhole/apps/users/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.models import AbstractUser, UserManager
from django.db import models
from rest_framework import serializers

Expand All @@ -19,7 +19,7 @@ class User(AbstractUser):
course = models.ManyToManyField(Course)
role = models.IntegerField(choices=Roles.choices, default=Roles.ADMIN)

objects = models.Manager()
objects = UserManager()

class Meta(AbstractUser.Meta):
db_table = "auth_user"
Expand Down
19 changes: 11 additions & 8 deletions backend/pigeonhole/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.contrib import admin
from django.urls import include, path
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import routers, permissions
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView

from backend.pigeonhole.apps.courses.views import CourseViewSet
from backend.pigeonhole.apps.groups.views import GroupViewSet
Expand Down Expand Up @@ -35,11 +36,13 @@
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
path('', include(router.urls)),
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
path("admin/", admin.site.urls),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
path('', include(router.urls)),
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
path("admin/", admin.site.urls),
path('auth/login/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
path('auth/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

urlpatterns += router.urls
2 changes: 1 addition & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bun dev

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
You can start editing the page by modifying `app/index.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

Expand Down
Loading

0 comments on commit dd0110b

Please sign in to comment.