-
Notifications
You must be signed in to change notification settings - Fork 493
Add support for self-hosted posts #66
base: master
Are you sure you want to change the base?
Conversation
Hey Thanks for this! However I'm not going to merge this in just yet. A big part of Syte is not having to rely on a database, if we start getting more people interested I will do so, for now I'm thinking about adding a note on the doc that points to your branch.
|
Not yet, I was going to see if you merged this and then set one up - however now I think there are some additions I will do before setting a demo up. I understand about the database part, but perhaps making it use a Sqlite database file by default would be more suitable? Sqlite3 ships with python by default, is only a single file and doesn't require an additional service to query it so its very very lightweight. |
Sqlite is also not scalable. If it were to be used over a long period of time it would not work well. If a db is to be used I recommend postgres, heroku lets you do it for free anyway. Local stuff with Django uses sqlite because it's easy for testing, not for real time deployments. |
"Sqlite is also not scalable" Its 1 post per row, and SQlite can easily handle tens of thousand of rows (and more, but I have never used it with such workloads). It would take you 27 years of posting once a day to get to 10,000 rows and even need to consider using a database like Postgresql or Mysql. Its read speeds are blazing fast (near that of 'direct' IO to a flat file) and concurrency isn't really an issue here (or though it handles that fine). Sqlite3 is the perfect choice for this workload - small, compact and greatly reduced overhead. I use it with simple and it works just fine. Please use your brain and do some research before making such statements. |
Some info on sqlite that shows some good use cases. Most small, low traffic websites would be okay, but with a personal website images, music, files are often uploaded. These may take up a lot of space, arguably you could place these on the file system and not the db though. SQlite stores all information in one static file and has a hard 2TB limit. In my opinion max hard limits on the overall database means it doesn't scale well (or at all). Also, one process change at a time is a deal breaker for me. Thanks for the brash comment though. |
You should never store static files like images, music or files in a database - BLOB's are a bad bad thing. You store them on the file system because that's what a file system is for. It also means they can be served by nginx or some other high performance webserver. Also I don't know where you got your information from but the sqlite documentation clearly states the max size of a Sqlite database is 140 terrabytes (65536 pages). One process change at a time is generally enough, blog's are by nature read intensive and don't need a high write throughput. |
I've added support for local posts via Markdown files instead of a database. You can just write markdown files, place them in the 'articles' directory and your ready to go. No other real configuration on the server-side necessary. You can check it out here, https://github.com/durden/syte/tree/logr_integration. |
can Syte support Right To Left ? there's a lot of RTL users these days (arabic+ hebrew) would like to use Syte GL |
I'd love to see a version of Syte that had the option to save all the 3rd party data to a local database. I'm a hoarder and always believe in controlling my own data. |
Again, I'd love to see this incorporated into Syte core. I want to host my own blog. This seems more advanced than the Markdown version, so I'd be inclined to pull this into the core rather than that one. |
These changes add support for self-hosted posts (i.e using a local database to store posts instead of Tumblr).
Setting the BUILTIN_POST_ENABLED setting to True will do the following:
Creating a new post is easy and uses the Redactor WYSIWYG editor.

The administration panel can be used to view and edit current posts as well as create new drafts that are not displayed on the page until they are published.
