Permalink
Browse files

renamed package to 'djappsettings', for pypi.

  • Loading branch information...
1 parent 54935e8 commit cdd3c68dd9848e7956b99000d0abdcbfce934da3 @adammck committed Aug 5, 2010
Showing with 105 additions and 81 deletions.
  1. +7 −0 LICENSE
  2. +0 −69 README.md
  3. +86 −0 README.rst
  4. +0 −5 djangoappsettings/__init__.py
  5. +5 −0 lib/djappsettings/__init__.py
  6. +1 −1 {djangoappsettings → lib/djappsettings}/settings.py
  7. +6 −6 setup.py
View
7 LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2010 Adam Mckaig
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
69 README.md
@@ -1,69 +0,0 @@
-Django App Settings
-===================
-
-* I hate pasting blobs into my settings.py every time I enable an app.
-
-* This is a Python module which provides a sane way for reusable Django apps to configure themselves.
-
-* It's a drop-in replacement for the `django.conf.settings` class. You can fetch all of your project, app, and global default settings via a single `settings` object.
-
-* It doesn't touch your project's settings module, and existing Django apps are free to ignore it. Your app can even fall back to the usual method if this module isn't available.
-
-* App settings are prevented from clobbering [built-in settings](http://code.djangoproject.com/browser/django/trunk/django/conf/global_settings.py). They can only *add* settings.
-
-* Project settings (in DJANGO_SETTINGS_MODULE) override app settings.
-
-* Using per-app prefixes is a good idea, but not mandatory.
-
-
-But, but
---------
-
-* I'm aware of [Jared Forsyth](http://github.com/jabapyth)'s [django-appsettings](http://github.com/jabapyth/django-appsettings), and I think it's lovely but wrong. Project settings should not be editable in the Django admin.
-
-* I'm also aware that this feature has been rejected numerous times on the Django trac. But pasting a bunch of junk into my settings.py each time I add an app is a pain in the ass.
-
-* I saw [this snippet](http://www.djangosnippets.org/snippets/573/). It's insufficient.
-
-* Checking for a setting (via settings.hasattr), and falling back to a hard-coded default value is a terrible solution, because your defaults are duplicated and buried. They should be easily discoverable.
-
-
-Usage
------
-
-Where you would usually do something like:
-
- from django.conf import settings
- getattr(settings, "MY_SETTING", "DEFAULT")
-
-Create a `settings.py` file in your app, containing:
-
- MY_SETTING = "DEFAULT"
-
-and do something like:
-
- from djangoappsettings import settings
- settings.MY_SETTING
-
-If you'd like to support this module where available, but fall back to the usual method if not, just `try` it:
-
- try: from djangoappsettings import settings
- except: from django.conf import settings
- settings.MY_SETTING
-
-
-Installation
-------------
-
- $ git clone git://github.com/adammck/django-app-settings.git
- $ cd django-app-settings
- $ python setup.py install
-
-
-Bugs!
------
-
-This was created to scratch an itch for the [RapidSMS](http://rapidsms.org) project. I hope it will be useful to others, but it doesn't have any docs or tests yet, and hasn't been field tested. There are almost certainly bugs. Use it at your own risk. (But do use it, because it's *way* better.)
-
-Patches and pull requests are very welcome.
-Please file bugs on [GitHub](http://github.com/adammck/django-app-settings/issues).
View
86 README.rst
@@ -0,0 +1,86 @@
+DjAppSettings: Per-App Settings for Django
+==========================================
+
+* I hate pasting blobs into my settings.py every time I enable an app.
+
+* This is a Python module which provides a sane way for reusable Django apps to configure themselves.
+
+* It's a drop-in replacement for the ``django.conf.settings`` class. You can fetch all of your project, app, and global default settings via a single ``settings`` object.
+
+* It doesn't touch your project's settings module, and existing Django apps are free to ignore it. Your app can even fall back to the usual method if this module isn't available.
+
+* App settings are prevented from clobbering `built-in settings`_. They can only *add* settings.
+
+* Project settings (in ``DJANGO_SETTINGS_MODULE``) override app settings.
+
+* Using per-app prefixes is a good idea, but not mandatory.
+
+.. _built-in settings: http://code.djangoproject.com/browser/django/trunk/django/conf/global_settings.py
+
+
+But, but
+--------
+
+* I'm aware of `Jared Forsyth`_'s `django-appsettings`_, and I think it's lovely but wrong. Project settings should not be editable in the Django admin.
+
+* I'm also aware that this feature has been rejected numerous times on the Django trac. But pasting a bunch of junk into my ``settings.py`` each time I add an app is a pain in the ass.
+
+* Checking for a setting (via ``settings.hasattr``), and falling back to a hard-coded default value is a terrible solution, because your defaults are duplicated and buried. They should be easily discoverable.
+
+.. _Jared Forsyth: http://github.com/jabapyth
+.. _django-appsettings: http://github.com/jabapyth/django-appsettings
+
+
+Usage
+=====
+
+Where you would usually do something like::
+
+ from django.conf import settings
+ getattr(settings, "MY_SETTING", "DEFAULT")
+
+Create a ``settings.py`` file in your app, containing::
+
+ MY_SETTING = "DEFAULT"
+
+and do something like::
+
+ from djappsettings import settings
+ settings.MY_SETTING
+
+If you'd like to support this module where available, but fall back to the usual method if not, just ``try`` it::
+
+ try: from djappsettings import settings
+ except: from django.conf import settings
+ settings.MY_SETTING
+
+
+Installation
+============
+
+Via Pip::
+
+ $ pip install djappsettings
+
+Via GitHub::
+
+ $ git clone git://github.com/adammck/djappsettings.git
+ $ python djangoappsettings/setup.py install
+
+
+Bugs?
+=====
+
+This was created to scratch an itch for the `RapidSMS`_ project. I hope it will be useful to you, but it doesn't have any docs or tests yet, and hasn't been field tested. There are almost certainly bugs. Use it at your own risk. (But do use it, because it's *way* better.)
+
+Patches and pull requests are very welcome.
+Please file bugs on `GitHub`_.
+
+.. _RapidSMS: http://rapidsms.org
+.. _GitHub: http://github.com/adammck/djappsettings/issues
+
+
+License
+=======
+
+djappsettings is free software, available under the BSD license.
View
5 djangoappsettings/__init__.py
@@ -1,5 +0,0 @@
-#!/usr/bin/env python
-# vim: et ts=4 sw=4
-
-from .settings import DjangoAppSettings
-settings = DjangoAppSettings()
View
5 lib/djappsettings/__init__.py
@@ -0,0 +1,5 @@
+#!/usr/bin/env python
+# vim: et ts=4 sw=4
+
+from .settings import DjAppSettings
+settings = DjAppSettings()
View
2 djangoappsettings/settings.py → lib/djappsettings/settings.py
@@ -8,7 +8,7 @@
from django.utils import importlib
-class DjangoAppSettings(object):
+class DjAppSettings(object):
def __init__(self):
self._modules = None
View
12 setup.py
@@ -2,17 +2,17 @@
# vim: et ts=4 sw=4
-from distutils.core import setup
+from setuptools import setup
setup(
- name="django-app-settings",
+ name="djappsettings",
version="0.1.0",
- license="CC0",
+ license="BSD",
author="Adam Mckaig",
author_email="adam.mckaig@gmail.com",
- description="Allow Django apps to provide default settings",
- url="http://github.com/adammck/django-app-settings",
- packages=["djangoappsettings"])
+ description="Per-app default settings for Django",
+ url="http://github.com/adammck/djappsettings",
+ packages=["lib/djappsettings"])

0 comments on commit cdd3c68

Please sign in to comment.