Getting Internal Server error on Wagtail admin in production

1,855 views
Skip to first unread message

manuelalbe...@gmail.com

unread,
Mar 11, 2016, 2:09:58 PM3/11/16
to Wagtail support

I want to make my wagtail site production ready, since I turned my DEBUG setiing to False I cant access Wagtail admin anymore. Django-admin and the rest of the Site is working well except of the Wagtail userbar which also raises a 500 error on every page (http://manuelstrasser.com/admin/userbar/3/ 500 (Internal Server Error)). I guess that's an issue with compressing. After I run collectstatic, I tried to python manage.py compress which gives me the following errors: 

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/compressor/management/commands/compress.py", line 286, in handle
    self.compress(sys.stdout, **options)
  File "/usr/local/lib/python2.7/dist-packages/compressor/management/commands/compress.py", line 181, in compress
    nodes = list(parser.walk_nodes(template))
  File "/usr/local/lib/python2.7/dist-packages/compressor/offline/django.py", line 150, in walk_nodes
    for node in self.walk_nodes(node, original):
  File "/usr/local/lib/python2.7/dist-packages/compressor/offline/django.py", line 146, in walk_nodes
    for node in self.get_nodelist(node, original):
  File "/usr/local/lib/python2.7/dist-packages/compressor/offline/django.py", line 128, in get_nodelist
    return handle_extendsnode(node, block_context=None, original=original)
  File "/usr/local/lib/python2.7/dist-packages/compressor/offline/django.py", line 34, in handle_extendsnode
    compiled_parent = extendsnode.get_parent(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 134, in get_parent
    parent = self.parent_name.resolve(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 726, in resolve
    arg_vals.append(arg.resolve(context))
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 846, in resolve
    value = self._resolve_lookup(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 901, in _resolve_lookup
    (bit, current))  # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [request] in u"[{'False': False, 'None': None, 'True': True}]"

In my settings I've 

COMPRESS_ENABLED = True
COMPRESS_OFFLINE = True
ALLOWED_HOSTS = ['*',]

Any Ideas how I could get Wagtail admin work again? 
regards Manuel 

Brad Martin

unread,
Mar 13, 2016, 12:16:16 PM3/13/16
to Wagtail support
Hello Manuel!

I am not support but stumbled on to this and thought I would share my experience =)

Not sure if this is related but we ran into something similar not too long ago when we deployed our wagtail app to production. For us when we set DEBUG=False, Wagtail wanted to create CACHES folder in static/ and our apache group didn't have write access to that folder. The symptoms were exactly as you described, the entire site worked with the exception of the admin.

Check to make sure your server has complete access to read/write to static/ ?

I am not entirely sure if there is a way to turn this behavior on/off.

Hope that helps!

Tim Allen

unread,
Mar 13, 2016, 5:27:53 PM3/13/16
to Wagtail support
If Brad's suggestion doesn't work, have a look at your web server's error log files. That should give some details on what's going on; they actual error is often suppressed from the end user for an extra layer of security.


On Friday, March 11, 2016 at 2:09:58 PM UTC-5, manuelalbe...@gmail.com wrote:

Ashia Zawaduk

unread,
Mar 21, 2016, 2:10:52 PM3/21/16
to Wagtail support
Anytime this happens to me, it's because I forgot to add:
'compressor.finders.CompressorFinder',
 to STATICFILES_FINDERS
as per compressor docs.
Reply all
Reply to author
Forward
0 new messages