rest paging

This commit is contained in:
Irwan Cahyono 2025-03-25 15:37:35 +07:00
parent a4ce0b0c2a
commit ee8d57f809
2 changed files with 15 additions and 1 deletions

View File

@ -40,6 +40,7 @@ INSTALLED_APPS = [
'rest_framework',
'psycopg2',
'corsheaders',
'core',
'content',
@ -48,6 +49,9 @@ INSTALLED_APPS = [
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
@ -131,3 +135,13 @@ STATIC_URL = 'static/'
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
CORS_ALLOWED_ORIGINS = [
"http://localhost:5173",
"http://127.0.0.1:5173",
]
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 10
}

View File

@ -20,5 +20,5 @@ from django.urls import path, include
urlpatterns = [
# path('admin/', admin.site.urls),
path('core/', include('core.urls')),
path('core/', include('core.urls')),
]