Answer the question
In order to leave comments, you need to log in
How to properly configure mod_wsgi?
Bundle apache2.4 + Django + mod_wsgi
Starting the djagno server with a command, python manage.py runserver
works fine.
If I run it through Apache, then any editable information in the view is not immediately displayed. I don't understand the reason for the problem. Possible caching. Need help solving the problem.
View for dough
from django.http import HttpResponse
from django.views.decorators.cache import never_cache
@never_cache
def index(request):
return HttpResponse('test')
import os
import sys
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.abspath(os.path.join(PROJECT_ROOT, "../")))
application = get_wsgi_application()
Answer the question
In order to leave comments, you need to log in
"Displayed not immediately" - very subjective. Server on local machine?
How did you set up the python environment for mod_wsgi? config to the studio.
What's in the Apache logs?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question