**我将带领 tl;dr 关于免费 python 托管。我们找到了一家免费提供 Python 托管计划的公司,如果您需要 Python 应用程序的免费网络托管(像啤酒一样免费)并且不需要: - 自定义域/营销工具/博客 - 技术支援 - 大量带宽或 CPU 时间 如果您只需要一个免费服务器用于 python 副项目,那么它们是您的最佳选择。在此注册: **PythonAnywhere**(免费提供的附属链接,我们已向他们派遣了大约 700 人)**如果您正在使用您的网站要建立业务,请查看 Opalstack。他们是付费的 Python 友好主机;每月只需​​ 10 美元,您就可以获得更好的技术支持和许多升级(电子邮件地址、免费 SSL 证书、WordPress 博客安装程序、Postgres 数据库、Ruby / Node.js / PHP 支持)。这些可以帮助您构建**更专业的网站**并帮助**将其扩展为有效的业务**免费 Python 托管 – 我希望我早点知道的东西** 在那里的某个地方,我确信有一家托管公司会主动解释他们的局限性 **在**你给他们你的信用卡之前。有很多人可以“托管”Python 应用程序“如果你处理设置未配置 VPS 的工作。如果你知道怎么做,可能不会很难,但我不知道,老实说,我不知道不在乎学习。当谈到 Python 托管时,我正在寻找一个能够正常工作的选项. 顺便说一句,如果您只想测试应用程序的原型,大多数 Python Web 框架都允许您在笔记本电脑上运行开发服务器。在您准备好部署到外部世界之前,您不需要真正的主机。这应该足以帮助您开发出一个良好的应用程序原型。但是寻找一个好的(最好是免费的)python 主机来将你的第一个项目发布到 web 的过程中有一些怪癖,本文将帮助你克服这些怪癖。 如果您有几个基本站点(PHP、WordPress 等),您可能会与 LAMP 托管机构建立现有关系。这些人简直是一毛钱一打。然而,您很快就会发现,Python 服务器托管并不适合这些公司。您需要了解这种差距,以便及早发现它并跳槽到下一家公司。 您可以通过高度结构化的管理控制台限制他们的访问,从而将同一服务器上的 PHP 用户彼此隔离开来。 Python 应用程序需要比 PHP 脚本更深入地访问底层系统。这需要在托管和服务器管理方面进行大量投资。这成了一个障碍:虽然 Python 是一种比 PHP 强大得多的语言,但 PHP/LAMP 为新手提供了一种更便宜、更简单的部署路径。这很快就会促使您购买低端 VPS,每月 50 美元,并提供良好的客户服务。 我也更喜欢与明确致力于 Python 社区的托管公司打交道。这意味着设计他们的环境来支持我们,并为他们的服务台团队配备接触过该语言的人员。它使解决 Python 应用程序的问题变得更加容易。本文中介绍的每个人都是可靠的公司、活跃的 Python 社区参与者,并且构建了对 Python 友好的应用程序部署流程。 **你得到什么和你没有得到什么(不可避免的追加销售) 如果您要使用它来主持副项目或课程站点,请跳到下一个主题。 如果您将此用于商业或职业目的,您可能应该考虑一些最终会导致您升级到付费计划的因素。由于升级交易通常是在您需要的时候提供的(在您已经转移到他们的平台并且没有时间/能量转移到其他地方),定价很少有竞争力。因此,如果您想从一开始就购买付费计划(并获得优惠的价格),那么值得评估一下。 在两个世界都生活过,以下是免费和付费计划之间的主要区别: Your own domain nameâÃÂà每年花费 10 美元 — 20 美元,看起来更专业并且比 mysite.freehost.com 更成熟,允许您建立受众和 Google 搜索流量,如果您离开。技术支持 – 我每年拨打 2 – 3 个电话,很快就会得到答复。免费主机很少响应,除非您_影响他人(在这种情况下,他们只会引导你)免费 SSL_2019 年的人们,使用 HTTPS。我在 Webfaction 最喜欢的功能之一是来自 Lets Encrypt 的免费自动 SSL 证书配置。相对于大多数商业主机,这每年为每个网站节省大约 20 美元。设置更简单:付费托管计划通常包括软件包安装程序,简单的数据库集成,能够将 WordPress 博客放入您网站的一部分等。这可以节省您的时间和挫败感离子对非核心活动。无限的电子邮件地址(紧张地回头看)并不是说我们曾经这样做过(当然是为了帮助慈善机构筹集资金)但如果您拥有自己的域,则可以创建无限的电子邮件地址。广告& 隐私:取决于程序(Python Anywhere 很棒),但是您有一些免费的托管人员,他们在这个部门有一些令人讨厌的做法。另外,当然,免费主机通常会将您视为一个庞大的电子邮件列表,用于追加销售……有限的带宽……这不是真正的问题,除非你创建的东西在 Hacker News 或 Reddit 上传播开来,此时你的网站将很快变黑 我不能为此责怪免费主机。 Web 托管、带宽和客户支持需要花钱,他们必须在某个地方弥补。免费托管业务模式基本上围绕着用一些小烦恼来刺激免费用户,以说服人们升级到付费计划(价格高于平均水平,因为他们已经在你的平台上了)。对于一个有趣的项目来说这不是问题,但请确保您实际上没有 **需要**他们的任何东西 如果您正在构建一个具有商业野心的严肃项目,开发人员的时间和可靠性比现金更宝贵。如果我每个月必须花费超过 10 分钟来维护“盒子”或(更糟的是)处理中断,免费的 Python 网络托管计划不值得。 **免费的 Python 托管选项** [2019 年 1 月更新] 遗憾的是,自我们上次修订以来,该列表已经缩减。我们将在这里介绍三个选项,其中一个仍然是一个非常好的选择,另外两个在他们的产品中附加了重要的条件。我们的第四个计划不再免费了 如果有人在华盛顿特区有好人脉并且想刺激经济,请提议他们资助 GARP 救助计划( **G**政府**A**支持**R**unning **P**ython);为所有人提供免费的 Python 服务器!好的,回到实物期权 首先,PythonAnywhere。他们有一个免费的初学者帐户计划(如啤酒),并为您提供使您的第一个 Web 应用程序在线并可见所需的基础知识。该计划包括使用子域(.pythonanywhere.com) for hosting your project (another $20 saved). The configuration and setup process is managed through a nice simple console; the free plan includes easy setup for several major web frameworks (Django, web2py, flask, bottle) and supports both Python 2 (2.7) and 3 (3.3, 3.4). You’re allowed to host one low-bandwidth web application for free, additional applications require an upgrade to a paid plan. The free plan comes with access to a MySQL database; PostGres is available but requires upgrading to a paid plan. After looking at the providers, PythonAnywhere (click here for details & signup) emerged as my recommendation as the best free python hosting option for hobby projects and first time users. The console makes it easy to get started, there is a high level of support and guidance, and you get “all the stuff” required to get going on a real project without any really annoying strings. Paid plans are reasonable – the first one starts at $5/month and expands the capabilities of your first application; the second costs $12/month (better value) and lets you to host multiple projects using that account. But best of all, free python hosting does actually indeed mean free: you can run a single app on the free plan as a fully functional (but small), continuously operating Python website for an indefinite time. Unlike the next couple of options… **Update – Educators PythonAnywhere has a special program for educators which simplifies managing environments for a large class of students. Details provided here.] One potential alternative is Heroku’s free tier, which announced a pricing change. They simplified things: you can get a free dyno (virtual instance that runs a web application) with the capability of handling some worker processing as well. This is enough to demo a small project and is good preparation for people who intend to use Heroko professionally. One very nice plus: Heroku is closely integrated with Git – allowing you to deploy an application directly from your Git repository. You can scale the application by adding additional processors, which will cost you a modest amount of money. However, they’ve gotten a bit aggressive in their strategy for upgrading people to their $7 “hobbyist” tier. Their free plans are only able to operate online for 18 out of every 24 hours. In practical terms, since the web has a global audience, your project will be offline for at least part of the day. This also very impractical if you’re hoping to get your project listed in Google’s search results; they often index content on sub-domains, but are unlikely to rank a project that’s offline for 6 hours per day very highly in their results. So while Heroku is an decent option if you want to do a quick demo or show a potential employer you can use Heroku, consider using other Python hosting plans for long term personal projects. OpenShift is another possible option; they are maintained by the original red hat board and offer a cloud service platform. They provide the ability to run three small applications on their platform within the scope of the free plan. However, their pricing scheme seems to have learned from Heroku’s example and includes an “application idling” provision within the free plan which will pause your site if there’s a significant gap in traffic (suggestion solution being to upgrade to a paid plan). It’s potentially worth checking out if you want to use their platform for larger projects. Google App Engine * on our list (and ranked highly) but their free python hosting offering seems to have disappeared into a “give us your credit card and we’ll give you $300 of free services for 60 days” deal. Unfortunately too rich for my hobbyist blood. A pity, since their prior deal let you to host up to 10 small websites on their platform and was great place to get started. Google has historically been Python-friendly and they use it for many projects internally. was* **Who We Picked** (Updated for 2021) If you’re looking to build a business around your side project, you should consider upgrading to a paid plan with a developer friendly hosting company. The cost ($10 – $25 per month) is well worth the extra support. This includes everything from Free SSL certificates (via Lets Encrypt), support for a broader set of software packages and languages (WordPress, PHP), technical support, and a more robust server infrastructure. This simplifies your life when you’re trying to turn a web application into a self-supporting business. Since my wife and I knew right out of the gate we were going to use our web hosting for commercial purposes, we wound up getting an entry level developer plan from WebFaction. (unfortunately no longer in operation; GoDaddy bought them andthem down last year). Between two consulting businesses and a digital publishing side project, we knew we would be eventually forced to move to a paid program. For us, the best python hosting service would be one which saved us time and frustration. The good news is aof WebFaction employees left after the GoDaddy acquisition and recreated the WebFaction experience at a new hosting company: OpalStack.. So we’re going to talk about them instead. OpalStack offers a shared hosting environment for Python. This runs behind an nginx server (nearly bulletproof) with the ability to serve static content directly from nginx (very fast). In addition to Python, they provide installers for many PHP packages (including WordPress). You’ve got shell access to the server and can set up your own scripts and tools. Tech support is very Python friendly; many of their support team have significant Python experience. Why we decided to go with OpalStack (and favorite features): - Ability to use own own domain name (lets us build and retain an audience) - Python literate customer support (saves a ton of time) - Free SSL certificates from Let’s Encrypt (saves time, money, helps Google Rankings) - Generous system for shared resources (many basics don’t count against your quota) - Easy Integration with non-Python blogging and content management tools (time saver); lots of fast installers that co-exist with custom python web applications - Ability to run advertising and generate revenue without interference - Easy upgrades to dedicated virtual and physical servers (we’ve got two beefy VPS’s today) So while it costs about $10 per month more, it is worth it from a time and money perspective. If you are using it for business, this is likely a better fit with your goals. We use them to manage the 30+ websites (with lots of traffic) we’ve built over the past eight years and are very happy with their service. They offer a free trial for new developers – sign up for a free trial using this link. (affiliate link) Updated: February 2021