benoitc / benoitc/couchdbkit

Couchdbkit Django settings are not flexible

Open
#101 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
263
Forks
90
PR merge metrics
No merged PRs in 30d

Description

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',
)
)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.