Opened 10 years ago
Last modified 10 years ago
#24815 closed New feature
Custom settings for database alias — at Initial Version
Reported by: | Miguel Angel Velazco | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It could be excelet to be able to set custom settings depending the database alias. An excelent example could be the management of the media files.
Maybe to do something like this:
settings.py
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'uno.sqlite3'), }, 'another': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'uno.sqlite3'), 'ADDITIONAL_SETTINGS': { 'MEDIA_ROOT': os.path.join(BASE_DIR, "custom_media"), } }, }
Note:
See TracTickets
for help on using tickets.