Created
April 12, 2016 08:46
-
-
Save eliagbenu/25c66b5cd6a1cea7a2f4fa094e8c4b5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####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