python - 使用 https 请求 django API 不起作用
问题描述
当我想使用 https 请求 API 时,它不起作用,我不知道为什么..
例子 :
`http://myIp:8888/getValue` --> it works
`https://myIp:8888/getValue` --> it doesn't work
有我的 dockerfile :
FROM python:3.7-buster
ENV PYTHONUNBUFFERED=1
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/
ENV PYTHONUNBUFFERED 1
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV PORT=8888
RUN apt-get update && apt-get install -y --no-install-recommends \
tzdata \
python3-setuptools \
python3-pip \
python3-dev \
python3-venv \
git \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
EXPOSE 8888
CMD gunicorn Documents_management_back.wsgi:application --bind 0.0.0.0:$PORT
还有我的 docker-compose
version: "3.9"
services:
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
有人明白为什么我不能请求使用 https 吗?
非常感谢 !
解决方案
推荐阅读
- discord.js - Discord.js - 机器人加入命令作者语音频道
- github-app - 为 GitHub 应用程序创建 Travis v3 API 令牌
- java - 从 Flux 发布
成通量 - > 仅当源更新时
- php - array_merge():参数 #2 不是 sidefilter 上的数组
- python - 使用 python 使用 Microsoft Vision API 进行视频分析
- javascript - 通过 mapStateToProps 访问 redux-form 的值
- ruby-on-rails - ActionController::InvalidCrossOriginRequest(安全警告:嵌入式