TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Flask-Skeleton - a boilerplate for flask

40 pointsby JayIntover 13 years ago

3 comments

devinusover 13 years ago
I found this gem of a comment in the code that perfectly described what I ended up having to painfully learn on my own:<p><pre><code> # SQL ORM Missive: # # Don't use models to automatically generate schemas. After iterating several # times with SQLAlchemy (and nearly every other ORM from frameworks both long # since dead and still trendy), to get a schema "just right" requires # entirely too much fiddling in the ORM. My hard earned lesson: SQL is the # right dialect to describe your database's structure (read: do not use an # ORM to generate DDL). Other than portability, what's the advantage of # describing your schema in SQLAlchemy? # # For as fantastic as SQLAlchemy is, using SQLAlchemy to generate schema is # the equivalent of giving yourself a lobotomy while in the middle of # attempting to write a Pulitzer Prize article. Why handicap yourself? Use # SQLAlchemy for what it excels at: generating efficient SQL based on # mappings between Python classes and database tables. Manually generated # schema results in a few extra lines of code in a tiny number of files, but # it goes a long ways towards clarity, predictability and # explicitness. Automatic schema migrations, you say? l2dba or gtfo. # # Re: PostgreSQL vs other RDBMS'es. Here's another piece of hard earned # knowledge from my last 14yrs of dorking with countless websites and # databases: portability to other relational databases is a straw man # argument. PostgreSQL is faster, more stable, the most standards conformant # relational database, is ridiculously feature rich and cheaper to operate # than its alternatives (both in terms of operations and efficiency on # hardware), and that's the short list of reasons. If you are building a # website, I am unable to produce a single fact based, data driven argument # to use MySQL[1]. Hiring? Training? Replication? Feh, that's FUD. Please # stop perpetrating harm on your own organization and applications by # succumbing to unfounded beliefs and lemmingism. # # [1] There are three situations where I would use a different relational # database. The first two situations are: 1) if my target hosting platform # did not support SystemV shared memory, or 2) I am architecting something # for an embedded or mobile device. In the former case, I'd change hosting # providers or would fire my system administrator, and in the latter, I'd use # SQLite. What's the third case? The answer is DB2, but what's the question? </code></pre> I wish I had read this comment 2 years ago.
评论 #3450574 未加载
评论 #3449815 未加载
评论 #3450640 未加载
评论 #3450091 未加载
hafabnewover 13 years ago
After reading the install file, I definitely wouldn't use this.<p>Aside from the snarky comments about bash, the install directions are rambling, encourage poor practices and are generally just pretty awful
评论 #3451307 未加载
the_mitsuhikoover 13 years ago
I really can't recommend that.
评论 #3449658 未加载