Jump to content

Lithonian

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by Lithonian

  1. 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.
  2. 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.
  3. That's good news! As far as I can tell, the new server won't be years away. Thanks.
  4. Not particularly, it's just the new language features, and that an upgrade to Python 3 will be necessary at some point. But I do see your point! I also have an obsession with new stuff (I like updating my personal WordPress install to the nightlies every week or two ), which obviously isn't appropriate in a production hosting environment.
  5. Hello, I'm wondering if the new server will have an upgraded version of Python system-wide? I remember reading on another post about CentOS having outdated Python RPMs, but you could try something like this, as Python 2.4 is really starting to show its age. From browsing the forums, I think quite a few people will be looking to have a newer Python version, so it would be good if you had time to install it system-wide. A new server is just the right time to try something that might break! Thanks.
  6. OK. That's fine. I'll try writing a wrapper around urlpatterns() that adds it for me, depending on a setting in settings.py, so I can use the same URLconf for Heliohost and my home machine. Thanks for your help.
  7. Indeed. Smith is much, weirder - and my general feeling (I've not measured!) is that he doesn't spurt technobabble as much Tennant did, which I do miss.
  8. I use good ol' elinks on the terminal for my browsing! No, not really. I use Chromium - I prefer FireFTP and Firebug (+ FirePHP if I'm using PHP) for my development work, but for just general browsing Chromium (the open-source project Google Chrome is based upon) is fast and lightweight, especially now with the AdBlock extension. It does have a few stability issues, as I run the bleeding-edge releases from the PPAs on Ubuntu Karmic, and it gobbles even more memory than Firefox, but it's just quick and streamlined. I paraphrase from Molly Wood on Buzz Out Loud when I say, "Life's too short not to use Chrome." I'm curious as to what security risks you are alluding to. It's definitely not the most insecure browser (I'd believe that to be older versions of IE, given all the ActiveX vulnerabilities, but I have to admit I have no data right now to back that up), and it's definitely innovated a lot - Opera was the first browser to have tabs, etc. I used to use it back when I had dial-up a few years ago, and I enjoyed it quite a lot. (On Linux, I found it was much better than Konqueror or Mozilla at the time.)
  9. I had a similar problem with an Internal Server Error which was caused by '~/.python_egg_cache' having 775 permissions instead of 777, but it doesn't look like that's what's happening here - but check all your permissions match just in case. Also, I got a detailed-enough log just by looking in the Error log section of CPanel, but I imagine that's where you're looking anyway! If it helps, byron provided me with working templates for dispatch.wsgi, etc. in this thread - try them and see: http://www.helionet.org/index/index.php?s=...ost&p=52303.
  10. Thanks, that worked. Right now, my '^/?$' route doesn't match, understandably, because the URL is '/django_test/', however Django is using the "real" URL of '/django_test/dispatch.wsgi/'. Is there any way I can get it to match routes without the 'dispatch.wsgi'? (If I should ask this in Questions rather than here, tell me. )
  11. I'm currently developing a site to be uploaded to my account on HelioHost; but before I become too attached to Django, I decided to try uploading a "Hello, world" first, to check it would work. I've created my application, and uploaded it to ~/public_html/django_test. I created ~/.python_egg_cache, and set its permissions to 777 (you might want to update your guide on the site? - 775 just caused permission errors). However, when I visit my site (http://lithonian.heliohost.org/django_test/), I receive a Python ImportError: CODE ImportError at /django_test/dispatch.wsgi/ No module named django_test.urls This is odd, because the Python path it reports is: CODE ['/usr/lib/python2.4/site-packages/hashlib-20081119-py2.4-linux-x86_64.egg', '/usr/lib/python2.4/site-packages/elementtree-1.2.7_20070827_preview-py2.4.egg', '/usr/lib64/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/PIL', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib/python2.4/site-packages', '/home/lith/public_html/django_test'] And the file /home/lith/public_html/django_test/urls.py definitely exists. (Or so the file manager says... style_emoticons/default/biggrin.gif) I set up my .htaccess as so (and it seems to be working OK): CODE RewriteEngine On RewriteBase / RewriteRule ^(media/.*)$ - [L] RewriteRule ^(admin_media/.*)$ - [L] RewriteRule ^(dispatch\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ /django_test/dispatch.wsgi/$1 [QSA,PT,L] My dispatch.wsgi looks like this: CODE import os, sys ScriptRoot = "/home/lith/public_html/django_test" sys.path.append(ScriptRoot) os.chdir(ScriptRoot) # Just in case! Added after it didn't work os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' os.environ['PYTHON_EGG_CACHE'] = '/home/lith/.python_egg_cache' import django.core.handlers.wsgi _application = django.core.handlers.wsgi.WSGIHandler() def application(environ, start_response): environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO'] return _application(environ, start_response) Just to highlight: my CPanel username is 'lith', and my subdomain is lithonian.heliohost.org.
  12. Thanks for fixing it - much appreciated.
  13. Username: lith Original domain: lithonian.heliohost.org New domain: lithonian.com I'm trying to add this domain as my main domain. I originally added it as an addon, which I found was wrong, and removed it from there. When I try to add it as a parked domain, I get an error saying it has already been configured. Nameservers are pointing to Heliohost - I receive an "Account Queued" page (the account isn't though, as you can tell from the subdomain! ). I have waited a few days already: http://www.helionet.org/index/index.php?sh...amp;#entry52189. Thanks.
  14. I've waited a couple of days now, and I'm still getting the same error. Is there anything else I can do?
  15. I've already deleted it, so I'll just wait a few days and try again. Thanks.
  16. I am trying to register my new domain (lithonian.com) to my HelioHost account (lith). During my inquisitive mucking about with the settings in CPanel, trying to figure out how to do this, I added/removed it as an addon domain a few times. I eventually realised I had to add it as a parked domain. So I "disabled redirection" on the addon domain, and went to add it as a parked domain. I must have messed something up by this point, because I received an error message stating that "lithonian.com has already been configured". I have checked the lists of all the pages in the Domains section of CPanel, and nothing shows there (addon domains, parked domains, subdomains, zone editor). Also, I have set the nameservers of the domain to ns[12].heliohost.org - I did this as soon as I could because they take so long to propagate. However, on visiting the site I receive an "Account Queued" page. I'm not sure if this is because it is queued or because it's an unrecognised domain. FTP to the site seems to work, though, although again, it's all the same server I think so this could mean nothing. Any suggestions as to how I could undo whatever mistakes I've made?
×
×
  • Create New...