File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 2626]
2727
2828CORS_ALLOW_CREDENTIALS = True
29+ CORS_ALLOW_HEADERS = [
30+ 'accept' ,
31+ 'accept-encoding' ,
32+ 'authorization' ,
33+ 'content-type' ,
34+ 'dnt' ,
35+ 'origin' ,
36+ 'user-agent' ,
37+ 'x-csrftoken' ,
38+ 'x-requested-with' ,
39+ ]
40+
41+ CORS_EXPOSE_HEADERS = ['csrftoken' , 'sessionid' ]
2942
3043# Application definition
3144# ╭──────────────────────────────────────────────────────────╮
426439SESSION_CACHE_ALIAS = "default"
427440
428441# Session cookie settings - Fixed for admin compatibility
429- SESSION_COOKIE_SAMESITE = 'Lax' # Changed from 'None' to 'Lax' for admin compatibility
430- SESSION_COOKIE_SECURE = False # Set to True in production with HTTPS
442+ SESSION_COOKIE_SAMESITE = 'Lax'
443+ SESSION_COOKIE_SECURE = False
431444SESSION_COOKIE_HTTPONLY = True # Changed to True for security and admin compatibility
432445SESSION_COOKIE_AGE = 1209600 # 2 weeks
433446SESSION_SAVE_EVERY_REQUEST = True # Ensure sessions are saved on every request
434447
435448# CSRF settings - Updated for better compatibility
436- CSRF_COOKIE_SAMESITE = 'Lax' # Changed from 'None' to 'Lax'
437- CSRF_COOKIE_SECURE = False # Set to True in production with HTTPS
449+ CSRF_COOKIE_SAMESITE = 'Lax'
450+ CSRF_COOKIE_SECURE = False
438451CSRF_COOKIE_HTTPONLY = False # Explicitly set for compatibility
439452CSRF_TRUSTED_ORIGINS = [
440453 'http://localhost:3000' ,
You can’t perform that action at this time.
0 commit comments