use sys.path.append to fix the compatiability with apache mod_wsgi
import os
import sys
# append path for the compatiability of apache2 mod_wsgi
sys.path.append('/var/www/html')
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "truth.settings")
application = get_wsgi_application()- Django, urls.py, include doesn't seem to be working
- improved wsgi script for django in apache
- using mod_wsgi to serve your django
when you update you running django code, you better restart your apache.
nohup python manage.py runserver 0.0.0.0:80CORS needs Access-Control-Allow-Origin: * header.
Use curl -I <your-url> to test it.
response = JsonResponse("")
response['Access-Control-Allow-Origin'] = "*"