heroku错误:“无法将某些引用推送到'https://git.heroku.com/pacific-refuge-35090.git'

时间:2020-06-25 20:29:54

标签: django heroku

我正在尝试将项目推送到heroku上,但出现此错误,我不确定为什么。我最初遇到了一个不同的错误,但是我认为这是由于没有修复的requests.txt。我在主分支上。对于heroku来说还是个新手,所以我不确定自己做错了什么。继续前进并添加,致力于,现在只是在努力推动。我怎样才能解决这个问题 ?是否表示我缺少静态根?我的静态文件在本地可以正常工作。

设置。

  import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '(mui%^85te&u)5&@zwo3b^u=em$vgn1fb5k69!o_j$f5gg6d&o'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []

LOGIN_URL = '/login/'


#For Custom Model 
AUTH_USER_MODEL = 'dating_app.Profile'


# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    
    #Third party apps
    'bootstrap4', 


    #My apps
    'dating_app',
   

]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'dating_project.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                
            ],
        },
    },
]

WSGI_APPLICATION = 'dating_project.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}


# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'US/Eastern'


USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/

PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_DIR, 'staticfiles')
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'static'),
)

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'dating_app/media')


#Settings for django-bootstrap3
BOOTSTRAP4 = {
    'include_jquery' : True,
}

heroku日志-尾巴

2020-06-26T16:50:37.201728+00:00 heroku[run.8487]: Awaiting client
2020-06-26T16:50:37.270634+00:00 heroku[run.8487]: Starting process with command `python3 manage.py migrate`
2020-06-26T16:50:43.675395+00:00 heroku[run.8487]: Process exited with status 0
2020-06-26T16:50:43.709960+00:00 heroku[run.8487]: State changed from up to complete
2020-06-26T16:52:56.037761+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=d4c85ad9-a9a0-4480-8719-69b9f457dd9f fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T16:53:10.484133+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=25e6e10f-7837-4b2f-8c15-c6ecaaaff955 fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T16:53:23.686487+00:00 app[api]: Starting process with command `bower install --config.interactive=false;grunt prep;python manage.py collectstatic --noinput` by user rezazandirz@gmail.com
2020-06-26T16:53:33.956696+00:00 heroku[run.9194]: State changed from starting to up
2020-06-26T16:53:34.075359+00:00 heroku[run.9194]: Awaiting client
2020-06-26T16:53:34.095005+00:00 heroku[run.9194]: Starting process with command `bower install --config.interactive=false;grunt prep;python manage.py collectstatic --noinput`
2020-06-26T16:53:39.166734+00:00 heroku[run.9194]: Process exited with status 1
2020-06-26T16:53:39.204265+00:00 heroku[run.9194]: State changed from up to complete
2020-06-26T16:53:52.402422+00:00 app[api]: Remove DISABLE_COLLECTSTATIC config vars by user rezazandirz@gmail.com
2020-06-26T16:53:52.402422+00:00 app[api]: Release v7 created by user rezazandirz@gmail.com
2020-06-26T16:54:07.481278+00:00 app[api]: Starting process with command `python3 manage.py collecstatic` by user rezazandirz@gmail.com
2020-06-26T16:54:19.744996+00:00 heroku[run.8649]: State changed from starting to up
2020-06-26T16:54:19.952585+00:00 heroku[run.8649]: Awaiting client
2020-06-26T16:54:19.982054+00:00 heroku[run.8649]: Starting process with command `python3 manage.py collecstatic`
2020-06-26T16:54:25.284368+00:00 heroku[run.8649]: Process exited with status 1
2020-06-26T16:54:25.317991+00:00 heroku[run.8649]: State changed from up to complete
2020-06-26T16:54:36.181548+00:00 app[api]: Starting process with command `python3 manage.py collectstatic` by user rezazandirz@gmail.com
2020-06-26T16:54:46.279535+00:00 heroku[run.3324]: Awaiting client
2020-06-26T16:54:46.317388+00:00 heroku[run.3324]: State changed from starting to up
2020-06-26T16:54:46.340049+00:00 heroku[run.3324]: Starting process with command `python3 manage.py collectstatic`
2020-06-26T16:54:55.130018+00:00 heroku[run.3324]: Process exited with status 1
2020-06-26T16:54:55.184764+00:00 heroku[run.3324]: State changed from up to complete
2020-06-26T16:55:02.569962+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=ac537c90-f80b-4001-8a31-3d0cae58ea2f fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T17:00:18.921162+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=c72eb523-4ff9-45da-92cf-aa6b206e71b8 fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T17:01:14.000000+00:00 app[api]: Build started by user rezazandirz@gmail.com
2020-06-26T17:01:33.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/4a0eb281-0308-4569-b513-20f6aa571c06/activity/builds/ab84c352-68bb-46fc-b267-7003985e0fd3
2020-06-26T17:01:49.265931+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=9e536d2a-dcee-459b-8678-4608b6e65795 fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T17:02:20.442428+00:00 app[api]: Set DISABLE_COLLECTSTATIC config vars by user rezazandirz@gmail.com
2020-06-26T17:02:20.442428+00:00 app[api]: Release v8 created by user rezazandirz@gmail.com
2020-06-26T17:02:27.291474+00:00 app[api]: Starting process with command `python manage.py collectstatic` by user rezazandirz@gmail.com
2020-06-26T17:02:37.404751+00:00 heroku[run.6656]: State changed from starting to up
2020-06-26T17:02:37.701212+00:00 heroku[run.6656]: Awaiting client
2020-06-26T17:02:37.724048+00:00 heroku[run.6656]: Starting process with command `python manage.py collectstatic`
2020-06-26T17:02:45.941448+00:00 heroku[run.6656]: Process exited with status 1
2020-06-26T17:02:45.978796+00:00 heroku[run.6656]: State changed from up to complete
2020-06-26T17:02:48.795557+00:00 app[api]: Release v9 created by user rezazandirz@gmail.com
2020-06-26T17:02:48.795557+00:00 app[api]: Set DISABLE_COLLECTSTATIC config vars by user rezazandirz@gmail.com
2020-06-26T17:03:41.000000+00:00 app[api]: Build started by user rezazandirz@gmail.com
2020-06-26T17:04:19.774763+00:00 app[api]: Deploy e6da01b5 by user rezazandirz@gmail.com
2020-06-26T17:04:19.774763+00:00 app[api]: Release v10 created by user rezazandirz@gmail.com
2020-06-26T17:04:31.000000+00:00 app[api]: Build succeeded
2020-06-26T17:04:57.429366+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=48074f1f-d521-4d8c-817b-efe9269c8af8 fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T17:14:50.270149+00:00 app[api]: Remove DISABLE_COLLECTSTATIC config vars by user rezazandirz@gmail.com
2020-06-26T17:14:50.270149+00:00 app[api]: Release v11 created by user rezazandirz@gmail.com
2020-06-26T17:14:59.553953+00:00 app[api]: Starting process with command `python manage.py collectstatic` by user rezazandirz@gmail.com
2020-06-26T17:15:10.210855+00:00 heroku[run.4228]: State changed from starting to up
2020-06-26T17:15:10.293697+00:00 heroku[run.4228]: Awaiting client
2020-06-26T17:15:10.344072+00:00 heroku[run.4228]: Starting process with command `python manage.py collectstatic`
2020-06-26T17:15:14.714586+00:00 heroku[run.4228]: Process exited with status 1
2020-06-26T17:15:14.746272+00:00 heroku[run.4228]: State changed from up to complete
2020-06-26T17:15:31.216333+00:00 app[api]: Starting process with command `python manage.py collectstatic` by user rezazandirz@gmail.com
2020-06-26T17:15:44.753335+00:00 heroku[run.3763]: State changed from starting to up
2020-06-26T17:15:45.125083+00:00 heroku[run.3763]: Awaiting client
2020-06-26T17:15:45.152187+00:00 heroku[run.3763]: Starting process with command `python manage.py collectstatic`
2020-06-26T17:15:49.845916+00:00 heroku[run.3763]: Process exited with status 1
2020-06-26T17:15:49.888237+00:00 heroku[run.3763]: State changed from up to complete
2020-06-26T17:15:58.538179+00:00 app[api]: Starting process with command `python manage.py collectstatic` by user rezazandirz@gmail.com
2020-06-26T17:16:08.257015+00:00 heroku[run.6934]: State changed from starting to up
2020-06-26T17:16:08.449813+00:00 heroku[run.6934]: Awaiting client
2020-06-26T17:16:08.507300+00:00 heroku[run.6934]: Starting process with command `python manage.py collectstatic`
2020-06-26T17:16:12.905206+00:00 heroku[run.6934]: Process exited with status 1
2020-06-26T17:16:12.938346+00:00 heroku[run.6934]: State changed from up to complete
2020-06-26T17:17:25.000000+00:00 app[api]: Build started by user rezazandirz@gmail.com
2020-06-26T17:17:47.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/4a0eb281-0308-4569-b513-20f6aa571c06/activity/builds/a0050392-931d-4e97-809a-dc901beb2fc0
2020-06-26T17:18:32.409825+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=07d202c1-0906-4837-89f1-041bcfc77484 fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T17:21:39.131024+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=f236b903-4d9e-48cd-85f1-38dce82a77a7 fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T17:26:24.000000+00:00 app[api]: Build started by user rezazandirz@gmail.com
2020-06-26T17:26:44.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/4a0eb281-0308-4569-b513-20f6aa571c06/activity/builds/71b40f84-d70a-4e17-801a-e2895cd9aaf4
2020-06-26T17:27:15.000000+00:00 app[api]: Build started by user rezazandirz@gmail.com
2020-06-26T17:27:35.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/4a0eb281-0308-4569-b513-20f6aa571c06/activity/builds/5f9384cc-9282-4f0e-8d83-28fa8cca4367
2020-06-26T17:36:17.000000+00:00 app[api]: Build started by user rezazandirz@gmail.com
2020-06-26T17:36:39.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/4a0eb281-0308-4569-b513-20f6aa571c06/activity/builds/e1a51755-c6d5-46cd-bb81-75f5b1d0d49d
2020-06-26T17:53:42.639956+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=22abd979-9f61-43b2-84d7-1fd9a92e7a1c fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T18:35:58.565164+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=6c6b7e1b-878f-457e-9d23-0f57565a9c8e fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T18:45:27.000000+00:00 app[api]: Build started by user rezazandirz@gmail.com
2020-06-26T18:46:08.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/4a0eb281-0308-4569-b513-20f6aa571c06/activity/builds/09470d39-5b16-4ce9-a85a-0045d6ce8a90
2020-06-26T18:49:28.305682+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=3d227eb2-87d3-4e3d-a089-b15314dfde8b fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T18:49:32.517523+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=5a655c32-ee5e-4368-b329-74156a1bf0bd fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T18:59:37.000000+00:00 app[api]: Build started by user rezazandirz@gmail.com
2020-06-26T19:00:42.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/4a0eb281-0308-4569-b513-20f6aa571c06/activity/builds/65ede235-8ccf-4789-9a8c-0a4fe46dadf1
2020-06-26T19:10:20.000000+00:00 app[api]: Build started by user rezazandirz@gmail.com
2020-06-26T19:11:31.278281+00:00 app[api]: Release v12 created by user rezazandirz@gmail.com
2020-06-26T19:11:31.278281+00:00 app[api]: Deploy 080b41d5 by user rezazandirz@gmail.com
2020-06-26T19:11:31.300995+00:00 app[api]: Scaled to web@1:Free by user rezazandirz@gmail.com
2020-06-26T19:11:42.654262+00:00 heroku[web.1]: Starting process with command `gunicorn dating_project.wsgi --log-file -`
2020-06-26T19:11:43.000000+00:00 app[api]: Build succeeded
2020-06-26T19:11:44.830330+00:00 app[web.1]: bash: gunicorn: command not found
2020-06-26T19:11:44.888251+00:00 heroku[web.1]: Process exited with status 127
2020-06-26T19:11:44.954633+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-26T19:11:44.959030+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-26T19:11:56.312303+00:00 heroku[web.1]: Starting process with command `gunicorn dating_project.wsgi --log-file -`
2020-06-26T19:11:58.809660+00:00 app[web.1]: bash: gunicorn: command not found
2020-06-26T19:11:58.862701+00:00 heroku[web.1]: Process exited with status 127
2020-06-26T19:11:58.897612+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-26T19:12:01.117585+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=a5f7300f-506d-46a9-8e0c-00025d91fc7f fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T19:12:18.884988+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=f308c73c-67ae-481d-9c1a-23a5c99fc58e fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-26T19:16:41.935210+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pacific-refuge-35090.herokuapp.com request_id=264588f2-badc-4b5f-b55f-e1f6b4760303 fwd="138.88.138.250" dyno= connect= service= status=503 bytes= protocol=https

1 个答案:

答案 0 :(得分:1)

尝试一下:

  1. heroku config:set DISABLE_COLLECTSTATIC=1
  2. heroku run python manage.py collectstatic
  3. heroku config:set DISABLE_COLLECTSTATIC=0