Description
Add <<<TableOfContents>>> on the Page will result in an ImportError cannot import name AS_IS
Steps to reproduce
Add <<TableOfContents>> on the Page
Example
URL: http://www.dresden-community.de/wiki/StartSeite
Component selection
- general
Details
Workaround
Discussion
Can't reproduce this on my wiki or on this wiki either.
see here:
Contents
OK, now i have change my config for testing:
# Version 1.5.8 <Location /wiki> SetHandler python-program PythonInterpreter wiki PythonPath "['/home/d/dresden-community.de/public_html/moin/moin', '/home/d/dresden-community.de/public_html/moin/moin/MoinMoin'] + sys.path" PythonHandler MoinMoin.request::RequestModPy.run </Location> # Version 1.7.0 <Location /wiki2> SetHandler python-program PythonInterpreter wiki2 PythonPath "['/home/d/dresden-community.de/moinmoin/moin', '/home/d/dresden-community.de/moinmoin/moin/MoinMoin'] + sys.path" PythonHandler MoinMoin.request.request_modpython::Request.run </Location>
1.5.8 |
works fine |
|
1.7.0 |
ERROR |
Is there an Problem with the PythonHandler command?
There was a 1.6 change that required a change to the PythonHandler statement: see this from docs/CHANGES:
* Moved / splitted request.py into MoinMoin/request/*. Most stuff will be broken, please help fixing it (usually some imports will be missing and the adaptor script will need a change maybe): Tested successfully: CGI, CLI, STANDALONE, FCGI, TWISTED
Also, HelpOnInstalling/ApacheWithModPython for 1.7.0 shows the PythonHandler statement just as you have coded yours above.
<Directory "/var/www/moin/testwiki"> # Modpy stuff AddHandler python-program .py # Add the path to the wiki directory, where # moinmodpy.py and wikiconfig.py are located. PythonPath "['/var/www/moin/mywiki'] + sys.path" PythonHandler MoinMoin.request.request_modpython::Request.run </Directory>
You may want to consider moving to mod_WSGI -- see HelpOnInstalling/ApacheWithModWSGI. It is pretty easy. I think there is another unresolved problem with mod_python when uploading files still open.
THX RogerHaase for your correctly solution! Thanks to all other Supporters helped me.
Plan
- Priority:
- Assigned to:
- Status: no bug, wrong sys.path (your sys.path contains the !MoinMoin/ dir (wrong), correct is to have the directory that contains the !MoinMoin/ dir in sys.path).