forked from readthedocs/readthedocs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Settings and public domain restructure (readthedocs#1829)
This performs some needed changes for readthedocs.com as well as for making the .org have knowledge of a secondary hosting domain: Move settings to class based settings, it's far easier to manage with nested settings Try to serve all docs (private or public) from the PUBLIC_DOMAIN, if it is set. Remove old settings files that aren't used. Postgres settings were mostly our old production settings, that file shouldn't exist anymore. onebox.py was never used, and sqlite.py is basically just dev.py. For local postgres development, override DATABASES in local_settings.py, which should already be the case. Settings for additional URL confs were added for override
- Loading branch information
Showing
23 changed files
with
697 additions
and
761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Class based settings for complex settings inheritance""" | ||
|
||
import inspect | ||
import sys | ||
|
||
|
||
class Settings(object): | ||
|
||
"""Class-based settings wrapper""" | ||
|
||
@classmethod | ||
def load_settings(cls, module_name): | ||
"""Export class variables and properties to module namespace | ||
This will export and class variable that is all upper case and doesn't | ||
begin with ``_``. These members will be set as attributes on the module | ||
``module_name``. | ||
""" | ||
self = cls() | ||
module = sys.modules[module_name] | ||
for (member, value) in inspect.getmembers(self): | ||
if member.isupper() and not member.startswith('_'): | ||
if isinstance(value, property): | ||
value = value.fget(self) | ||
setattr(module, member, value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.