小编kil*_*ale的帖子

ModuleNotFoundError: 没有名为“wsgi”的模块

我打算使用 Heroku 托管它。但由于配置文件的问题,它不起作用。

这是我的 Procfile

-> web: gunicorn wsgi:app
Run Code Online (Sandbox Code Playgroud)

我试过这些东西。

->web : gunicorn wsgi.py
->web : gunicorn <myproject>.wsgi --log-file-
Run Code Online (Sandbox Code Playgroud)

我的 wsgi.py 代码

"""
WSGI config for config project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')

application = get_wsgi_application()


from whitenoise.django import DjangoWhiteNoise
application = DjangoWhiteNoise(application)
Run Code Online (Sandbox Code Playgroud)

这是我的 Heroku 日志

使用命令gunicorn wsgi:app 2019-09-13T06:06:27.409894+00:00 heroku[web.1]启动进程:状态从开始变为崩溃 2019-09-13T06:06:27.388714+00:00 heroku[web.1]:进程退出状态 3 2019-09-13T06:06:27.176179+00:00 app[web.1]: [2019-09-13 …

django heroku procfile

5
推荐指数
2
解决办法
1万
查看次数

Flutter:如何使用 firebase PhoneNumberAuth 修复丢失的设备连接错误

我正在实施 phoneNumberAuth 注册。但是有个问题

当我单击 authbottom 时,终止的 iOS 应用程序

代码 :

String smsCode, verificationId;

  Future<void> verifyPhone() async {
    final PhoneCodeAutoRetrievalTimeout autoRetrieve = (String verId) {
      this.verificationId = verId;
    };

    final PhoneCodeSent smsCodeSent = (String verId, [int forceCodeResend]) {
      this.verificationId = verId;
      print('asd');
      smsCodeDialog(context).then((value) {
        print('Signed in');
      });
    };

    final PhoneVerificationCompleted verificationCompleted = (AuthCredential credential) {
      print('verified');
    };

    final PhoneVerificationFailed verfiFailed = (AuthException exception) {
      print('${exception.message}+ddddddddddd');
    };

    await FirebaseAuth.instance.verifyPhoneNumber(
      phoneNumber: this.phoneNo,
      timeout: const Duration(seconds: 5),
      verificationCompleted: verificationCompleted,
      verificationFailed: verfiFailed,
      codeSent: smsCodeSent,
      codeAutoRetrievalTimeout: …
Run Code Online (Sandbox Code Playgroud)

authentication firebase flutter

5
推荐指数
1
解决办法
1679
查看次数

在 $PATH 中找不到 Docker 撰写可执行文件”:未知

但我遇到了问题。

Dockerfile:

FROM python:3
ENV PYTHONUNBUFFERED 0
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/

Run Code Online (Sandbox Code Playgroud)

compose.yml :

version: '3'

services:
  db:
    image: postgres
    volumes:
      - ./docker/data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=sampledb
      - POSTGRES_USER=sampleuser
      - POSTGRES_PASSWORD=samplesecret
      - POSTGRES_INITDB_ARGS=--encoding=UTF-8

  django:
    build: .
    environment:
      - DJANGO_DEBUG=True
      - DJANGO_DB_HOST=db
      - DJANGO_DB_PORT=5432
      - DJANGO_DB_NAME=sampledb
      - DJANGO_DB_USERNAME=sampleuser
      - DJANGO_DB_PASSWORD=samplesecret
      - DJANGO_SECRET_KEY=dev_secret_key
    ports:
      - "8000:8000"
    command:
      - python3 manage.py runserver
    volumes:
      - .:/code
Run Code Online (Sandbox Code Playgroud)

错误 :

ERROR: for django  Cannot start service …
Run Code Online (Sandbox Code Playgroud)

python django docker docker-compose

5
推荐指数
1
解决办法
6481
查看次数

如何使用 psycopg2 修复我的 docker compose 错误

我正在配置 Docker 以使用 Django,但我在运行 Docker 时遇到问题,这可能是 Psycopg 问题,我应该如何解决这个问题?

我的码头工人错误:

Uninstalling psycopg2-2.8.4:
      Successfully uninstalled psycopg2-2.8.4
    Running setup.py install for psycopg2: started
    Running setup.py install for psycopg2: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-71k484j0/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-71k484j0/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-klbk9cly/install-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-71k484j0/psycopg2/
    Complete output (72 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/psycopg2
    copying lib/tz.py -> …
Run Code Online (Sandbox Code Playgroud)

psycopg2 docker

3
推荐指数
2
解决办法
2822
查看次数