On Sun, Sep 6, 2009 at 16:09, wrong <wrong...@gmail.com> wrote: > Can you show the output of these commands below? > (from django shell and from running under fastfcgi deamons) > > import sys > print sys.executable > for p in sys.path: print p
Django Shell: ======================================== >>> import sys >>> print sys.executable /usr/local/bin/python2.5 >>> for p in sys.path: print p ... /home/tinodb/webapps/django/projects/dsac /home/tinodb/webapps/django/lib/python2.5/flup-1.0.1-py2.5.egg /home/tinodb/webapps/django/lib/python2.5 /home/tinodb/lib/python2.5/TurboGears-1.0.4.2-py2.5.egg /home/tinodb/lib/python2.5/TurboKid-1.0.4-py2.5.egg /home/tinodb/lib/python2.5/TurboJson-1.1.2-py2.5.egg /home/tinodb/lib/python2.5/TurboCheetah-1.0-py2.5.egg /home/tinodb/lib/python2.5/simplejson-1.7.3-py2.5-linux-i686.egg /home/tinodb/lib/python2.5/RuleDispatch-0.5a0.dev_r2306-py2.5-linux-i686.egg /home/tinodb/lib/python2.5/PasteScript-1.3.6-py2.5.egg /home/tinodb/lib/python2.5/FormEncode-0.9-py2.5.egg /home/tinodb/lib/python2.5/DecoratorTools-1.7-py2.5.egg /home/tinodb/lib/python2.5/configobj-4.4.0-py2.5.egg /home/tinodb/lib/python2.5/CherryPy-2.3.0-py2.5.egg /home/tinodb/lib/python2.5/kid-0.9.6-py2.5.egg /home/tinodb/lib/python2.5/Cheetah-2.0.1-py2.5-linux-i686.egg /home/tinodb/lib/python2.5/PyProtocols-1.0a0dev_r2302-py2.5-linux-i686.egg /home/tinodb/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg /home/tinodb/lib/python2.5/Paste-1.5.1-py2.5.egg /home/tinodb/lib/python2.5/SQLObject-0.9.3-py2.5.egg /home/tinodb/lib/python2.5/nose-0.9.3-py2.5.egg /home/tinodb/lib/python2.5/SQLAlchemy-0.4.2p3-py2.5.egg /home/tinodb/lib/python2.5/Elixir-0.5.2-py2.5.egg /home/tinodb/lib/python2.5/PIL-1.1.6-py2.5-linux-i686.egg /home/tinodb/lib/python2.5/pysqlite-2.5.3-py2.4-linux-i686.egg /home/tinodb/lib/python2.5/Pygments-1.0-py2.5.egg /home/tinodb/lib/python2.5/Reportlab-2.1-py2.5.egg /home/tinodb/lib/python2.5/matplotlib-0.91.1-py2.5-linux-i686.egg /home/tinodb/lib/python2.5/rst2pdf-0.10.1.dev_r683-py2.5.egg /home/tinodb/lib/python2.5/docutils-0.5-py2.5.egg /home/tinodb/lib/python2.5/mercurial-1.3.1-py2.5-linux-i686.egg /home/tinodb/lib/python2.5 /usr/local/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg /usr/local/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg /usr/local/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg /usr/local/lib/python25.zip /usr/local/lib/python2.5 /usr/local/lib/python2.5/plat-linux2 /usr/local/lib/python2.5/lib-tk /usr/local/lib/python2.5/lib-dynload /usr/local/lib/python2.5/site-packages /usr/local/lib/python2.5/site-packages/PIL >>> ========================================== with the following code in the function: import sys import logging logging.basicConfig(filename='dsac.log',level=logging.DEBUG) logging.debug('\n\n') logging.debug(sys.executable) logging.debug('\n') for p in sys.path: logging.debug(p) =============================================== DEBUG:root:/usr/local/bin/python2.5 DEBUG:root: DEBUG:root:/home/tinodb/webapps/django/projects/dsac DEBUG:root:/home/tinodb/webapps/django/lib/python2.5/flup-1.0.1-py2.5.egg DEBUG:root:/home/tinodb/webapps/django/lib/python2.5 DEBUG:root:/home/tinodb/lib/python2.5/TurboGears-1.0.4.2-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/TurboKid-1.0.4-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/TurboJson-1.1.2-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/TurboCheetah-1.0-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/simplejson-1.7.3-py2.5-linux-i686.egg DEBUG:root:/home/tinodb/lib/python2.5/RuleDispatch-0.5a0.dev_r2306-py2.5-linux-i686.egg DEBUG:root:/home/tinodb/lib/python2.5/PasteScript-1.3.6-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/FormEncode-0.9-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/DecoratorTools-1.7-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/configobj-4.4.0-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/CherryPy-2.3.0-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/kid-0.9.6-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/Cheetah-2.0.1-py2.5-linux-i686.egg DEBUG:root:/home/tinodb/lib/python2.5/PyProtocols-1.0a0dev_r2302-py2.5-linux-i686.egg DEBUG:root:/home/tinodb/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/Paste-1.5.1-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/SQLObject-0.9.3-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/nose-0.9.3-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/SQLAlchemy-0.4.2p3-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/Elixir-0.5.2-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/PIL-1.1.6-py2.5-linux-i686.egg DEBUG:root:/home/tinodb/lib/python2.5/pysqlite-2.5.3-py2.4-linux-i686.egg DEBUG:root:/home/tinodb/lib/python2.5/Pygments-1.0-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/Reportlab-2.1-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/matplotlib-0.91.1-py2.5-linux-i686.egg DEBUG:root:/home/tinodb/lib/python2.5/rst2pdf-0.10.1.dev_r683-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/docutils-0.5-py2.5.egg DEBUG:root:/home/tinodb/lib/python2.5/mercurial-1.3.1-py2.5-linux-i686.egg DEBUG:root:/home/tinodb/lib/python2.5 DEBUG:root:/usr/local/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg DEBUG:root:/usr/local/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg DEBUG:root:/usr/local/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg DEBUG:root:/usr/local/lib/python25.zip DEBUG:root:/usr/local/lib/python2.5 DEBUG:root:/usr/local/lib/python2.5/plat-linux2 DEBUG:root:/usr/local/lib/python2.5/lib-tk DEBUG:root:/usr/local/lib/python2.5/lib-dynload DEBUG:root:/usr/local/lib/python2.5/site-packages DEBUG:root:/usr/local/lib/python2.5/site-packages/PIL ================================================= Also, docutils seems to be imported from the same path: DEBUG:root:<module 'docutils' from '/home/tinodb/lib/python2.5/docutils-0.5-py2.5.egg/docutils/__init__.pyc'> >>> import docutils >>> docutils <module 'docutils' from '/home/tinodb/lib/python2.5/docutils-0.5-py2.5.egg/docutils/__init__.pyc'> >>> What reason could there be that it is trying to import the stylesheets (and the template) from /lib/python2.5/docutils-0.5-py2.5.egg/docutils/writers/html4css1/html4css1.css? When I override the stylesheet path with /home/tinodb/lib/python2.5/docutils-0.5- py2.5.egg/docutils/writers/html4css1/html4css1.css' I get the following error: ReStructuredText contains errors:[Errno 2] No such file or directory: '../../../../lib/python2.5/docutils-0.5-py2.5.egg/docutils/writers/html4css1/template.txt' which means it is looking for /home/tinodb/lib/python2.5/docutils-0.5-py2.5.egg/docutils/writers/html4css1/template.txt (checking from the project dir), which exists... [tin...@web35 html4css1]$ pwd /home/tinodb/lib/python2.5/docutils-0.5-py2.5.egg/docutils/writers/html4css1 [tin...@web35 html4css1]$ ls -al total 168 drwxrwxr-x 2 tinodb tinodb 4096 Aug 28 14:57 . drwxrwxr-x 7 tinodb tinodb 4096 Aug 25 16:50 .. -rw-rw-r-- 1 tinodb tinodb 5431 Aug 25 16:50 html4css1.css -rwxr-xr-x 1 tinodb tinodb 58522 Aug 25 16:50 __init__.py -rw-rw-r-- 1 tinodb tinodb 77999 Aug 25 16:50 __init__.pyc -rw-rw-r-- 1 tinodb tinodb 114 Aug 25 16:50 template.txt What is going on? > > > > > On Sat, Sep 5, 2009 at 7:46 PM, TiNo <tin...@gmail.com> wrote: > >> On Thu, Sep 3, 2009 at 00:38, TiNo <tin...@gmail.com> wrote: >> >>> Hi, >>> I am trying to set up a sort of smal CMS where the input is >>> RestructuredText. The restructured text is parsed by a templatetag with the >>> following code (taken from the PyCon rst project): >>> >>> @register.filter >>> def restructuredparts(value, **overrides): >>> """return the restructured text parts""" >>> try: >>> from docutils.core import publish_parts >>> except ImportError: >>> if settings.DEBUG: >>> raise template.TemplateSyntaxError, "Error in {% >>> restructuredtext %} filter: The Python docutils library isn't installed." >>> return value >>> else: >>> docutils_settings = dict(getattr(settings, >>> "RESTRUCTUREDTEXT_FILTER_SETTINGS", {})) >>> docutils_settings.update(overrides) >>> if 'halt_level' not in docutils_settings: >>> docutils_settings['halt_level'] = 6 >>> return publish_parts(source=value, writer_name="html4css1", >>> settings_overrides=docutils_settings) >>> >>> >>> On my local machine everything works fine, but on my deployment server it >>> gives this error: >>> >>> [Errno 2] No such file or directory: >>> '/lib/python2.5/docutils-0.5-py2.5.egg/docutils/writers/html4css1/html4css1.css' >>> >>> This only happens when django is running. In django shell or python shell >>> everything works fine. The correct css file is located at >>> /home/tinodb/lib/python2.5/docutils-0.5-py2.5.egg/docutils >>> /writers/html4css1/html4css1.css >>> >>> There is a default docutils installed on the server (webfaction), but by >>> checking in the shell the correct docutils is imported. Shell and fastfcgi >>> deamons are run under the same user. >>> >>> Does anybody knows why my fastcgi deamon want to import a stylesheet from >>> this location? >>> >> >> Nobody any idea? >> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---