DEV Community

Suri Nuthalapati
Suri Nuthalapati

Posted on

Best ways to Deploy Django REST API on CentOS

What are the best way to Serve Django REST API(Only API) on Below stack:

  • AWS EC2 (not looking for elasticbeanstalk as of now)
  • CentOS/RHEL 7
  • any other things needed for deployment

Top comments (8)

Collapse
 
rajasimon profile image
Raja Simon

I always choose Linode basic server (5$ per month) comes with super configuration for initial server setup. If you want some docs to refer then DigitalOcean have tons of tutorials about how to run django in Ubuntu with awesome configuration.

Also amazon has the lightsail which is similar to Linode and DigitalOcean go checkout.

Collapse
 
thammuio profile image
Suri Nuthalapati • Edited

is Linode a managed infrastructure to deploy? I was more looking towards deploying it on place CentOS 7 without using managed services.

Collapse
 
rajasimon profile image
Raja Simon

Linode is a hosting company you can create private server as per your need. They also have load balancer in case if you want scaling.

You have mentioned not choosing elastic so I thought you are not going to choose paas.

If you want paas approach then go with Google app engine flexible and you can have centos in docker best for scaling.

Thread Thread
 
thammuio profile image
Suri Nuthalapati

Thx.. let me check them out...

any thoughts on Gunicorn or uWSGI?

Thread Thread
 
rajasimon profile image
Raja Simon

Gunicorn with sock. :)

Collapse
 
thammuio profile image
Suri Nuthalapati

I was looking at this How To Serve Django Applications with uWSGI and Nginx on CentOS 7 and want to find more options/best ways.

Collapse
 
thammuio profile image
Suri Nuthalapati

I have started using uWSGI and NGINX with sockets. It has been better so far and was also easy to deploy. I have done https with Let's Encrypt on NGINX for the API.

followed below for uWSGI and NGINX:
How To Serve Django Applications with uWSGI and Nginx on CentOS 7

followed below for ssl on NGINX:
How To Secure Nginx with Let's Encrypt on CentOS 7

Collapse
 
steelwolf180 profile image
Max Ong Zong Bao

If your not thinking of uWSGI, you can think of using Apache.