Re: [Zope3-Users] Re: Remaking an 'instance' site with zopeproject

2007-10-08 Thread Philipp von Weitershausen

On 9 Oct 2007, at 00:19 , Yuan HOng wrote:
On 10/4/07, Philipp von Weitershausen <[EMAIL PROTECTED]>  
wrote:



__
ANOTHER PROBLEM:
I don't get the access logs constantly running in Terminal that I  
was

used to.
How do I start these up?


Ah, thanks for bringing this up. You can use a logging middleware,  
such
as Paste#translogger. Simply edit 'deploy.ini' and change it to  
read::



[filter-app:main]
use = egg:Paste#translogger
next = zope

[app:zope]
use = egg:HelloWorld

[server:main]
use = egg:Paste#http
host = 127.0.0.1
port = 8080



Can I get logging in debug mode?


debug.ini has nothing to do with a "debug mode". debug.ini starts the  
application up in the exact same way that deploy.ini does, it just  
configures a debugging middleware. Zope 3 doesn't really have a debug  
mode. It has a developer mode which, when enabled, will load things  
like APIDoc.


In debug.ini, there is already a [filter-app:main] specification.  
What shall I put in this section to enable both debugging and logging?


You can chain WSGI middlewares, e.g.:

[filter-app:main]
use = egg:Paste#translogger
next = debug

[filter-app:debug]
use = egg:z3c.evalexception#ajax
next = zope

[app:zope]
use = egg:HelloWorld

[server:main]
use = egg:Paste#http
host = 127.0.0.1
port = 8080


For further information, please refer to the PasteDeploy  
documentation: http://pythonpaste.org/deploy/




___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Remaking an 'instance' site with zopeproject

2007-10-08 Thread Yuan HOng
On 10/4/07, Philipp von Weitershausen <[EMAIL PROTECTED]> wrote:
>
> > __
> > ANOTHER PROBLEM:
> > I don't get the access logs constantly running in Terminal that I was
> > used to.
> > How do I start these up?
>
> Ah, thanks for bringing this up. You can use a logging middleware, such
> as Paste#translogger. Simply edit 'deploy.ini' and change it to read::
>
>
> [filter-app:main]
> use = egg:Paste#translogger
> next = zope
>
> [app:zope]
> use = egg:HelloWorld
>
> [server:main]
> use = egg:Paste#http
> host = 127.0.0.1
> port = 8080
>

Can I get logging in debug mode? In debug.ini, there is already a
[filter-app:main] specification. What shall I put in this section to
enable both debugging and logging?

-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Remaking an 'instance' site with zopeproject

2007-10-04 Thread Philipp von Weitershausen

George Wright wrote:

EXCEPT however the ~/Books/src/books/configure.zcml has to be different.
The contents of my original
~/zope3demo/lib/python/books/configure.zcml
had to be appended to the bottom of the automatically generated
~/Books/src/books/configure.zcml


Yep. The idea is with eggs is that each package should load the 
configuration of all its dependencies first before making any registrations.



AND another EXCEPT:
There is no equivalent file path to 'books-configure.zcml':
 ~/zope3demo/etc/package-includes/books-configure.zcml
where one had an entry like this;


Presumably this is now taken care of in the site.zcml which is 
automatically generated and includes the same line?


Exactly. Those ZCML "slugs" in etc/package-includes where a horrible 
mess and confused most newbies. They were problem maker #1 in all 
trainings (people simply forgot them).


site.zcml (still) is the root ZCML file (zope.conf refers to it, in 
fact, that's why). It includes all other ZCML files. Typically it only 
has to include the application package ("books" in your case) now 
because that application is in charge of loading all the dependencies 
(which happen to bring up most of Zope).



_
I fired it up like this:
$ cd ~/Books
$ bin/paster serve deploy.ini
Starting server in PID 198.
--
2007-10-02T13:15:34 INFO paste.httpserver.ThreadPool Cannot use 
kill_thread_limit as ctypes/killthread is not available

serving on http://127.0.0.1:8080
...
and all goes well from there! I can add and edit reviews as before.


Great to hear that.




ONE PROBLEM:
I wasn't able to access ++apidoc++
In ~/Books/zope.conf I uncommented the 'devmode on' line
and restarted, logging in as manager. I do get the developer mode 
warning, but the 'Introspector' tab didn't appear in ZMI and nor does 
the ++apidoc++ address work.

I tried adding the lines:
xmlns:apidoc="http://namespaces.zope.org/apidoc";


to appropriate spots in the site.zcml file


You were on the right track. Unfortunately, that's not enough. 
zope.app.apidoc doesn't make sure its dependnecies are loaded. (We're 
not completely there yet with the eggification in that regard).


zopeproject 0.4.1 actually enables APIDoc by default. You might want to 
look at the apidoc.zcml it generates in the top level sandbox directory. 
TO get the new zopeproject version, use


   easy_install -U zopeproject



BUT I was plagued with configuration errors like this:

File 
"/Users/georgewright/buildout-eggs/tmpWlIac6/zope.component-3.4.0a1-py2.4.egg/zope/component/_api.py", 
line 207, in getUtility
ComponentLookupError: (zope.app.applicationcontrol.interfaces.IServerControl>, '')


That's weird. This shouldn't be APIDoc related. This error actually 
occurs when you try to go to the "Server Control" screen of ++etc++process.


Zope isn't in charge of the process anymore. bin/paster is. We should 
really just get rid of that screen, or at least make it handle this case 
gracefully.




__
ANOTHER PROBLEM:
I don't get the access logs constantly running in Terminal that I was 
used to.

How do I start these up?


Ah, thanks for bringing this up. You can use a logging middleware, such 
as Paste#translogger. Simply edit 'deploy.ini' and change it to read::



[filter-app:main]
use = egg:Paste#translogger
next = zope

[app:zope]
use = egg:HelloWorld

[server:main]
use = egg:Paste#http
host = 127.0.0.1
port = 8080



--
http://worldcookery.com -- Professional Zope documentation and training

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users