Compare commits

...

2 Commits

Author SHA1 Message Date
56d57dc26a req 2025-03-25 15:39:22 +07:00
ee8d57f809 rest paging 2025-03-25 15:37:35 +07:00
3 changed files with 16 additions and 1 deletions

View File

@ -40,6 +40,7 @@ INSTALLED_APPS = [
'rest_framework', 'rest_framework',
'psycopg2', 'psycopg2',
'corsheaders',
'core', 'core',
'content', 'content',
@ -48,6 +49,9 @@ INSTALLED_APPS = [
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
@ -131,3 +135,13 @@ STATIC_URL = 'static/'
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 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

@ -1,5 +1,6 @@
asgiref==3.8.1 asgiref==3.8.1
Django==5.1.7 Django==5.1.7
django-cors-headers==4.7.0
djangorestframework==3.15.2 djangorestframework==3.15.2
psycopg2-binary==2.9.10 psycopg2-binary==2.9.10
sqlparse==0.5.3 sqlparse==0.5.3