zoukankan      html  css  js  c++  java
  • 跨域设置

    
    # 参考:
    https://blog.csdn.net/linzi1994/article/details/82724429
    https://www.cnblogs.com/ShaunChen/p/5998800.html
    
    # 配置详解:
    # 跨域设置
    CORS_ORIGIN_ALLOW_ALL = True  # 允许所有域名
    CORS_ALLOW_CREDENTIALS = True  # 允许获取cookie
    CORS_URLS_REGEX = r'^.*$'
    
    
    CORS_ORIGIN_WHITELIST = (
        '*'
    )
    #
    # CORS_ORIGIN_ALLOW_ALL = False
    # CORS_ORIGIN_WHITELIST = (
    #       'localhost:63343',
    # )
    #
    # # 默认值是全部:
    # CORS_ORIGIN_WHITELIST = ()  # 或者定义允许的匹配路径正则表达式.
    # CORS_ORIGIN_REGEX_WHITELIST = ('^(https?://)?(w+.)?>google.com$', )   # 默认值:
    # CORS_ORIGIN_REGEX_WHITELIST = ()
    
    CORS_ALLOW_METHODS = (
        'DELETE',
        'GET',
        'OPTIONS',
        'PATCH',
        'POST',
        'PUT',
        'VIEW',
    )
    
    CORS_ALLOW_HEADERS = (
        'XMLHttpRequest',
        'X_FILENAME',
        'accept-encoding',
        'authorization',
        'content-type',
        'dnt',
        'origin',
        'user-agent',
        'x-csrftoken',
        'x-requested-with',
        'Pragma',
    )
    
    
    
    
  • 相关阅读:
    auto_ptr解析
    C++ auto_ptr智能指针的用法
    C++ 默认构造函数
    phpdisk 盲注 &前台任意用户登录
    冒泡排序
    关于C++中的友元函数的总结
    python中的闭包
    reverse Polish notation
    PostScript
    sqlite
  • 原文地址:https://www.cnblogs.com/lajiao/p/9754584.html
Copyright © 2011-2022 走看看