Meine Anwendung arbeitete letzte Nacht, nicht sicher, warum es heute Morgen nicht funktioniert. Ich denke, dass ich nur eine App namens django
erstellt habe, um meine Modelle, Tests und Ansichten zu speichern.Django Fehler: Unsachgemäß konfiguriert: WSGI-Anwendung
immer diese Fehlermeldung, django mit der Heroku Postgres-Anwendung auf OS X und dj_database als Middleware ausgeführt wird:
File "/Users/{ME}/Projects/{PROJECT}/{PROJECT}/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 58, in get_internal_wsgi_application
"could not import module '%s': %s" % (app_path, module_name, e)) django.core.exceptions.ImproperlyConfigured: WSGI application
'{PROJECT}.wsgi.application' could not be loaded; could not import module
'{PROJECT}.wsgi': No module named core.wsgi
Relevante Teil meiner wsgi.py
Datei:
"""
WSGI config for {PROJECT} project.
This module contains the WSGI application used by Django's development
server and any production WSGI deployments. It should expose a
module-level variable named ``application``. Django's ``runserver``
and ``runfcgi`` commands discover this application via the
``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but
it also might make sense to replace the whole Django WSGI application
with a custom one that later delegates to the Django one. For example,
you could introduce WSGI middleware here, or combine a Django
application with an application of another framework.
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "do.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
Relevante (glaube ich) Teil meiner settings.py
Datei:
WSGI_APPLICATION = '{PROJECT}.wsgi.application'
# ...
import dj_database_url
DATABASES['default'] = dj_database_url.config(default='sqlite://db/sqlite3.db')
, die es geschafft! Vielen Dank! – fox
@fox Glücklich zu helfen! Denken Sie daran, niemals ein anderes Python-Modul mit Ihrem zu überschreiben:) –
Ja, macht Sinn. Eine zusätzliche Frage - die App wurde nie unter 'INSTALLED_APPS' aufgelistet. Ich vergesse, muss ich es dort für django auflisten, um es aufzuheben, wenn das Verzeichnis der Anwendung in meinem aktuellen Projektverzeichnis ist (d. H. "Project \ app")? – fox