The main purpose of this package is to provide support for enabling Grok applications to be run as aster served WSGI applications without using the zodb.
Using megrok.nozodb
To setup a grok environment which works without the zodb you have to replace the paster-application-factory which typically is located in the debug.ini and in the deploy.ini: To be concrete replace grokcore.startup#… with megrok.nozodb#nozodb
[app:grok] use = egg:megrok.nozodb#nozodb
The next you have to do is setting up global utility which acts as an ApplicationRoot which is a starting point for your application. megrok.nozodb has an ungrokked default one. You can subclass from it or provide your own stuff which acts as ApplicationRoot.:
>>> from megrok.nozodb import ApplicationRoot >>> class MyApplicationRoot(ApplicationRoot): ... pass >>> myapp = MyApplicationRoot() >>> from zope.site.interfaces import IRootFolder >>> IRootFolder.providedBy(myapp) True >>> from grok.interfaces import IApplication >>> IApplication.providedBy(myapp) True >>> from zope.location import ILocation >>> ILocation.providedBy(myapp) True >>> from zope.interface.verify import verifyObject >>> from zope.component.interfaces import ISite >>> verifyObject(ISite, myapp) True
API Documentation
We have to create a simple site definition file, which is also quite plain:
>>> import os, tempfile
>>> temp_dir = tempfile.mkdtemp()
>>> sitezcml = os.path.join(temp_dir, 'site.zcml')
>>> open(sitezcml, 'w').write('<configure />')
>>> zope_conf = os.path.join(temp_dir, 'zope.conf')
>>> open(zope_conf, 'wb').write('''
... site-definition %s
...
... <zodb>
... </zodb>
...
... <eventlog>
... <logfile>
... path STDOUT
... </logfile>
... </eventlog>
... ''' %sitezcml)
>>> from megrok.nozodb import nozodb_factory
>>> app_factory = nozodb_factory({'zope_conf': zope_conf})
Clean up the temp_dir
>>> import shutil
>>> shutil.rmtree(temp_dir)
Changelog
0.1 (2010-11-04)
Initial release
Metadata
Release files for megrok.nozodb 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| megrok.nozodb-0.1.tar.gz | 8.7 kB | Without provenance | Details for megrok.nozodb-0.1.tar.gz |
Release files / megrok.nozodb-0.1.tar.gz
| Download URL | megrok.nozodb-0.1.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e81f69cf4b1ba17f34ddbcf772cb72ad7267adbc2d41c06115b069014894ab1
|
|
BLAKE2b-256 checksum How to use checksums |
860588d5e4eb037c6574ae556dd05e7fced7656e95ea668b0a3ff07da73c7da2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for megrok.nozodb 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.