Lithonian Posted July 6, 2010 Author Share Posted July 6, 2010 Right, I've tested this (http://lithonian.com/django_test for a successful page; http://lithonian.com/django_test/blahblah for an unsuccessful page.) from django.conf.urls.defaults import * from views import * import settings def root_urlpatterns(root): def inner(fst, *bf): return patterns('', *[(root + x[0], x[1]) for x in bf]) return inner root = '' if settings.AM_ON_HELIOHOST: root += '^django_test/dispatch.wsgi/' # make sure you change this! real_patterns = root_urlpatterns(root) urlpatterns = real_patterns('', ('$', index_view), ) Make sure you don't use the '^' anchor in your routes, as that'll break the regex, as it's just a simple string concatenation. Also, I've uploaded a new ZIP which has all the required files in it, in a simple template. In the ZIP there's also a BASH script 'generate.sh'. If you run this on your home machine, it'll pipe the templates through sed to produce the final files. Then, just upload the folder via FTP. Run it like: $ bash ./generate.sh MY_USERNAME "DESTINATION" DESTINATION should *not* have a slash at the beginning or end, and quote it if it has slashes, just in case. I would run it like this: $ bash ./generate.sh lith "djtest" Then I'd upload the djtest folder via FTP or CPanel. If you run it like "bash ./generate.sh lith 'my/nested/folder'", you'll need to make 'my' and 'nested ' yourself, and upload 'folder' inside. Also, ZIP files don't preserve permissions as far as I know, so you will probably have to use the "bash " prefix unless you chmod it. Also, if you get an error from mv if you run it "bash ./generate.sh lith django_test", saying it can't move "django_test to django_test/django_test", ignore it. Finally, to run it on Win32, you'll need Cygwin or similar - I used the one that comes with MSysGit. The dirname utility just segfaults (I don't know why), so I've included a Python script called dirname which will work well enough for these purposes, although you'll probably have to change the shebang line. djtest.zip It's attached to the post for now because CPanel's file manager is playing up. Link to comment Share on other sites More sharing options...
kruptein Posted July 6, 2010 Share Posted July 6, 2010 I'm completely confused :s I did what you say and it worked, I renamed it to dbug and changed the urls to match dbug and it still worked.. :s when I compare the new dbug with the old I couldn't find a difference :f probably an indendation error or something thanks anyway! Link to comment Share on other sites More sharing options...
Ashoat Posted July 7, 2010 Share Posted July 7, 2010 Lithonian: is that dispatch.wsgi that you posted? Link to comment Share on other sites More sharing options...
kruptein Posted July 7, 2010 Share Posted July 7, 2010 I think it is urls.py because of the first import. Link to comment Share on other sites More sharing options...
Lithonian Posted July 7, 2010 Author Share Posted July 7, 2010 I think it is urls.py because of the first import. Yep. I'm not a "hardcore" Apache hacker (i.e., I can configure a dev server, nothing else.), but I can write a bit of Python script to make it easier. If you add a 'AM_ON_HELIOHOST = True' then your views will be adjusted with the right prefix, so you can use the same URLconf for testing and HelioHost. Link to comment Share on other sites More sharing options...
kruptein Posted August 11, 2010 Share Posted August 11, 2010 Byron do you still have that zip file, cause I added something and I began to get 500 internal server errors again :s Link to comment Share on other sites More sharing options...
Byron Posted August 11, 2010 Share Posted August 11, 2010 Byron do you still have that zip file, cause I added something and I began to get 500 internal server errors again :s Here it is: http://www.byrondallas.heliohost.org/djangotest.zip Don't forget to change the paths in the wsgi file. Link to comment Share on other sites More sharing options...
kruptein Posted August 12, 2010 Share Posted August 12, 2010 Thanks! Link to comment Share on other sites More sharing options...
shamanas Posted July 11, 2011 Share Posted July 11, 2011 Hello, I recently ran into the same issue myself. Is there any way we can have the dispatch.wsgi file that you used to get this fixed? Link to comment Share on other sites More sharing options...
Guest Geoff Posted July 11, 2011 Share Posted July 11, 2011 Umm... not sure how you bumped this post from 2010. Please re-explain your problem as this is an old thread. Link to comment Share on other sites More sharing options...
Archarachne Posted March 18, 2012 Share Posted March 18, 2012 I have this problem today and the path to the .zip file is not valid. Byron, do you maybe still have this file? Project "mysite". http://archarachne.heliohost.org Link to comment Share on other sites More sharing options...
Recommended Posts