Note that there are some explanatory texts on larger screens.

plurals
  1. POMoving Django site to another server- WSGIScriptAlias causing problems
    primarykey
    data
    text
    <p>I'm in the process of moving a django site over to a new server. On the old server, the django site was accessed like mysite.com/ , but now, we would like to access it via mysite.com/mysite, and let mysite.com handle something else. I have made the following changes to apache like so:</p> <pre><code> WSGIDaemonProcess mysite processes=2 threads=15 display-name=%{GROUP} WSGIProcessGroup mysite WSGIScriptAlias /mysite /srv/www/django.wsgi #WSGIScriptAlias /mysite /srv/www/django.wsgi #previous config &lt;Directory /srv/www/mysite/mysite &gt; Order allow,deny Allow from all &lt;/Directory&gt; Alias /site_media "/srv/www/mysite/site_media/" Alias /admin_media "/srv/www/mysite/admin_media/" </code></pre> <p>This seems to work fine- pointing the browser at mysite.com/unity/admin allows me to access the admin page correctly, and view the respective apps correct. However, anything that uses a custom template seems to be half-baked. For instance, there's an entry in a template below like so:</p> <pre><code> {% ifcodable cl.model %}&lt;li&gt;&lt;a href="/report/{{ app_label }}/{{ cl.opts.verbose_name }}" class="link"&gt;Coding Report&lt;/a&gt;&lt;/li&gt;{% endifcodable %} </code></pre> <p>This will redirect the page to </p> <pre><code>http://mysite.com/report/texas/texas </code></pre> <p>As opposed to</p> <pre><code>http://mysite.com/mysite/report/texas/texas </code></pre> <p>I'm not sure if the template is set up incorrectly or if it has something to do with the new alias. My urls.py looks like so:</p> <pre><code>from django.conf.urls.defaults import * from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', ..... (r'^report/([a-zA-Z]+?)/([a-zA-Z]+?)/(overall|\d+)/{0,1}$', 'mysite.k.views.performance'), (r'^report/(.+?)/(.+?)/{0,1}$', 'mysite.k.views.report'), ..... </code></pre> <p>My django.wsgi file looks like so:</p> <pre><code>import os,sys sys.path.append('/srv/www/mysite') sys.path.append('/srv/www/mysite/mysite') sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..') os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() </code></pre> <p>I don't know what the proper thing would be to do to correct the problem. I'm fairly new to django, so if there is a wicked simple solution I apologize. Any advice would be greatly appreciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload