Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Add support for self-hosted posts #66

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add support for self-hosted posts #66

wants to merge 6 commits into from

Conversation

orf
Copy link

@orf orf commented Jul 8, 2012

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:

  • All posts will be pulled from a local database (specified in the BUILTIN_POST_DATABASE_SETTINGS setting)
  • An administration panel will be added at /admin/ to allow authenticated users (specified in the settings) to manage posts.
  • Posts can be viewed by their slug at /p/SLUG, e.g /p/my-first-post

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.

@rigoneri
Copy link
Owner

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.
Once again thanks for doing this! Do you have a version of a Syte using your database implementation anywhere?

  • Rigo

@orf
Copy link
Author

orf commented Jul 18, 2012

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.

@garrypolley
Copy link
Contributor

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.

@orf
Copy link
Author

orf commented Jul 25, 2012

"Sqlite is also not scalable"
That's a pretty ridiculous thing to say in this context. Yeah, it won't scale to a thousand transactions a second like Postgres might but we are talking about a personal blog site.

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.

@garrypolley
Copy link
Contributor

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.

@orf
Copy link
Author

orf commented Jul 25, 2012

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.

@durden
Copy link
Contributor

durden commented Aug 4, 2012

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.

@TheLove
Copy link

TheLove commented Oct 31, 2012

can Syte support Right To Left ?

there's a lot of RTL users these days (arabic+ hebrew) would like to use Syte

GL

@BradMcGonigle
Copy link

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.

@bnb
Copy link
Contributor

bnb commented Feb 3, 2013

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants