1

I'm trying to deploy a Django app, and I tried to follow the tutorial at robhogg.me.uk/post/2, but it fails at the third command. Is it possible to deploy a Django app on my 1and1 hosting or will I need to look for another host provider?

  • Can you tell us a little more about what type of hosting you have (e.g., shared or VPS/dedicated, cPanel/Plesk or no control panel, OS/version, etc...)? – dan Dec 17 '15 at 2:43
  • I have a shared hosting, I also have a ssh access. – Psddp Dec 17 '15 at 3:04
  • They're not listed as a Django-friendly host, but it seems possible according to various posts. Where your install is failing might depend on your specific server's setup, but perhaps the answer here might help since it refers to the same tutorial.. – dan Dec 17 '15 at 3:16
  • It fails at: python setup.py install --user. I tried copying Django to the python folder but I don't have a write access there. – Psddp Dec 17 '15 at 3:38
  • Have you tried asking them? – Simon Hayter Dec 17 '15 at 8:15
2

It is possoble using FastCGI and flup. You need to install django locally

python setup.py install --user

install flup

unzip flup*.egg
mv flup ~/.local/lib/python*/site-packages/
mv EGG-INFO ~/.local/lib/python*/site-packages/

create fcgi script

#!/usr/bin/python
import sys, os

basepath = '/full/home/path'

sys.path.insert(0, basepath + '/.local/lib')
sys.path.insert(0, basepath + '/pathto/djangoapp')

os.environ['DJANGO_SETTINGS_MODULE'] = 'main.settings'

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method='prefork', daemonize='false')

(after removing python 2.6 and moving to 2.7 method='threaded' doesn't work for me)

and modify .htaccess file to add fcgid-script handler.

AddHandler fcgid-script .fcgi
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !(pathto/main.fcgi) 
RewriteRule     ^(.*)$          pathto/main.fcgi/$1 [QSA,L]
1

Mostly it won't be possible unless you contact the support and ask if they can help it out.

  1. You have ssh acces. But you don't have the privileges to do most of the tasks. Eg, install a special package or software.

What to do : You will have to check if there are sufficient permissions.

  1. They are making money out of it. Just like hostgator who doesn't provide the acces to clients for directly installing certificates, and making us pay a fee of 5-10 dollars, 1and1 also may have an option to help you out.

What to do : Ask the support if they can help out.

If what you require isn't happening, try checking for django hosting providers with good support. You can also get help from webhostingtalk website.

  • I asked them and I'm waiting for an answer. Thank you. – Psddp Dec 17 '15 at 16:50
  • 1
    Great. Please update the answer when you get an intimation from them so that others searching the question will understand it. – Arun Anson Jun 27 '16 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.