VectorLinux
December 19, 2014, 06:38:20 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: [solved] Trying to install Pinax  (Read 3032 times)
MarkGrieveson
Vectorian
****
Posts: 531


« on: October 05, 2012, 10:26:24 am »

Hello.  This is an issue carried over from here.

I have been trying to install Pinax, using the instructions from this site.  At the Running a Project step, specifically running the command "python manage.py runserver", the server does run:

Code:
mark:$ python manage.py runserver
Validating models...

0 errors found
Django version 1.4.1, using settings 'mysite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.


But, when I check the site, I am told of the following error:

Code:
ImproperlyConfigured at /

Error importing template source loader django.template.loaders.filesystem.load_template_source: "'module' object has no attribute 'load_template_source'"

Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.4.1
Exception Type: ImproperlyConfigured
Exception Value:

Error importing template source loader django.template.loaders.filesystem.load_template_source: "'module' object has no attribute 'load_template_source'"

Exception Location: /media/Extra/mysite-env/lib/python2.7/site-packages/django/template/loader.py in find_template_loader, line 101
Python Executable: /media/Extra/mysite-env/bin/python
Python Version: 2.7.2
Python Path:

['/media/Extra/mysite/apps',
 '/media/Extra/mysite',
 '/media/Extra/mysite-env/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
 '/media/Extra/mysite-env/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg',
 '/media/Extra/mysite-env/lib/python27.zip',
 '/media/Extra/mysite-env/lib/python2.7',
 '/media/Extra/mysite-env/lib/python2.7/plat-linux2',
 '/media/Extra/mysite-env/lib/python2.7/lib-tk',
 '/media/Extra/mysite-env/lib/python2.7/lib-old',
 '/media/Extra/mysite-env/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/media/Extra/mysite-env/lib/python2.7/site-packages']

Server time: Fri, 5 Oct 2012 14:41:32 -0400



Here is the traceback"

Code:
Environment:


Request Method: GET
Request URL: http://localhost:8000/

Django Version: 1.4.1
Python Version: 2.7.2
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.humanize',
 'pinax.templatetags',
 'pinax_theme_bootstrap',
 'staticfiles',
 'compressor',
 'debug_toolbar']
Installed Middleware:
['django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'pinax.middleware.security.HideSensistiveFieldsMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware']


Traceback:
File "/media/Extra/mysite-env/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  188.                 response = middleware_method(request, response)
File "/media/Extra/mysite-env/lib/python2.7/site-packages/debug_toolbar/toolbar/loader.py" in render_toolbar
  98.         return render_to_string('debug_toolbar/base.html', context)
File "/media/Extra/mysite-env/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  169.         t = get_template(template_name)
File "/media/Extra/mysite-env/lib/python2.7/site-packages/django/template/loader.py" in get_template
  145.     template, origin = find_template(template_name)
File "/media/Extra/mysite-env/lib/python2.7/site-packages/django/template/loader.py" in find_template
  128.             loader = find_template_loader(loader_name)
File "/media/Extra/mysite-env/lib/python2.7/site-packages/django/template/loader.py" in find_template_loader
  101.             raise ImproperlyConfigured('Error importing template source loader %s: "%s"' % (loader, e))

Exception Type: ImproperlyConfigured at /
Exception Value: Error importing template source loader django.template.loaders.filesystem.load_template_source: "'module' object has no attribute 'load_template_source'"

I haven't a clue how to fix this.
« Last Edit: November 06, 2012, 07:16:55 am by MarkGrieveson » Logged

I am using VL7.0 standard with XFCE
MarkGrieveson
Vectorian
****
Posts: 531


« Reply #1 on: October 05, 2012, 10:50:18 am »

Okay, I found a site that said I could fix it if I did the following:

Quote
Just change (within settings.py):

django.template.loaders.app_directories.load_template_source
TO
django.template.loaders.app_directories.Loader

I did this, and the "improperly configured" error seems to have gone, which is good.  But, now it says "Template does not exist".  Anyone know where I can find these templates?

Code:
TemplateDoesNotExist at /

homepage.html

Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.4.1
Exception Type: TemplateDoesNotExist
Exception Value:

homepage.html

Exception Location: /media/Extra/mysite-env/lib/python2.7/site-packages/django/template/loader.py in find_template, line 138
Python Executable: /media/Extra/mysite-env/bin/python
Python Version: 2.7.2
Python Path:

['/media/Extra/mysite/apps',
 '/media/Extra/mysite',
 '/media/Extra/mysite-env/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
 '/media/Extra/mysite-env/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg',
 '/media/Extra/mysite-env/lib/python27.zip',
 '/media/Extra/mysite-env/lib/python2.7',
 '/media/Extra/mysite-env/lib/python2.7/plat-linux2',
 '/media/Extra/mysite-env/lib/python2.7/lib-tk',
 '/media/Extra/mysite-env/lib/python2.7/lib-old',
 '/media/Extra/mysite-env/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/media/Extra/mysite-env/lib/python2.7/site-packages']

Server time: Fri, 5 Oct 2012 14:57:51 -0400
Template-loader postmortem

Django tried loading these templates, in this order:

    Using loader django.template.loaders.app_directories.Loader:
        /media/Extra/mysite-env/lib/python2.7/site-packages/django/contrib/admin/templates/homepage.html (File does not exist)
        /media/Extra/mysite-env/lib/python2.7/site-packages/django/contrib/auth/templates/homepage.html (File does not exist)
        /media/Extra/mysite-env/lib/python2.7/site-packages/pinax_theme_bootstrap/templates/homepage.html (File does not exist)
        /media/Extra/mysite-env/lib/python2.7/site-packages/compressor/templates/homepage.html (File does not exist)
        /media/Extra/mysite-env/lib/python2.7/site-packages/debug_toolbar/templates/homepage.html (File does not exist)

Logged

I am using VL7.0 standard with XFCE
rbistolfi
Packager
Vectorian
****
Posts: 2291


« Reply #2 on: October 05, 2012, 11:09:22 am »

Hi Mark,

The templates are in the "<project_root>/templates" directory.
Its weird that Pinax cant find them, and I have problems trying to reproduce the error.
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
rbistolfi
Packager
Vectorian
****
Posts: 2291


« Reply #3 on: October 05, 2012, 11:23:31 am »

Hmm I think the fix for the first problem caused problems finding the templates. If you check the paths listed after "Django tried loading these templates, in this order", the proper path was being looked up in the first case but not in the second.
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
MarkGrieveson
Vectorian
****
Posts: 531


« Reply #4 on: October 05, 2012, 11:40:48 am »

Hi Mark,

The templates are in the "<project_root>/templates" directory.
Its weird that Pinax cant find them, and I have problems trying to reproduce the error.


Hi rbistolfi,

I'm not sure why this is giving me so many problems.  There's the virtual environment (mysite-env) and the project (mysite).  It seems to be searching the virtual environment (mysite-env) rather than the project (mysite) for the homepage template. 

Code:
(mysite-env)vector://media/Extra/mysite
mark:$ cd templates
(mysite-env)vector://media/Extra/mysite/templates
mark:$ ls
_footer.html  homepage.html  site_base.html
(mysite-env)vector://media/Extra/mysite/templates
mark:$

There are templates in the virtual environment, but not a homepage.html template.  For instance:

Code:
(mysite-env)vector://media/Extra/mysite-env/lib/python2.7/site-packages/django/contrib/admin
mark:$ cd templates
(mysite-env)vector://media/Extra/mysite-env/lib/python2.7/site-packages/django/contrib/admin/templates
mark:$ ls
admin/  registration/
(mysite-env)vector://media/Extra/mysite-env/lib/python2.7/site-packages/django/contrib/admin/templates
mark:$ ls
admin/  registration/
(mysite-env)vector://media/Extra/mysite-env/lib/python2.7/site-packages/django/contrib/admin/templates
mark:$ cd admin
(mysite-env)vector://media/Extra/mysite-env/lib/python2.7/site-packages/django/contrib/admin/templates/admin
mark:$ ls
404.html                  delete_selected_confirmation.html
500.html                  edit_inline/
actions.html              filter.html
app_index.html            includes/
auth/                     index.html
base.html                 invalid_setup.html
base_site.html            login.html
change_form.html          object_history.html
change_list.html          pagination.html
change_list_results.html  prepopulated_fields_js.html
date_hierarchy.html       search_form.html
delete_confirmation.html  submit_line.html
(mysite-env)vector://media/Extra/mysite-env/lib/python2.7/site-packages/django/contrib/admin/templates/admin
mark:$

I'm not sure how to get it to search in the correct area.
Logged

I am using VL7.0 standard with XFCE
MarkGrieveson
Vectorian
****
Posts: 531


« Reply #5 on: October 05, 2012, 12:04:09 pm »

I think I fixed the template issue!!  From the site where I got the first fix, I had only changed the directories loader, but not the filesystem loader within the settings.py file.  So, when I also changed the filesystem loader, it seemed to work.

Code:
TEMPLATE_LOADERS = [
     "django.template.loaders.filesystem.Loader",
#    "django.template.loaders.filesystem.load_template_source",
#    "django.template.loaders.app_directories.load_template_source",
     "django.template.loaders.app_directories.Loader",
]

Logged

I am using VL7.0 standard with XFCE
rbistolfi
Packager
Vectorian
****
Posts: 2291


« Reply #6 on: October 05, 2012, 12:09:55 pm »

That looks like a working pinax install indeed Smiley
There is a ton of addons and stuff to customize it.
Have fun and keep us informed!
Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
MarkGrieveson
Vectorian
****
Posts: 531


« Reply #7 on: October 05, 2012, 12:14:18 pm »

Thanks.  Admittedly, now that it's installed, I haven't a clue what to do with it.
Logged

I am using VL7.0 standard with XFCE
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!