Re: Obtaining content from Git

2014-11-24 Thread martin f krafft
also sprach Russell Keith-Magee [2014-11-25 01:16 +0100]: > Sure - that could work too. Although I'd question why you'd do > this, rather than just checking out the relevant hash onto the > filesystem, and doing a direct filesystem read. Yeah, and I think you have me 99.5% convinced that I want

Re: Obtaining content from Git

2014-11-24 Thread Russell Keith-Magee
On Mon, Nov 24, 2014 at 7:43 PM, martin f krafft wrote: > also sprach Russell Keith-Magee [2014-11-24 > 11:38 +0100]: > > Perhaps I wasn't clear. > > No, you were. I am just pushing back a little bit because I come > from another angle and I greatly appreciate your explanations in > helping me u

Re: Obtaining content from Git

2014-11-24 Thread reduxionist
Arg, Google Groups' mobile interface sucks for posting rather than reading. As I was trying to say: On Tuesday, November 25, 2014 2:43:55 AM UTC+7, reduxionist wrote: > > >Hence I was thinking: how much trouble would it be to have Django > >reach into Git rather than its database and obtain data

Obtaining content from Git

2014-11-24 Thread reduxionist
>Hence I was thinking: how much trouble would it be to have Django >reach into Git rather than its database and obtain data there to be >filled into template slots? Ideally, there'd be the possibility of >running a filter (e.g. reStructuredText) between Git and the >template rendering. >What

Re: Obtaining content from Git

2014-11-24 Thread Tim Chase
On 2014-11-24 11:49, martin f krafft wrote: > also sprach Tim Chase [2014-11-24 > 11:19 +0100]: > > urlpatterns = patterns('', > > url(r'^blob/([0-9a-f]{40})/$', > > 'myapp.views.render_blob', ...), ) > > … this is straight-forward, thanks. I'd probably try not to expose > the SHAs to the u

Re: Obtaining content from Git

2014-11-24 Thread martin f krafft
also sprach Russell Keith-Magee [2014-11-24 11:38 +0100]: > Perhaps I wasn't clear. No, you were. I am just pushing back a little bit because I come from another angle and I greatly appreciate your explanations in helping me understand the Django way of thinking. So in the hope that you now don'

Re: Obtaining content from Git

2014-11-24 Thread martin f krafft
also sprach Tim Chase [2014-11-24 11:19 +0100]: > urlpatterns = patterns('', > url(r'^blob/([0-9a-f]{40})/$', 'myapp.views.render_blob', ...), > ) … this is straight-forward, thanks. I'd probably try not to expose the SHAs to the user but request from the Git library a blob identified b

Re: Obtaining content from Git

2014-11-24 Thread Russell Keith-Magee
On Mon, Nov 24, 2014 at 5:06 PM, martin f krafft wrote: > also sprach Russell Keith-Magee [2014-11-24 > 07:16 +0100]: > > The right place is in the view. > […] > > If you want to do "interesting" things like retrieve a specific > > file version, you're not going to be able to use the storage API

Re: Obtaining content from Git

2014-11-24 Thread Tim Chase
On 2014-11-24 10:06, martin f krafft wrote: > It could come from Git! After all, Git is really a database by > itself, just like the filesystem could be viewed as a database. [snip] > Furthermore, I'd actually like to post-process the data. The Git > repo would contain reStructuredText files and I'

Re: Obtaining content from Git

2014-11-24 Thread martin f krafft
also sprach Russell Keith-Magee [2014-11-24 07:16 +0100]: > The right place is in the view. […] > If you want to do "interesting" things like retrieve a specific > file version, you're not going to be able to use the storage API, > because most raw Interesting perspective you have there, which I

Re: Obtaining content from Git

2014-11-23 Thread Russell Keith-Magee
On Mon, Nov 24, 2014 at 1:45 PM, martin f krafft wrote: > also sprach Russell Keith-Magee [2014-11-24 > 00:42 +0100]: > > The problem is that there isn't one. There's several :-) > > > > I'm aware of at least 3: > > > > https://pypi.python.org/pypi/GitPython/0.3.2.1 > > https://pypi.python.org/p

Re: Obtaining content from Git

2014-11-23 Thread martin f krafft
also sprach Russell Keith-Magee [2014-11-24 00:42 +0100]: > The problem is that there isn't one. There's several :-) > > I'm aware of at least 3: > > https://pypi.python.org/pypi/GitPython/0.3.2.1 > https://pypi.python.org/pypi/pygit2 > https://pypi.python.org/pypi/dulwich I am aware of those

Re: Obtaining content from Git

2014-11-23 Thread Russell Keith-Magee
On Sun, Nov 23, 2014 at 5:28 AM, martin f krafft wrote: > Hello, > > we have a Django project with a few pages that come from Git. > Currently, Apache rewrite rules serve those files statically (and > they make use of the same template/CSS as Django does, so the user > does not actually notice),

Obtaining content from Git

2014-11-22 Thread martin f krafft
Hello, we have a Django project with a few pages that come from Git. Currently, Apache rewrite rules serve those files statically (and they make use of the same template/CSS as Django does, so the user does not actually notice), and it's a massive hack and pain to keep up-to-date. Hence I was thi

Re: Obtaining content from Git

2014-11-21 Thread Aaron C. de Bruyn
I'm not aware of any such module, but there are a few python 'git' modules for reading/writing, etc... As for how much trouble it would be, that all depends on how familiar you are with git, python, Django, and the template system. One way you might be able to achieve what you want is to create y

Obtaining content from Git

2014-11-21 Thread martin f krafft
Hello, we have a Django project with a few pages that come from Git. Currently, Apache rewrite rules serve those files statically (and they make use of the same template/CSS as Django does, so the user does not actually notice), and it's a massive hack and pain to keep up-to-date. Hence I was thi