Code

Changes between Version 9 and Version 10 of webreusHowTo


Ignore:
Timestamp:
01/11/07 08:26:23 (7 years ago)
Author:
prinsroy@…
Comment:

added experience of a second user

Legend:

Unmodified
Added
Removed
Modified
  • webreusHowTo

    v9 v10  
    44== Disclaimer == 
    55 
    6 Webreus has contacted me again about their 'django' support. At this moment they do not support Django. As an experiment they have helped me out to run Django on the server where my website is hosted. Other servers have Python 2.2 with mod_python and therefore do not support Django. Maybe, with their transition to [http://www.swsoft.com/en/products/plesk8/ Plesk 8] they will support Django. 
     6Webreus do not support Django, however it is possible to get django running. This article contains the combined experience of two WebReus users. At the moment, the following setup is tested and possible:[[BR]] 
     7 
     8 
     9- Django 0.95 (other versions presumed to be working as well)[[BR]] 
     10- Python 2.4 (current version installed at webReus)[[BR]] 
     11- mysqldb[[BR]] 
     12- mod_python[[BR]] 
     13 
     14 
     15Since no official support is given, there is no guarantee that this setup wil work in the future. 
    716 
    817== Introduction == 
    918 
    10 Before I explain how you can setup Django on [http://www.webreus.nl webreus.nl] I should add a bit of context. 
     19As mentioned, two users have succeeded in getting django to work at [http://www.webreus.nl webreus.nl]. Their setups differ somewhat, as does the scope of their projects. This article will bear the fruits of their combined labour. 
    1120 
    12 At the moment I'm in the process of creating a Django powered website. I was looking for the cheapest hosting I could find, as I do not think I'm pull too much traffic. Webreus is dirtcheap (just 10EUR a year) for the smallest package. For that price you get a lot, only no shell access. 
     21The common reason for choosing Webreus is bang (full package, but no shell access) for buck (just 10EUR a year), and the prospect of a django powered site. 
    1322 
    14 Before I tried, they didn't have mod_python working properly (they ran python2.2), and did not have mysqldb. The kind people of webreus were able to set up both (mod_python now on python2.4), and my django setup works. 
     23Some early support for django from the kind people at webreus has resulted in the current setup: mod_python on python2.4. Despite the current lack of support considering django, it is still possible to get started with a django site. 
    1524 
    16 I'll quickly summarize how I got things working. 
     25A quick summary on how things get working. 
    1726 
    18 == Home setup == 
     27== Remote setup == 
    1928 
    20 First of all, I have a full django enabled webserver setup at home: running on windows XP with [http://www.uniformserver.com/ Uniform Server]. I wanted to be able to test every aspect of Django at home with apache/mysql and mod_python.  
    21  
    22 One thing in this setup is out of the ordinary: Django is installed in the www part of filesystem, not in the python site_package directory. This will come in handy when things will be moved to webreus. I have django enabled through a .htaccess file: 
     29To get things working remotely, it is necessary to copy the django folder to the webserver. Ergo, remotely it does not live inside python site_packages directory. Django is enabled through a .htaccess file in the directories where django should handle the .py files: 
    2330 
    2431{{{ 
     
    3037}}} 
    3138 
    32 My directory structure is as follows 
    33  
     39This suffices if django lives inside the httpdocs directory at webreus. For example as in the following setup: 
    3440{{{ 
    35 www 
     41httpdocs 
    3642 + django 
    3743 |  + django (which is the django source) 
     
    4046}}} 
    4147 
     48One user managed to get django to work from a directory outside httpdocs. Therefore the path to this folder is appended to the pythonpath. Add the following line to the .htaccess file: 
     49 
     50{{{ 
     51PythonPath "['???path/to/folder']+sys.path" 
     52}}} 
     53 
     54== Home setup == 
     55 
     56A fully django enabled webserver setup at home: running on windows XP / 2K with [http://www.uniformserver.com/ Uniform Server] and mod_python. To be able to test every aspect of Django at home with apache/mysql and mod_python. A pgSQL-python interface is not present at webreus, so this rules postgreSQL out for django use.  
     57 
     58To replicate the remote server fully, it is possible to install django to the www/ part of your local webserver. Just move the django folder from site_packages to wherever you want it. Adjust both system variables Pythonpath and Path accordingly and Bob's your uncle. Presumably it is not necessary to relocate Django locally. 
     59 
     60 
    4261Setting all this up has been done by following the various installation guides. 
    4362 
     
    4564 
    4665 1. '''Have a working django setup at home (used for developing)'''[[BR]] 
    47  I set up a system at home as described above. When this was all working I signed up with webreus. Please note that Webreus does NOT support Django at this moment (see the Disclaimer on top of this page). Within 2 days I had a new domain and all the information I needed. They run [http://en.wikipedia.org/wiki/Plesk Plesk] and do not provide shell access.  
     66 Set up a system at home as described above. Sign up with webreus. Please note that Webreus does NOT support Django (see the Disclaimer on top of this page). Within 2 days I had a new domain and all the information I needed. They run [http://en.wikipedia.org/wiki/Plesk Plesk] and do not provide shell access.  
    4867 1. '''Setup the databases on webreus'''[[BR]] 
    49  Through Plesk databases can be setup, this involves following the Plesk manual. No rocket science at all, just some click work. In the end this gives you phpMyAdmin to configure (in my case) a mysql database. Make sure the database setup is the same as the 'home setup' (otherwise you'll just have to change the settings.py). 
    50  1. '''Upload your files to webreus'''[[BR]] Then I uploaded all my local files, through a ftp upload to the 'httpdocs' directory. Again no rocket science. 
     68 Through Plesk databases can be set up, this involves following the Plesk manual. No rocket science at all, just some click work. In the end this gives you phpMyAdmin to configure a mysql database. Make sure the database setup is the same as the 'home setup' (otherwise you'll just have to change the settings.py). 
     69 1. '''Upload your files to webreus'''[[BR]] Upload all local files through a ftp upload to the 'httpdocs' directory. Again no rocket science. 
    5170 1. '''Import your development sql-export into the webreus database'''[[BR]] 
    5271 Now the main trick comes: without shell access there is no way to setup the database according to the 'models.py'. The way I've solved this is to replicate my home mysql database to webreus. Just exporting the database tables with contents through phpMyAdmin and uploading them again at webreus. 
    5372 1. '''Visit your website'''[[BR]] This was enough to get everything to work. 
    5473 
    55 If you have any questions, just let me know: find my contact details in the history of this page. 
     74If you have any questions: you can find both users' contact details in the history of this page.