vendredi 8 mars 2019

Configuring WSGI to service a single index.html file for a single page application

I have a standard Django application set up using WSGI on Apache2 (Ubuntu 18.04)

I now want to serve all front end content via a single index.html file (still allowing access the /admin url and ensuring the REST api calls via /api work). I'm using Ember for the single page application.

Any help much appreciated!

Here is my current .conf set up:

DocumentRoot /var/www/examplesite.co.uk/public_html

Alias /static /home/someuser/djangoprojects/someuser_v1_project/static
<Directory /home/someuser/djangoprojects/someuser_v1_project/static>
      Require all granted
</Directory>

Alias /media /home/someuser/djangoprojects/someuser_v1_project/media
<Directory /home/someuser/djangoprojects/someuser_v1_project/media>
      Require all granted
 </Directory>

 <Directory /home/someuser/djangoprojects/someuser_v1_project/someuser_v1_project>
 <Files wsgi.py>
        Require all granted
 </Files>
 </Directory>

 WSGIDaemonProcess examplesite.co.uk python-home=/home/someuser/virtualenvs/someuser_env python-path=/home/someuser/djangoprojects/someuser_v1_project
 WSGIProcessGroup examplesite.co.uk
 WSGIScriptAlias / /home/someuser/djangoprojects/someuser_v1_project/someuser_v1_project/wsgi.py




Aucun commentaire:

Enregistrer un commentaire