Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staticsitegen command fails for documents since commit 918f286 #1183

Closed
pcraston opened this issue Apr 14, 2015 · 5 comments
Closed

staticsitegen command fails for documents since commit 918f286 #1183

pcraston opened this issue Apr 14, 2015 · 5 comments
Labels
Milestone

Comments

@pcraston
Copy link

The staticsitegen command uses django-medusa to generate a static version of the wagtail site. Since commit 918f286 wagtail uses StreamingHttpResponse to return Documents, which causes medusa to fail as it simply saves response.content to disk (https://github.com/ctxis/django-medusa/blob/master/django_medusa/renderers/disk.py#L56) and StreamingHttpResponse has no content attribute.

I've pushed a fix to our fork of django-medusa (https://github.com/ctxis/django-medusa) and submitted a pull request (mtigas/django-medusa#20). It iterates over the streaming_response attribute if response is streaming and saves the chunks to file, otherwise it uses response.content.

Until this PR has been merged, do you think it's worth adding a note to the staticsitegen section of the wagtail docs?

@atbug
Copy link

atbug commented Apr 15, 2015

Yes, staticsitegen fails using release 1.0b1 and I think a note is necessary.

@gasman gasman added this to the 1.0 milestone Apr 15, 2015
@tomdyson
Copy link
Contributor

Thanks for raising this, @pcraston. We'll look at a fix; in the meantime could you do a PR for a note in the docs?

@atbug
Copy link

atbug commented Apr 15, 2015

I downloaded the zip from (https://github.com/ctxis/django-medusa) and copied the module to a fresh started project mysite. But I still got the following error:

Chongs-MacBook-Air:mysite chongwang$ python manage.py staticsitegen
Skipping app 'mysite'... (No 'renderers.py')
Skipping app 'django.contrib.admin'... (No 'renderers.py')
Skipping app 'django.contrib.auth'... (No 'renderers.py')
Skipping app 'django.contrib.contenttypes'... (No 'renderers.py')
Skipping app 'django.contrib.sessions'... (No 'renderers.py')
Skipping app 'django.contrib.messages'... (No 'renderers.py')
Skipping app 'django.contrib.staticfiles'... (No 'renderers.py')
Skipping app 'compressor'... (No 'renderers.py')
Skipping app 'taggit'... (No 'renderers.py')
Skipping app 'modelcluster'... (No 'renderers.py')
Skipping app 'wagtail.wagtailcore'... (No 'renderers.py')
Skipping app 'wagtail.wagtailadmin'... (No 'renderers.py')
Skipping app 'wagtail.wagtaildocs'... (No 'renderers.py')
Skipping app 'wagtail.wagtailsnippets'... (No 'renderers.py')
Skipping app 'wagtail.wagtailusers'... (No 'renderers.py')
Skipping app 'wagtail.wagtailsites'... (No 'renderers.py')
Skipping app 'wagtail.wagtailimages'... (No 'renderers.py')
Skipping app 'wagtail.wagtailembeds'... (No 'renderers.py')
Skipping app 'wagtail.wagtailsearch'... (No 'renderers.py')
Skipping app 'wagtail.wagtailredirects'... (No 'renderers.py')
Skipping app 'wagtail.wagtailforms'... (No 'renderers.py')
Found renderers for 'wagtail.contrib.wagtailmedusa'...
Skipping app 'core'... (No 'renderers.py')
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/Users/chongwang/Workspace/test/mysite/django_medusa/management/commands/staticsitegen.py", line 17, in handle
    r.generate()
  File "/Users/chongwang/Workspace/test/mysite/django_medusa/renderers/base.py", line 69, in generate
    self.render_path(path)
  File "/Users/chongwang/Workspace/test/mysite/django_medusa/renderers/base.py", line 65, in render_path
    raise NotImplementedError
NotImplementedError

environment:
python 2.7.9
wagtail 1.0b1
django 1.7.7

@davecranwell
Copy link
Contributor

We've agreed to investigate ways to make work without medusa patch.

See also #1176

kaedroho added a commit that referenced this issue Apr 23, 2015
#1183 add note to staticsitegen documentation
JoshBarr pushed a commit to JoshBarr/wagtail that referenced this issue Apr 25, 2015
…y using fork of django-medusa to process Documents
@kaedroho
Copy link
Contributor

kaedroho commented May 7, 2015

This can now be worked around by setting the SENDFILE_BACKEND setting to sendfile.backends.simple.

https://github.com/torchbox/wagtail/blob/40092e18526d59c8ca0966743de7f93d14a8304c/docs/contrib/staticsitegen.rst#installing-django-medusa

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

No branches or pull requests

6 participants