Deploy django in hosting

0

Hello, how are you all!

I am making progress in the development of applications with django, and the time has come to perhaps pass the biggest test: the deploy in a web server. As I am interested in learning about the progress, my intention is to review the procedure to deploy a hosting, I do not say the brand but it starts with blue in English hehehe, I'm following a tutorial but there is something that does not allow me to see the screen " It Works "in the browser.

I have the following:

1) Using Putty to connect to the server, I opened a folder in public_html to try, it's called myenv

2) Being within myenv/

#virtualenv myenv/

here the folders bin/ , include/ , lib/

already appear

3) The virtual environment is activated

#myenv]# source bin/activate

4) install django 1.9 and gunicorn

# pip install django==1.9 gunicorn

5) I create a blank django project

#django-admin startproject myproject

6) I change to the myproject folder with cd myproject

7) I generate the migration and I create a superuser

#python manage.py migrate

#python manage.py createsuperuser

8) This is where I already have the problem, when lifting gunicorn

#gunicorn myproject.wsgi:application --bind 50.xx.xx.133:8000

the following appears:

[INFO] Starting gunicorn 19.6.0

[INFO] Listening at: http://50.xx.xx.133:8000

[INFO] Using worker: sync

[INFO] Booting worker with pid: 6041

That is apparently the sign that gunicorn is in service, but when going to the browser and dialing the IP with the port, it does not connect, sending the message that the connection takes a long time.

Should I change something when I pick up the gunicorn?

I thank you in advance for your support, with this step I feel more and more in confidence with django. I remain attentive to your comments and response. Greetings.

Gustavo.

    
asked by Gustux 15.09.2016 в 05:18
source

1 answer

0

The 'Blue Hosting' is not very compatible if it is a shared hosting, it is also optimized to host a PHP CMS. I recommend using a VPS. Personally, I gave up installing it there because I wanted more control over my server.

DigitalOcean offers cheap droplets to install applications like Django, in fact it already has a Django image ready, it also has complete tutorials on how to install it on one of its servers for production. And their prices are low too.

    
answered by 16.09.2016 в 17:29