30
Апр
2016

блог на django не публикуется на pythonanywhere

Публикую свой блог на Django, на хостинге Pythonanywhere. Статические файлы собрались, migrate сделала.

В wsgi:

import os
import sys

path = '/home/nitrogen987654321/my-first-blog'  # use your own username here
if path not in sys.path:
sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
application = DjangoWhiteNoise(get_wsgi_application())

Django = 1.8

Python=3.4

В итоге:

введите сюда описание изображения

Что я делаю не так? Подскажите.

пытаюсь выполнить wsgi построчно. ошибки не выдает и только после добавления последней строчки application = get_wsgi_application() выдает следующие ошибки: введите сюда описание изображения

А логи следующие:

   2016-04-30 13:39:10,006 :Error running WSGI application
   Traceback (most recent call last):
   File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
   File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
   File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
   File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
   File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
   File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
   File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
   File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
   File "/bin/user_wsgi_wrapper.py", line 179, in <module>
application = load_wsgi_application()
   File "/bin/user_wsgi_wrapper.py", line 175, in load_wsgi_application
return __import__(os.environ['WSGI_MODULE'], globals(), locals(), ['application']).application
   File "/var/www/nitrogen987654321_pythonanywhere_com_wsgi.py", line 17, in <module>
application = get_wsgi_application()
 File "/home/nitrogen987654321/my-first-blog/qblog/lib/python3.4/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
django.setup()
 File "/home/nitrogen987654321/my-first-blog/qblog/lib/python3.4/site-packages/django/__init__.py", line 17, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
 File "/home/nitrogen987654321/my-first-blog/qblog/lib/python3.4/site-packages/django/conf/__init__.py", line 55, in __getattr__
self._setup(name)
 File "/home/nitrogen987654321/my-first-blog/qblog/lib/python3.4/site-packages/django/conf/__init__.py", line 43, in _setup
self._wrapped = Settings(settings_module)
 File "/home/nitrogen987654321/my-first-blog/qblog/lib/python3.4/site-packages/django/conf/__init__.py", line 99, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
 File "/home/nitrogen987654321/my-first-blog/qblog/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
 ImportError: No module named 'mysite'

Источник: https://ru.stackoverflow.com/questions/518781/%D0%B1%D0%BB%D0%BE%D0%B3-%D0%BD%D0%B0-django-%D0%BD%D0%B5-%D0%BF%D1%83%D0%B1%D0%BB%D0%B8%D0%BA%D1%83%D0%B5%D1%82%D1%81%D1%8F-%D0%BD%D0%B0-pythonanywhere

Share

Тебе может это понравится...