wagtail

IT WORKED!

bimo

 

Can you believe it!

I know I can’t. Every button I press I still hold my breath and half expect the dreaded Error page.

Now I can actually get down to doing the work of my website! HA! I foresee more painful troubleshooting there so this blog lives on.

But for now, beer is on me!

Advertisements

Uninstalling Sass

Following gasman’s advise to uninstall everything sass-related other than django_libsass and libsass, I am now running pip uninstall for compass, gem – sass and sass. 

And running import sass; sass from python manage.py shell after each uninstall.

Uninstalled Compass

<module 'sass' from '/home/clarayee/env/lib/python2.7/site-packages/sass.so'>

Gem Uninstalled Sass

<module 'sass' from '/home/clarayee/env/lib/python2.7/site-packages/sass.so'>

Uninstalled Sass

<module 'sass' from '/home/clarayee/env/lib/python2.7/site-packages/sass.pyc'>

seeing as I have no idea how to uninstall these assorted sass files, I think I will attempt to simply delete them from cpanel.

Picture 2

Good luck!

Opps! That gave me

Unable to apply CompilerFilter (‘django_libsass.SassCompiler’): [Errno 2] No such file or directory

and also

>>> import sass; sass
Traceback (most recent call last):
 File "<console>", line 1, in <module>
ImportError: No module named sass

I guess those were quite important files then. Let me try and put them back in…

OMG!

I wouldn’t believe my eyes:

Picture 3

 

 

from django_libsass import SassCompiler

Following on from the Error during Template Rendering, I still have not solved why I get a

Exception Value:
'module' object has no attribute 'compile'

as previous analyzed, I suspect it means sass is not recognized as a module. But having posted the question on StackOverflow, one of the Wagtail guys have replied :

“…Indicates that Django Compressor is trying to run django_libsass.SassCompiler as a shell command, and the script is failing to run.” – This is a red herring. Django-compressor first tries to interpret the string as a python module, and if that fails (as apparently it is doing here), it falls back on treating it as a shell command. It shouldn’t be necessary to install a command-line Sass tool to use Wagtail – the django-libsass library should be handling it entirely on the Python side.” – gasman

Looks like I’m looking at the wrong stuff then!

 

He also commented:

What error message (if any) do you get if you run from django_libsass import SassCompiler within manage.py shell? –  gasman

I went back into shell, ran

python manage.py shell

Python 2.7.6 (default, Nov 11 2013, 18:34:29)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
(InteractiveConsole)
>>> from django_libsass import SassCompiler

Did not get any errors there, which means django_libsass and SassCompiler are both working and the errors lies elsewhere. Will have to go strain my eyes and poke at that riddle.

SassCompile on command line

Following this StackOverflow reply,

/bin/sh: django_libsass.SassCompiler: command not found

Indicates that Django Compressor is trying to run django_libsass.SassCompiler as a shell command, and the script is failing to run. -Kevin Mooney

So digging through the traceback, I found a line that referenced compressor.

Further digging into compressor reveals this line in

/home/username/env/lib/python2.7/site-packages/compressor/filters/base.py

if "{outfile}" in self.command and not "outfile" in options:
ext = self.type and ".%s" % self.type or ""
self.outfile = NamedTemporaryFile(mode='r+', suffix=ext)
options["outfile"] = self.outfile.name
try:
command = fstr(self.command).format(**options)
proc = subprocess.Popen(command, shell=True, cwd=self.cwd,
stdout=self.stdout, stdin=self.stdin, stderr=self.stderr)
if self.infile is None:
filtered, err = proc.communicate(self.content.encode('utf8'))
else:
filtered, err = proc.communicate()
except (IOError, OSError), e:
raise FilterError('Unable to apply %s (%r): %s' %
(self.__class__.__name__, self.command, e))

So being the brutish non-coder that I am, I simply turned that ‘off’ to :

command = fstr(self.command).format(**options)
proc = subprocess.Popen(command, shell=False, cwd=self.cwd,
stdout=self.stdout, stdin=self.stdin, stderr=self.stderr)

It definitely helped to stop the

Error during template rendering

In template /home/username/env/lib/python2.7/site-packages/wagtail/wagtailadmin/templates/wagtailadmin/skeleton.html, error at line 20
/bin/sh: django_libsass.SassCompiler: command not found

Although now I get a :

'module' object has no attribute 'compile'

Hmm… let’s see where to go next?

Ruby Gem

In a bid to find sass, seeing as I cannot call it from command line, I have gem install sass and followed this StackOverflow answer.

> rails c
Loading development environment (Rails 3.2.11)
1.9.3p362 :001 > throw test

Loading that creates a new Ruby folder in my directory and tada! i found sass-3.3.3 sitting pretty in a gems folder.

Picture 20

Will dig through this sass folder and see what I find!

Django: Unhandled Exception

Unhandled Exception

An unhandled exception was thrown by the application.

Possible causes:

  1. Uninstalled  module listed in settings.py INSTALLED_APPS

Possible action to take:

  1. Check apache error log
  2. Try running ./dispatch.fcgi in shell to see if it generates a traceback error or if it displays the correct html

note to self: wait at least 5min between changing the settings.py or dispatch.fcgi before allowing your domain to reflect any changes

Wagtail.io

This is the sole purpose of me setting up my website. To use wagtail as a CMS…

I have progressed on from fumbling about in shell, and am now attempting to install Wagtail. It actually took me 3 long days to see this sweet image:

Picture 16

at which point I was

finn-hair-adventure-time-o

that is until I navigated into the login page and very sadly realise:

Picture 17