简体   繁体   中英

How to deploy Django without mod_wsgi

I'm relatively new to web development, but I have a couple years experience working with python, so I figured I would build my first production site using django.

I've spent the last few days learning the basics and building a test site running on my local machine. Today, I've been trying to deploy my site to production; however, I've hit a pretty large stumbling block.

The django documentation suggests using mod_wsgi for apache deployments. I followed the install instructions here , only to realize that I don't have access to make any changes to apache - I'm currently on a shared hosting plan.

Apparently, to perform the install, I would have to upgrade to a VPS plan, which costs a lot more.

Any advice for a new web developer trying to get a proof-of-concept web app together (preferably with feedback gathered from real users) on a budget?

I think I have two options:

  1. Eat the cost on my current web hosting plan. Try to find a cheaper host that specializes in django hosting. I've been looking at the following (suggestions here would be wonderful):
    • Heroku
    • DigitalOcean
    • A2Hosting
  2. Try some sort of manual deployment. Is this possible or has anybody ever made this work? I can't seem to find any resources about this.
    • I was able to install django on my web server and my site just seems like a collection of files at this point. Can I simply move this directory tree to my site using an ftp? And handle the database migration manually?
    • Can I just run django on my web server via ssh instead of from my local machine? Essentially just rebuild my site in production? I know this isn't a smart idea with a normal production site, but as a proof of concept, I don't mind some downtime if my code is buggy.

Thanks!

If you are just starting Heroku is probably perfect for you. It's super easy to set up, you don't have to handle the server configuration yourself and it has a free tier to do some tests until you are ready to go.

If you are OK with doing some more advanced server/service configuration, you can use Google Cloud, Azure or AWS. This last one has a one year free tier . If you go this route, I suggest using gunicorn/uwsgi + nginx instead of Apache mod_wsgi.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM