couchdbkit icon indicating copy to clipboard operation
couchdbkit copied to clipboard

Couchdbkit Django settings are not flexible

Open sirex opened this issue 14 years ago • 1 comments

In my project I have one Couchdb database that is used by all my Django applications. Using couchdbkit.ext.django settings, I have repeat database across all my applications:

COUCHDB_DATABASES = (
    ('myproject.myapp1', 'MYCOUCHDB'),
    ('myproject.myapp2', 'MYCOUCHDB'),
    ('myproject.myapp3', 'MYCOUCHDB'),
    ('myproject.myapp4', 'MYCOUCHDB'),
    ('myproject.myapp5', 'MYCOUCHDB'),
)

To avoid this I decided to add my project to INSTALLED_APPS and define database schema in one place. Now settings looks better:

COUCHDB_DATABASES = (
    ('myproject', 'MYCOUCHDB'),
)

But then I faced another issue - views. Now all my views are stored in single design document and there is no way to change that. To avoid this, I can only create new Django application, just to have my views stored in separate design document.

My suggestion would to follow Django and define settings using this layout:

COUCHDB_DATABASES = (
    'default': {
        'URL': 'MYCOUCHDB',
        'DISIGN_LOADERS': (
            'couchdbkit.ext.django.app_directories.Loader',
        )
        'DESIGN_DIRS': (
            'custom/location/for/design/documents',
        )
)

sirex avatar Sep 08 '11 15:09 sirex

that should be possible with change in b7ef018ae9c29dc7223a4752297a5814a76cc76b . Can you eventually raise it on the mailing list?

benoitc avatar Sep 19 '11 16:09 benoitc