Я пытаюсь развернуть приложение django в pythonanywhere, следуя их официальному руководству; Я создал virtualenv, установил пакеты, перечисленные в моем файле require.txt, создал веб-приложение и внес поправки в файл wsgi, указанный на информационной панели, как это было предложено. Но я получаю этот TypeEerror, указывающий на никуда.
'''
2019-06-27 12:13:32,270: Error running WSGI application
2019-06-27 12:13:32,271: TypeError: 'function' object is not subscriptable
2019-06-27 12:13:32,271: File "/var/www/corebots_pythonanywhere_com_wsgi.py", line 25, in <module>
2019-06-27 12:13:32,271: application = get_wsgi_application()
2019-06-27 12:13:32,271:
2019-06-27 12:13:32,271: File "/home/corebots/.virtualenvs/myvirtualenv/lib/python3.7/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2019-06-27 12:13:32,271: django.setup(set_prefix=False)
2019-06-27 12:13:32,272:
2019-06-27 12:13:32,272: File "/home/corebots/.virtualenvs/myvirtualenv/lib/python3.7/site-packages/django/__init__.py", line 19, in setup
2019-06-27 12:13:32,272: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2019-06-27 12:13:32,272:
2019-06-27 12:13:32,272: File "/home/corebots/.virtualenvs/myvirtualenv/lib/python3.7/site-packages/django/conf/__init__.py", line 57, in __getattr__
2019-06-27 12:13:32,272: self._setup(name)
2019-06-27 12:13:32,272:
2019-06-27 12:13:32,272: File "/home/corebots/.virtualenvs/myvirtualenv/lib/python3.7/site-packages/django/conf/__init__.py", line 44, in _setup
2019-06-27 12:13:32,272: self._wrapped = Settings(settings_module)
2019-06-27 12:13:32,272:
2019-06-27 12:13:32,273: File "/home/corebots/.virtualenvs/myvirtualenv/lib/python3.7/site-packages/django/conf/__init__.py", line 107, in __init__
2019-06-27 12:13:32,273: mod = importlib.import_module(self.SETTINGS_MODULE)
2019-06-27 12:13:32,273:
2019-06-27 12:13:32,273: File "/home/corebots/portfolio_pa/WEB/settings.py", line 177, in <module>
2019-06-27 12:13:32,273: # MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "WEB/media_cdn") # for: user uploaded
2019-06-27 12:13:32,273:
2019-06-27 12:13:32,273: File "/home/corebots/portfolio_pa/example_storages/settings_s3boto.py", line 24, in <module>
2019-06-27 12:13:32,273: #AWS_ACCESS_KEY_ID = os.getenv['AWS_ACCESS_KEY_ID']
2019-06-27 12:13:32,273: ***************************************************
2019-06-27 12:13:32,273: If you're seeing an import error and don't know why,
2019-06-27 12:13:32,273: we have a dedicated help page to help you debug:
2019-06-27 12:13:32,273: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-06-27 12:13:32,274: ***************************************************
'''
head of my settings py:
'''
import os
# for importing example_settings.env as in https://stackoverflow.com/questions/44693485/where-do-i-set-environment-variables-for-django
import environ
AWS_ACCESS_KEY_ID= os.getenv('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY= os.getenv('AWS_SECRET_ACCESS_KEY')
AWS_STORAGE_BUCKET_NAME= os.getenv('AWS_STORAGE_BUCKET_NAME')
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY= os.getenv('SECRET_KEY')
'''
мой файл pythonanywhere wsgi:
'''
# +++++++++++ DJANGO +++++++++++
# To use your own Django app use code like this:
import os
import sys
from dotenv import load_dotenv
project_folder = os.path.expanduser('~/portfolio_pa/WEB') # adjust as appropriate
load_dotenv(os.path.join(project_folder, 'settings.env'))
# assuming your Django settings file is at '/home/myusername/mysite/mysite/settings.py'
path = '/home/corebots/portfolio_pa'
if path not in sys.path:
sys.path.insert(0, path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'WEB.settings'
## Uncomment the lines below depending on your Django version
###### then, for Django >=1.5:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
###### or, for older Django <=1.4
#import django.core.handlers.wsgi
#application = django.core.handlers.wsgi.WSGIHandler()
'''