Code

Changes between Version 1 and Version 2 of webreusHowTo


Ignore:
Timestamp:
07/31/06 12:01:47 (8 years ago)
Author:
Joost Meijer <webmaster@…>
Comment:

Initial Full Version

Legend:

Unmodified
Added
Removed
Modified
  • webreusHowTo

    v1 v2  
     1= Setting up Django at Webreus.nl = 
     2 
     3== Introduction == 
     4 
    15Before I explain how you can setup Django on [http://www.webreus.nl webreus.nl] I should add a bit of context. 
     6 
     7At 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. 
     8 
     9Before 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. 
     10 
     11I'll quickly summarize how I got things working. 
     12 
     13== Home setup == 
     14 
     15First 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.  
     16 
     17One 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: 
     18 
     19{{{ 
     20SetHandler python-program 
     21AddHandler mod_python .py 
     22PythonHandler django.core.handlers.modpython 
     23SetEnv DJANGO_SETTINGS_MODULE <yoursite>.settings 
     24PythonDebug On 
     25}}} 
     26 
     27My directory structure is as follows 
     28 
     29{{{ 
     30www 
     31 + django 
     32 |  + django (which is the django source) 
     33 |  + mysite (which is mysite's source) 
     34 + site-media 
     35}}} 
     36 
     37Setting all this up has been done by following the various installation guides. 
     38 
     39== Webreus setup == 
     40 
     41When this was all working I signed up with webreus. 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. So setting up everything is a bit different than normally. 
     42 
     43Through 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). 
     44 
     45Then I uploaded all my local files, through a ftp upload to the 'httpdocs' directory. Again no rocket science. 
     46 
     47Now 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. 
     48 
     49This was enough to get everything to work. I can now serve to http://www.mydomain.nl/django and see my frontpage from Django. 
     50 
     51If you have any questions, just let me know: find my contact details in the history of this page.