使用python构建数据库

As of today, I have taken my final examination as an undergraduate student of Physics. With my graduate software engineering job beginning in September, I am one graduation ceremony away from being a Software Engineer instead of a Physics Student.

截止到今天,我已经以物理学的本科生参加了期末考试。 从9月开始我的研究生软件工程工作以来,我离成为软件工程师而不是物理学生一个毕业典礼。

Despite the fact that the world needs another programming/tech blog like a hole in the head, I enjoy writing. Given that tech is one of the few subjects on which I’m likely to have something to say, the world will just have to suffer through it. Additionally, my first-choice programming language is Python, and as we know, GitHub is a pythonista’s resume. I see this blog as being a front-page for my GitHub resume.

尽管事实上世界还需要另一个编程/技术博客,例如脑袋上的一个洞,但我还是喜欢写作。 鉴于技术是我可能要说的很少的话题之一,因此世界将不得不为此遭受痛苦。 另外,我的首选编程语言是Python,众所周知, GitHub是pythonista的履历表 。 我将此博客视为GitHub简历的首页。

With that in mind, we should look at the most significant project I’ve hosted on my GitHub: this blog!

考虑到这一点,我们应该看一下我在GitHub上托管的最重要的项目:此博客!

极简博客 (Minimalist Blogging)

Before I started building this blog, I had done almost no web development of any kind. Despite my go-to programming language being Python, the bulk of my extended work has been local applications. Some of these have been in Python, but the bulk have actually been in C# or Java.

在开始构建此博客之前,我几乎没有进行任何形式的Web开发。 尽管我喜欢使用Python作为编程语言,但我的大部分扩展工作还是本地应用程序。 其中一些使用Python,但是大部分实际上使用C#或Java。

None of these have been web apps, however. Given the increasing importance of web applications, it is increasingly indefensible for me to be so totally unfamiliar with web application development.

但是,这些都不是Web应用程序。 鉴于Web应用程序的重要性日益增加,对我完全不熟悉Web应用程序开发的理解越来越难。

My need for a blog and my lack of web application knowledge gave me the opportunity to kill two birds with one stone. So, I resolved that I would build a blog from the ground up.

我对博客的需求以及对Web应用程序知识的缺乏,使我有机会用一块石头杀死两只鸟。 因此,我下定决心要从头开始建立一个博客。

I was able to limit the scope of my job by considering the limited number of things I needed my blog to do. For the moment, at least, it is likely to be very low-traffic, which meant I didn’t need it to handle huge loads or a wide variety of content. I’m technically competent, which means I could write my blog posts in some form of markup, rather than needing a WYSIWYG interface to write them. I don’t expect much in the way of comment spam, so I haven’t implemented a spam filter. In essence, all this blog does is store and display posts and comments.

通过考虑需要博客做的有限的事情,我可以限制我的工作范围。 至少目前,它的流量可能很低,这意味着我不需要它来处理大量的负载或各种各样的内容。 我在技术上很称职,这意味着我可以用某种形式的标记写博客文章,而不需要WYSIWYG界面来编写它们。 我对评论垃圾邮件的期望不高,因此我还没有实施垃圾邮件过滤器。 本质上,此博客所做的只是存储和显示帖子和评论。

Finally, if I was writing Ruby I would probably just have downloaded one of the many, many blog frameworks for Ruby on Rails. Happily, Django exists, so I can write my webapp in Python! Doing things in Python always makes it better.

最后,如果我正在编写Ruby,我可能只会下载Ruby on Rails的众多博客框架之一。 令人高兴的是, Django存在,所以我可以用Python编写我的webapp! 用Python做事总是会让事情变得更好。

是的,但是你说极简主义者? 这似乎还不是最小的。 (Right, but you said Minimalist? This doesn’t seem all that Minimal.)

Part of the minimalism was explained before, with the limited functionality of the blog. The rest of the minimalism was designed in for my own aesthetic appreciation. The blog CSS is based upon the delightfully minimal Skeleton framework with a few adjustments. The blog (in its basic form) uses no Javascript of any kind. We expect to host no static files, so it’s easy to host on Heroku.

之前已经解释了部分极简主义,但博客的功能有限。 其余的极简主义是为了我自己的审美欣赏而设计的。 博客CSS基于令人愉快的最小化Skeleton框架,并进行了一些调整。 该博客(以其基本形式)不使用任何形式的Javascript。 我们希望不承载任何静态文件,因此很容易在Heroku上承载。

As I progressed, I found that this minimalism had some advantages. The absence of an admin GUI interface means that it is significantly more difficult to have your blog stolen or hacked. The lack of Javascript and the relatively simple CSS ensures the page loads fast and looks classy. The absence of Javascript, or of commenting accounts, means that the blog is as privacy-friendly as a blog can possibly be.

随着我的进步,我发现这种极简主义有一些优势。 缺少管理GUI界面意味着博客被盗或被黑客入侵的难度要大得多。 缺少Javascript和相对简单CSS可以确保页面快速加载并看上去优雅。 缺少Javascript或评论帐户,意味着该博客具有与博客一样的隐私友好性。

Finally, the blog code itself is small and (fairly) simple. This makes it easy to deploy and, hopefully, easy to tinker with.

最后,博客代码本身很小,并且(非常)简单。 这使其易于部署,并且希望易于修改。

These advantages mean you can host a blog for very little. You can use a free Heroku account, combined with S3 storage (which is cheap) for the CSS, and get a blog that’s totally under your control for almost nothing. If you want a larger database than Heroku provides, you can always get an EC2 instance. Right now I haven’t, but in the longer term I’ll be considering doing just that. If I do, I’ll probably blog about it.

这些优势意味着您只需花很少的钱就可以托管博客。 您可以使用免费的Heroku帐户,并结合CSS的S3存储(便宜),并获得完全不受您控制的博客。 如果要使用比Heroku提供的数据库更大的数据库,则始终可以获取EC2实例。 现在还没有,但是从长远来看,我会考虑这样做。 如果这样做,我可能会在博客上写有关它。

大。 所以呢? (Great. So what?)

So nothing, really. I wrote some software that I thought my be of interest to others, so I released the non-site-specific stuff for others to use. If you feel like you want a simple self-hosted blog, you should consider adapting this framework for your own use. If you use it and find it is missing a feature you think would be popular, or you need to make some changes to use it on a production server of your own, I would be delighted to accept pull requests. If all you want to do is clean the code up, I’d be happy to accept pull requests for that too.

没事,真的。 我写了一些我认为自己对其他人感兴趣的软件,因此我发布了非特定于站点的东西供他人使用。 如果您想要一个简单的自托管博客,则应考虑调整此框架以供自己使用。 如果您使用它,但发现它缺少您认为会很流行的功能,或者您需要进行一些更改才能在自己的生产服务器上使用它,我将很高兴接受拉取请求。 如果您要做的只是清理代码,我也很乐意接受该请求。

The code should be sufficiently well-contained that you can integrate it with your own Django application as well!

该代码应包含足够完善的代码,以便您也可以将其与自己的Django应用程序集成!

去哪儿? (Where to?)

翻译自: https://www.pybloggers.com/2012/05/building-a-minimalist-blog-in-python-or-how-i-learned-to-stop-worrying-and-love-web-development/

使用python构建数据库

使用python构建数据库_使用Python构建一个极简主义博客(或者,如何学习停止烦恼和热爱Web开发)。相关推荐

  1. 使用python构建数据库_使用Python构建(半)自主无人机

    使用python构建数据库 They might not be delivering our mail (or our burritos) yet, but drones are now simple ...

  2. python sqlite数据库_用Python进行SQLite数据库操作

    简单的介绍 SQLite数据库是一款非常小巧的嵌入式开源数据库软件,也就是说没有独立的维护进程,所有的维护都来自于程序本身.它是遵守ACID的关联式数据库管理系统,它的设计目标是嵌入式的,而且目前已经 ...

  3. python加数据库_用python批量插入数据到数据库中

    既然使用python操作数据库必不可少的得使用pymysql模块 可使用两种方式进行下载安装: 1.使用pip方式下载安装 pip install pymysql 2.IDE方式 安装完成后就可以正常 ...

  4. python 异步数据库_异步Python和数据库

    python 异步数据库 The asynchronous programming topic is difficult to cover. These days, it's not just abo ...

  5. python随机数据库_关于Python的随机数模块,你必须要掌握!-后台/架构/数据库-敏捷大拇指-一个敢保留真话的IT精英社区...

    所谓七夕 昨天的文章这个七夕节,用Python为女友绘制一张爱心照片墙吧!收获了最近以来最高的浏览量,没枉费我熬到夜里3点赶出来的热点文章.有付出就总会有所回报,只是看这天来的早晚而已.七夕一个人看这 ...

  6. python搭建博客系统_用Pelican快速搭建极简静态博客系统

    我一直建议每个开发者都要有写博客记笔记的习惯,一来可以沉淀知识,二来可以帮助别人,我使用过很多博客平台,也用Python开发过博客系统,就这么个东西折腾好几年,一直找不到理想的产品,直到我用Pelic ...

  7. python文本替换 数据库_在Python中使用ASCII文件中的注释查找/替换子...

    在我正在研究的生物信息学项目中,我遇到了一些编码问题.基本上,我的任务是从数据库中提取基序序列并使用该信息来注释序列比对文件.对齐文件是纯文本,因此注释不会是任何复杂的,最好只是用对齐文件本身中的星号 ...

  8. python监控数据库_【Python】NavicatPre查询日志监控并转存数据库

    [Python] 纯文本查看 复制代码# -*- coding:utf8 -*- import time import re import sqlite3 # History file path hi ...

  9. python删除数据库_用Python删除Cosmos数据库文档

    根据您的描述,我试图使用pydocument module删除我的azure document db中的文档,这对我很有效.在 这是我的代码:import pydocumentdb; import p ...

最新文章

  1. 2021年大数据ELK(十七):Elasticsearch SQL 订单统计分析案例
  2. L1-007 念数字
  3. matlab读txt文件不完整,求助Matlab批量读取TXT文件出错
  4. math.atan_JavaScript中带有示例的Math.atan()方法
  5. Base64编码解码
  6. python有哪些游戏模块_python游戏模块 Pygame常用方法
  7. suse linux ftp家目录,Suse linux下控制ftp用户访问目录
  8. android listview 不重绘,重绘listview
  9. java中减法命令_java中减法和乘法的性能比较
  10. 程序员破解推荐系统瓶颈,带来超百亿收入增量!
  11. GitHub标星7700:Python从新手到大师,只要100天
  12. iPhone开发--NSDate操作(转)
  13. td自动换行:设置table布局固定,td根据设定宽度自动换行
  14. POJ 2987 Firing【最大权闭合图】
  15. CEF JS实现获取剪贴板图片的DataURL
  16. apache2配置rewrite_module
  17. javascript鼠标效果
  18. Pulling without specifying how to reconcile divergent branches is hint: discouraged. You can squelch
  19. 网络私有云存储的几点优势
  20. CKeditor 3.1 精简版带SyntaxHighlighter插件

热门文章

  1. javaMail实现发邮件功能
  2. python图片保存jpg、show变成bmp_利用python实现.dcm格式图像转为.jpg格式
  3. Windows域环境使用教程实验
  4. idea如何使用git从gitlab下载代码
  5. netstat 和 ss中,Recv-Q和Send-Q的含义
  6. python中time模块和datetime模块
  7. 星历表2019最新跟踪
  8. HTML中的基本元素
  9. 专家谈手工查杀AV终结者病毒详解
  10. MTK平台添加虚拟sensor