Ask Your Question
0

Is my shared host good enough for Django applications?

asked 2010-04-21 04:33:53 -0600

Evgeny gravatar image

I use shared hosting service - how do I know when it will work for a Django application like Askbot?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2010-04-21 04:47:06 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >100 is welcome to improve it.

In short do not buy into hosting service solely based on the price they offer. Service may be very cheap - but may not be worth your trouble.

Website djangofriendly.com lists hosting providers that go extra mile supporting Django applications. If your host is not on this list - it does not automatically mean that you should switch. Please read the details below (and add your notes since this page is a wiki).

Here are the basic requirements (note this list does not include Django, nor associated libraries - you can install those yourself):

Must have python interpreter

Django applications are run by the python interpreter which called by the webserver. You cannot install that interpreter (so that it is called by the apache) yourself - because you do not have access to the general section of the webserver configuration.

Support proper apache handler(s) for python

One of the following must be supported (links point to appropriate django doc pages):

Note: if you have to use FastCGI, SCGI or AGP methods then you will have to install python module called flup.

Let you compile C code on your own [possibly]

This should not be required if you use a Django friendly web hosts as they probably will have installed everything you need - and many will install additional modules if you need them.

Django depends on some compiled modules (binary object files) notably - database interfaces. Unless you can find a binary distribution for every module like that for your particular environment (which is not at all guaranteed) - the module installation routine will try to compile code on its own. With no access to compiler there will be no luck.

Try this:

which gcc

If you get nothing back - that means you don't have a compiler made available for you.

If you get something like: /usr/bin/gcc, type

ls -l /usr/bin/gcc

You should get something like

-rwxr-xr-x  2 root root 96352 Jan 13 19:57 /usr/bin/gcc

What this means is that gcc (GNU C compiler) file is owned by user root and group root. Last r-x indicates that other users - including yourself can read and execute the file. Dash - in the middle means that you cannot modify it. Execute permission must be on. Some hosts do the following (shwn in ls -l output)

 -rwxr-x---  2 root root 96352 Jan 13 19:57 /usr/bin/gcc

Notice that there are three dashes in the end of the first token. That means that you do not have permission to compile code on this machine. This host is not worth your three dollars per month.

Compiler is not the only build tool you might need, but usually either all of them are installed together or none are available.

Allow you run [cron] jobs

Cron jobs are scripted commands that are run by a daemon (long running process) called cron at scheduled times.

The current version of Askbot requires this only to send email alerts.

edit flag offensive delete link more

Comments

actually, cron jobs are not obsolete, there is one command that requires cron - send_email_alerts. The command itself is not required though for the forum to operate.
Evgeny gravatar imageEvgeny ( 2011-01-19 03:45:35 -0600 )edit
I removed the cron jobs and still get emai alerts!
graeme gravatar imagegraeme ( 2011-01-20 21:31:25 -0600 )edit
Right, you will get the instant alerts, but not the "once a week" or "once a day" delayed alerts. The docs are not clear about that...
Evgeny gravatar imageEvgeny ( 2011-01-20 21:33:56 -0600 )edit
Added the cron job back ... using my own instructions on the wiki!
graeme gravatar imagegraeme ( 2011-01-20 21:58:28 -0600 )edit
thanks, I'll add links to the wiki on the weekend.
Evgeny gravatar imageEvgeny ( 2011-01-20 22:03:34 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2010-04-21 04:33:53 -0600

Seen: 1,539 times

Last updated: Jan 20 '11