error

Extending a base.html

Further digging into the templates of my website, I’ve tried setting up a base.html and using it to extend throughout the rest of my website. Seem to have a problem getting Django to find it though, because right now it says

base.html template does not exist

although it’s parked right next to all my other htmls in my templates/wagweb folder. hmm… reminds me of when static files were not loaded. Something is differently pointing wrongly!

Advertisements

{% static %} files

Now i’ve finally moved on to creating my own templates within django/wagtail. But first I have a bit of an issue with the static files.

When I attempt to add images in Wagtail,

Picture 12

I get the dreaded Internal Server Error

Internal Server Error
The server encountered an internal error or 
misconfiguration and was unable to complete 
your request.

 

 

 

 

 

 

 

 

Picture 11

 

Additionally, attempting to link to images in my static folder like so:

<p><img src="{% static "its_alive1.gif" %}" alt="Its Alive" /></p>

gives a broken image, although if I navigate to http://username.com/static/image.gif I can see the image in my browser.

Right now my settings.py are as follow:

MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
STATIC_URL = '/home/clarayee/website/static/'
STATICFILES_DIRS = ()

The STATIC_URL is a hard-rooted to test if it makes any difference. Nope, no difference!

Unhandled again

oops! I manage to cause an unhandled exception again.

This comes after pip installing Beautiful Soup 4, Beautiful Soup and attempting to install lxml.

A look at ./dispatch.fcgi give the traceback:

File "/home/clarayee/env/lib/python2.7/site-packages/bs4/builder/__init__.py", line 317, in <module>
 from . import _lxml
 File "/home/clarayee/env/lib/python2.7/site-packages/bs4/builder/_lxml.py", line 9, in 
<module>

from lxml import etree
 File "lxml.etree.pyx", line 167, in init lxml.etree (src/lxml/lxml.etree.c:192356)
TypeError: encode() argument 1 must be string without null bytes, not unicode
Content-Type: text/html

 

as suspected! it’s because of the lxml I’ve been messing with.

May be linked to the previous Runtime error with lxml I’ve raised… stay tuned…

Error during template rendering

Picture 18

 

Error during template rendering

In template /home/username/env/lib/python2.7/site-packages/wagtail/wagtailadmin/templates/wagtailadmin/skeleton.html, error at line 20

‘module’ object has no attribute ‘compile’

 

This is what I’m stuck at now.

line 20 = {% compress css %}

in my admin skeleton.html

Which means the error links back to the Compressor.

Digging through the traceback logs reveal:

51. return compile(filename=self.filename)
File “/home/username/env/lib/python2.7/site-packages/django_libsass.py” in compile
41. return sass.compile(**kwargs)

Exception Type: AttributeError at /admin/login/
Exception Value: ‘module’ object has no attribute ‘compile’

Django_libsass is a django-compressor filter to compile SASS files using libsass, written by torchbox, the same guys who wrote Wagtail.

‘module’ object refers to sass in line 41.

either it does not recognize sass, or there is no compile class within sass for django_libsass to call and hence this error.

Possible Actions:

  1. Check dependencies and requirements are properly installed
  2. Check that django_libsass is on path and python path
  3. Find out where is sass.
  4. Do I have to pip install sass or is it within django_libsass?
  5. Find if compile is defined in sass, wherever that is
  6. See if I can run sass and compile in command line
  7. List django_libsass in settings.py as a ‘module’

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