English 中文(简体)
Django: vps or shared hosting? [closed]
原标题:

I am new to web development and everything involved with it. Im finishing my website in django and i will soon have to find a hosting and deploy it. I heard there are vps or shared hosting types. So here are the questions:
1. How many visits/clicks per day make it worth choosing vps? shared?
2. How hard is it to tune and maintain a vps on your own if you re new to everything!
3. If i ask hosting providers to help me deploy my site - will they help? (shared, vps)
4. Is vps with 256mb memory much faster than shared hosting?
5. If i want to host many sites on one hosting - is vps more suitable for that?
6. Can i host php, django and other stuff on one hosting simultaniously?
7. Should i know something else to make a decision?

最佳回答

I ve been using Webfaction for shared hosting of Django. The price is pretty decent, they have good forums, and have a nice web-based interface to help get you setup. Despite the web interface, it doesn t impede you from having full control over your site form the command line. You can host all sorts of things, from Django to Rails, to PHP, and mysql. For smaller sites, it works nicely. I m not sure how the performance works under high load, but you can always start small and upgrade to a vps. I ve never had direct contact with the support personel there, but the documentation seems good. I don t mean for this to sound like a plug, but it s been pretty good for shared hosting. If you have any questions about it, I ll be glad to answer.

问题回答

Django runs on GoogleAppEngine but php doesn t. Your Django code will have to use Google s datastore models instead of Django s usual ORM, so there is some tie in to GAE - if you decide you want to host your own app later on it could be quite a lot of work.

If you go with a VPS obviously you can run Django and php together, but you ll need to choose a webserve, maybe a firewall, maybe load balancing later on.

Clicks per day isn t really useful, you need to know how many clicks per second you get at peak time.

Cheap hosting providers will provide less help than expensive ones.

Is one VPS going to be enough? What is the impact if it goes down? It s harder to do major upgrades if you only have one server.

With a VPS you need to back your data up somewhere. The hosting may do offsite backups for you, but it s a good idea to have some yourself too.

I don t know how easy it is to backup your data from GAE, but it s probably a good idea if the data is valuable.

Should i know something else to make a decision?

Django (albeit a subset) runs on Google AppEngine:

  1. free for starters and pay as you grow.
  2. auto-scale
  3. resilient (backups are "automatic" i.e. datastore)

The drawback of course is you only have Python and Java as options...

If you want to know about setting up a VPS for Django:

Here s a blogpost about it. I used it when deploying a couple of Django-sites (and, yes, you can use Django+PHP and other stuff - I used Wordpress on the VPS too!).

I had never used a VPS before, and it was very easy to follow this guide.

Given your requirements, I would give it a try to hosting Django on Amazon EC2. If you take advantage of their free tier you can do so free for one year in a micro instance (618Mb RAM, 30Gb filesystem). You get full control of the machine, including SSH access. There are a number of freely available images that already bundle Django including the BitNami Django Amazon Machine Image which is also available for free (disclaimer: I am one of the BitNami developers). As your requirements change, it is relatively easy to resize the server to make it bigger without having to reinstall everything

Don t forget Heroku for simple django needs. Perhaps the easiest deployment out there and no need to figure out servers/ports etc.

Heroku is okay when you are starting small, but if you start getting popular - make sure you watch your usage lest you get a nice surprise on your credit card bill.

Some positives that you may not get with other more traditional providers:

  1. Ability to run the latest version of django and other libraries.
  2. By far and wide, the simplest deployment out there - there is definitely their killer feature.
  3. Who doesn t like free postgresql?
  4. A large menu of third party services that are already integrated with them. You just sign up and a few lines and a git push later you are up and running.




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签