Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eliagbenu/25c66b5cd6a1cea7a2f4fa094e8c4b5b to your computer and use it in GitHub Desktop.
Save eliagbenu/25c66b5cd6a1cea7a2f4fa094e8c4b5b to your computer and use it in GitHub Desktop.
####in your nginx.conf server block
server {
# the port your site will be served on
listen 7002;
server_name localhost;
charset utf-8;
# Finally, send all non-media requests to the Django server.
location /app1/ {
uwsgi_pass unix:///home/user/app1/app1.sock;
include /home/user/app1/uwsgi_params;
}
location /app2/ {
uwsgi_pass unix:///home/user/app2/app2.sock;
include /home/user/app2/uwsgi_params;
}
}
#####in your django app urls.py file
urlpatterns = patterns('',
url(r'^app1/home/', include('home.urls', namespace='home')),
url(r'^app1/$', 'home.views.intro', name='index'),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
#####in settings.py
STATIC_URL = '/app1/static/'
MEDIA_URL = '/app1/media/'
ADMIN_MEDIA_PREFIX = '/app1/admin-media/'
STATIC_PATH = os.path.join(BASE_DIR,'/app1/static')
LOGIN_REDIRECT_URL = '/app1/home/intro'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment