new smug install issue

12 views
Skip to first unread message

Jon Wilson

unread,
Aug 26, 2011, 9:48:56 PM8/26/11
to smug...@googlegroups.com
In upgrading my server I decided to upgrade my smug as well (since it was quite old).

One correction: the TEMPLATE_LOADERS should be smug.extras.smug_load_template_source (it is currently smug.extras.load_template_source)

Also, the SMUG_REPOSITORES, url.conf and smugurl's info is incredibly vague. I've read through it several times and can't really figure out what the correlation between the three is supposed to be. Perhaps this is is the issue below:

I have index.rst files, and the following .smug file

directory_index index.html
convert from .rst to .html using rst2html

And I can load my .css files and the .rst files directly, but the conversion from rst to html isn't working (so .html throw the following error)

Environment:

Request Method: GET
Request URL: http://localhost:8000/wiki/index.html
Django Version: 1.2.5
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.markup',
 'jbl.builder',
 'jbl.ttags',
 'smug']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware')

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.function:
Using loader django.template.loaders.app_directories.function:
Using loader smug.extras.function:



Traceback:
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
  100.                     response = callback(request, *callback_args, **callback_kwargs)
File "/home/wilson/rcs/smug/smug/views/page.py" in page
  51.     return pathop(request, page, repo, branch)
File "/home/wilson/rcs/smug/smug/pathops/show.py" in show
  26.     filtered_file = get_content(page, branch, repo, request, raw=raw)
File "/home/wilson/rcs/smug/smug/load.py" in get_content
  103.     if not dest_file.exists():
File "/home/wilson/rcs/smug/smug/load.py" in exists
  206.             self.lookup()
File "/home/wilson/rcs/smug/smug/load.py" in lookup
  248.             self.retrieve()
File "/home/wilson/rcs/smug/smug/load.py" in retrieve
  380.             filter(self, repo=self.repo, **kwds)
File "/home/wilson/rcs/smug/smug/filters.py" in rst2html
  142.     file.content = render_to_string(template, context_dict)
File "/usr/lib/python2.6/site-packages/django/template/loader.py" in render_to_string
  181.         t = get_template(template_name)
File "/usr/lib/python2.6/site-packages/django/template/loader.py" in get_template
  157.     template, origin = find_template(template_name)
File "/usr/lib/python2.6/site-packages/django/template/loader.py" in find_template
  138.     raise TemplateDoesNotExist(name)

Exception Type: TemplateDoesNotExist at /wiki/index.html
Exception Value: wiki.html




My urls.conf file has the following two applicable lines

    (r'^wiki/', include('smug.urls')),
    smugurl(r'^wiki/', repo='default'),

Again, anything that is a pure static file the process works fine with. It is just the index.rst to index.html conversion that is failing.

Any ideas / improvements for the install doc that would help me fix this issue?

Thanks

Andrew McNabb

unread,
Aug 29, 2011, 1:43:22 PM8/29/11
to smug...@googlegroups.com
On Fri, Aug 26, 2011 at 06:48:56PM -0700, Jon Wilson wrote:
> In upgrading my server I decided to upgrade my smug as well (since it was
> quite old).
>
> One correction: the TEMPLATE_LOADERS should be smug.extras.smug_load_template_source
> (it is currently smug.extras.load_template_source)

Thanks. This is fixed now.

> Also, the SMUG_REPOSITORES, url.conf and smugurl's info is incredibly vague.
> I've read through it several times and can't really figure out what the
> correlation between the three is supposed to be. Perhaps this is is the
> issue below:

We'll talk about the documentation offline--any suggestions for
improvement in the docs would certainly be welcome.


> I have index.rst files, and the following .smug file
>
> directory_index index.html
> convert from .rst to .html using rst2html
>
> And I can load my .css files and the .rst files directly, but the conversion
> from rst to html isn't working (so .html throw the following error)
>

> Exception Type: TemplateDoesNotExist at /wiki/index.html
> Exception Value: wiki.html

It looks like Django is complaining that it can't find wiki.html. It's
possible that settings.py is missing the line that tells Django how to
go to Smug to fetch templates. You may need to look at both the
TEMPLATE_LOADERS and TEMPLATE_DIRS variables in your settings.py. Feel
free to share them here if you like.

> My urls.conf file has the following two applicable lines
>
> (r'^wiki/', include('smug.urls')),
> smugurl(r'^wiki/', repo='default'),

That looks good.


--
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868

Reply all
Reply to author
Forward
0 new messages