problem deploying two apps

46 views
Skip to first unread message

frocco

unread,
Mar 1, 2016, 11:56:57 AM3/1/16
to Django users
Hi,

I followed this
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/modwsgi/

First app works fine, if I deploy the second app, the settings conflict and images are not rendered.

[code]
Alias /static /var/www/django/track/static

<Directory /var/www/django/track/static>
    Require all granted
</Directory>

<Directory /var/www/django/track>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>


<Directory '/etc/httpd/django/scripts'>
    Require all granted
</Directory>

WSGIDaemonProcess track python-path=/var/www/django/track:/usr/lib/python2.7/site-packages
WSGIProcessGroup track
WSGIScriptAlias /track /var/www/django/track/track/wsgi.py process-group=track
[/code]

[code]
Alias /static /var/www/django/coffee/static

<Directory /var/www/django/coffee/static>
    Require all granted
</Directory>

<Directory /var/www/django/coffee>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>


<Directory '/etc/httpd/django/scripts'>
    Require all granted
</Directory>

WSGIDaemonProcess coffee python-path=/var/www/django/coffee:/usr/lib/python2.7/site-packages
WSGIProcessGroup coffee
WSGIScriptAlias /coffee /var/www/django/coffee/coffee/wsgi.py process-group=coffee


[/code]

Daniel Roseman

unread,
Mar 1, 2016, 4:15:08 PM3/1/16
to Django users
I'm not sure why you are deploying these two apps separately on the same server. Usually the two apps would go together under one project, with one settings file, and you would deploy that project. collectstatic would take care of putting all the static files from both apps in the right place.
--
DR.

James Schneider

unread,
Mar 1, 2016, 6:17:33 PM3/1/16
to django...@googlegroups.com
On Tue, Mar 1, 2016 at 8:56 AM, frocco <far...@gmail.com> wrote:
Hi,

I followed this
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/modwsgi/

First app works fine, if I deploy the second app, the settings conflict and images are not rendered.


I'm assuming that you have two separate projects that need to run concurrently, not two separate apps within a single Django project (as the Django nomenclature would define). Your Apache config would need to be modified per the answer in this SO: http://stackoverflow.com/questions/6590587/multiple-mod-wsgi-apps-on-one-virtual-host-directing-to-wrong-app

-James

frocco

unread,
Mar 2, 2016, 8:59:05 AM3/2/16
to Django users
That is correct, sorry for my wording. This is two separate projects that need to run on the same server.

frocco

unread,
Mar 2, 2016, 9:02:40 AM3/2/16
to Django users
From your link, it looks like I am using the WSGIDaemonProcess and WSGIScriptAlias
The app runs fine, but images do not render unless I remove one project.
As soon as I add the second project, images do not render in static.
Each project has there own static directory under project name

frocco

unread,
Mar 2, 2016, 11:16:10 AM3/2/16
to Django users
I changed the second project to use STATIC_URL = '/static1/' and the apache conf to ALIAS /static1/ 
and the images now show

Bernardo Garcia

unread,
Mar 2, 2016, 2:38:42 PM3/2/16
to Django users
Hi frocco

May be this post can ve useful for you, althought instead of uwsgi use gunicorn 
Reply all
Reply to author
Forward
0 new messages