From 03c0493378d31fb3d34080c31e96b04560fc93c8 Mon Sep 17 00:00:00 2001 From: Flavio Adamo Date: Wed, 13 Sep 2023 16:54:47 +0200 Subject: [PATCH 01/15] Removed / from all endpoint except auth --- backend/apivault/settings.py | 10 ++++++---- backend/apivault/urls.py | 7 +++---- backend/interaction/urls.py | 4 ++-- backend/vault/urls.py | 20 ++++++++++---------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/backend/apivault/settings.py b/backend/apivault/settings.py index 6d9d7ac..8523d4f 100644 --- a/backend/apivault/settings.py +++ b/backend/apivault/settings.py @@ -20,7 +20,8 @@ environ.Env.read_env() # Build paths inside the project like this: BASE_DIR / 'subdir'. -BASE_DIR = Path(__file__).resolve().parent.parent +BASE_DIR = Path(__file__).resolve(strict=True).parent.parent + MEDIA_ROOT = '' MEDIA_URL = '' @@ -31,7 +32,7 @@ SECRET_KEY = 'django-insecure-pnadu&92%d==xohx_27-z%is=nb7c&s!ph7#1r$i0d#oxttgh5' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = True ALLOWED_HOSTS = ['*'] @@ -205,8 +206,9 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.1/howto/static-files/ -STATIC_URL = 'static/' -STATIC_ROOT = os.path.join(BASE_DIR, 'static') +STATIC_URL = '/static/' + +STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') diff --git a/backend/apivault/urls.py b/backend/apivault/urls.py index e99f163..c0ea56c 100644 --- a/backend/apivault/urls.py +++ b/backend/apivault/urls.py @@ -1,5 +1,5 @@ """apivault URL Configuration""" -from drf_spectacular.views import SpectacularSwaggerView +from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView from django.conf.urls.static import static from django.contrib import admin from django.conf import settings @@ -16,7 +16,6 @@ path('api/interaction', include('interaction.urls')), #documentation + path('api/schema/', SpectacularAPIView.as_view(), name='schema'), path('api/schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'), -] - -urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file +] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/backend/interaction/urls.py b/backend/interaction/urls.py index 53eb6fd..f10d78a 100644 --- a/backend/interaction/urls.py +++ b/backend/interaction/urls.py @@ -2,6 +2,6 @@ from .api import LikeAPIView, FeedbackView urlpatterns = [ - path('/like//', LikeAPIView.as_view(), name='like-api'), - path('/feedback/', FeedbackView.as_view(), name='feedback') + path('/like/', LikeAPIView.as_view(), name='like-api'), + path('/feedback', FeedbackView.as_view(), name='feedback') ] diff --git a/backend/vault/urls.py b/backend/vault/urls.py index 26a0ced..fd15304 100644 --- a/backend/vault/urls.py +++ b/backend/vault/urls.py @@ -14,18 +14,18 @@ ) urlpatterns = [ - path('detail//', APIDetailView.as_view(), name='api_detail'), + path('detail/', APIDetailView.as_view(), name='api_detail'), path('search', APISearchView.as_view(), name='api_search'), - path('random/', RandomAPIListView.as_view()), - path('create/', APICreateView.as_view()), - path('count/', APICountView.as_view()), - path('all/', APIListView.as_view()), + path('random', RandomAPIListView.as_view()), + path('create', APICreateView.as_view()), + path('count', APICountView.as_view()), + path('all', APIListView.as_view()), - path('my_api/', MyApiView.as_view()), - path('pending/my_api/', MyPendingApiView.as_view()), + path('my_api', MyApiView.as_view()), + path('pending/my_api', MyPendingApiView.as_view()), - path('category//', CategoryAPIListView.as_view()), - path('categories/trending/', TrendingCategoriesView.as_view()), - path('categories/', AllCategoryAPIListView.as_view()), + path('category/', CategoryAPIListView.as_view()), + path('categories/trending', TrendingCategoriesView.as_view()), + path('categories', AllCategoryAPIListView.as_view()), ] \ No newline at end of file From b7bd813e62bebe0bc6301c13c512aeabf68639c0 Mon Sep 17 00:00:00 2001 From: gdjohn4s Date: Fri, 15 Sep 2023 15:24:54 +0200 Subject: [PATCH 02/15] added h1 title on contributors page --- frontend/pages/contributors.vue | 2 ++ frontend/services/ApivaultServices.ts | 28 +++++++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/frontend/pages/contributors.vue b/frontend/pages/contributors.vue index 5be29a6..2f5fd77 100644 --- a/frontend/pages/contributors.vue +++ b/frontend/pages/contributors.vue @@ -1,6 +1,8 @@