我找到了解决我问题的方法!
经过大量令人费解的研究之后,我重新阅读了这个堆栈溢出问题,该问题上次查看时似乎没有帮助。
我的django_project文件夹中的新settings.py现在看起来像这样。
"""Django settings for django_project project.For more information on this file, seehttps://docs.djangoproject.com/en/1.6/topics/settings/For the full list of settings and their values, seehttps://docs.djangoproject.com/en/1.6/ref/settings/"""# Build paths inside the project like this: os.path.join(base_DIR, ...)import osbase_DIR = os.path.dirname(os.path.dirname(__file__))# Quick-start development settings - unsuitable for production# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/# SECURITY WARNING: keep the secret key used in production secret!SECRET_KEY = 'DwGCDqtcqzzGO2XK87u7bVSEUqHogZRFl4UdhkcCudSHxLUVvx'# SECURITY WARNING: don't run with debug turned on in production!DEBUG = TrueTEMPLATE_DEBUG = TrueALLOWED_HOSTS = ['*']# Application definitionINSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework',)REST_frameWORK = { # Use hyperlinked styles by default. # only used if the `serializer_class` attribute is not set on a view. 'DEFAULT_MODEL_SERIALIZER_CLASS': 'rest_framework.serializers.HyperlinkedModelSerializer', # Use Django's standard `django.contrib.auth` permissions, # or allow read-only access for unauthenticated users. 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' ]}MIDDLEWARE_CLASSES = ( '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 = 'django_project.urls'WSGI_APPLICATION = 'django_project.wsgi.application'# Database# https://docs.djangoproject.com/en/1.6/ref/settings/#databasesDATAbaseS = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'django', 'USER': 'django', 'PASSWORD': 'mpOQzpYFci', 'HOST': 'localhost', 'PORT': '', }}# Internationalization# https://docs.djangoproject.com/en/1.6/topics/i18n/LANGUAGE_CODE = 'en-us'TIME_ZONE = 'UTC'USE_I18N = TrueUSE_L10N = TrueUSE_TZ = True# Static files (CSS, Javascript, Images)# https://docs.djangoproject.com/en/1.6/howto/static-files/STATIC_ROOT = '/home/django/django_project/django_project/static'STATIC_URL = '/static/'STATICFILES_DIRS = ( os.path.join(base_DIR, 'static'),)现在,我的django_project文件夹中的settings.py文件旁边有一个名为“ static”的文件夹,其中包含所有必需的资源,例如“ rest_framework”和“ admin”。进行此更改后,我重新启动了gunicorn,并重新加载了我的网页,它开始工作了!



