Commit graph

151 commits

Author SHA1 Message Date
Nicolas Delaby
063bf61a16 Drop support of python 2.6, 3.2 and Django < 1.8 2016-01-27 21:08:54 +01:00
Nicolas Delaby
4615e1e8fb Bump version to 1.0.1.dev
The version pattern follows the recommendation described in PEP 440.
https://www.python.org/dev/peps/pep-0440/#development-release-separators

Closes https://github.com/jazzband/django-configurations/pull/139.
2016-01-07 12:28:05 +01:00
Nicolas Delaby
261817d965 Prepare next release 1.0 2016-01-04 14:24:50 +01:00
John R Dietrick
cd0f1b4d0c Fix handling of fallback to optparse.OptionParser
By the time the code here runs, it's too late to be modifying
base.BaseCommand.option_list; in fact doing so causes an OptionConflictError if
you later call another management command "recursively" while you're running
the first one.

We want to leave BaseCommand's option_list untouched (it's `()` by default in
Django 1.8+) in case the command we are wrapping has already upgraded to
argparse. BUT, if it hasn't, we'll get an OptionParser back, and can tack our
argument on at the last minute.
2015-12-19 18:25:53 +08:00
Jannis Leidel
010067b433 Introduced environ_required parameter for Value class. Refs #118. 2015-08-09 14:54:55 +02:00
Jannis Leidel
8ba1804ff2 Added full_environ_name method to Value class. 2015-08-09 14:48:16 +02:00
Jannis Leidel
5ece107044 Only run __init__ in __new__ when late binding is enabled.
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2015-03-16 21:19:40 +01:00
Miguel Araujo Perez
e09e1e0f42 Added equal operator to values.Value
Allows value setting to work when checking if setting variable is within
a list, i.e: settings.database in ['default', 'other']

Signed-off-by: Jannis Leidel <jannis@leidel.info>
2015-03-16 20:54:17 +01:00
Jannis Leidel
c60b7daac4 Fixed SequenceValue to work on Python 3.x. 2015-02-13 22:29:14 +01:00
Jannis Leidel
4d35ad346c Call django.setup() for Sphinx, too.
This also adds a configurations.setup() analogue to django.setup().
2015-02-13 22:18:33 +01:00
Jannis Leidel
b91ebf083f Merge pull request #91 from benjaminabel/notebook-support-for-django17
Add `django.setup()` in `load_ipython_extension` function for django>=1....
2015-02-13 22:08:56 +01:00
Jannis Leidel
8f617ad98c Merge pull request #85 from abbottc/master
Add values.TupleOfTuplesValue (plus associated tests and docs)
2015-02-13 22:08:08 +01:00
Jannis Leidel
6ce3740365 Cover the case in which BaseCommand.create_parser retursn optparse.OptionParser. 2015-02-13 21:52:47 +01:00
Jannis Leidel
f35e7e57e0 Add global --configuration option in Django >= 1.8. 2015-02-13 21:47:08 +01:00
Jannis Leidel
8be47c0813 Merge remote-tracking branch 'benjaminabel/master' 2015-02-13 18:12:56 +01:00
Jannis Leidel
21d1712143 Use importlib.import_module if needed. 2015-02-13 16:24:02 +01:00
Jannis Leidel
e0e12b1b9f Fixed minor flake8 error. 2015-02-13 16:21:17 +01:00
Benjamin ABEL
546f488197 Add django.setup() in load_ipython_extension function for django>=1.7 compatibility 2015-02-01 16:47:37 +01:00
Benjamin ABEL
ae767eaf2d Cleaned importer to be more DRY 2015-01-27 22:36:59 +01:00
Benjamin ABEL
d9b2815526 Use CommandParser instead of LaxOptionParser in django1.8
Added a django version check, and removed the `LaxOptionParser` import for django>=1.8 and used `CommandParser` instead as in Claude Paroz django [commit](8568638603 (diff-860fce37924469764af399caaa365e00R275))

Reference: [#19973 (Management commands migration to argparse) –
Django](https://code.djangoproject.com/ticket/19973)
2015-01-25 18:13:47 +01:00
Christian Abbott
8287ab6f7f Merge remote-tracking branch 'upstream/master' 2015-01-07 03:19:24 -08:00
Christian Abbott
e0a68fdbb6 Rename TupleOfTupleValue to SingleNestedTupleValue; Add SingleNestedListValue and do a DRY refactor of ListValue, TupleValue, and their SingleNested subclasses 2015-01-07 03:08:30 -08:00
Jannis Leidel
f2a46fb009 Merge remote-tracking branch 'nagyv/patch-1'
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2015-01-07 00:05:27 +01:00
Jannis Leidel
44476bdd1d Merge remote-tracking branch 'hiisi13/master'
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2015-01-06 23:15:08 +01:00
Jannis Leidel
01e3f5837f Merge remote-tracking branch 'joke2k/dot-env'
Signed-off-by: Jannis Leidel <jannis@leidel.info>

Conflicts:
	.gitignore
2015-01-06 22:34:29 +01:00
Jannis Leidel
ebc0c51dd8 Merge branch 'master' of github.com:jezdez/django-configurations 2015-01-06 21:38:20 +01:00
Jannis Leidel
98de57b27e Added configurations.management.call_command. Fix #72. 2015-01-06 21:38:08 +01:00
Jannis Leidel
cb9f7c36fb Merge pull request #83 from mauricioabreu/master
Fixed wrong behaviour when assigning BooleanValue
2015-01-06 21:23:37 +01:00
Jannis Leidel
41dfcee46c Backported LaxOptionParser from Django 1.7 to make it work on 1.8. 2015-01-06 21:16:14 +01:00
Mauricio de Abreu Antunes
3f892f9814 Fixed wrong behaviour when assigning BooleanValue
When assigning False to a BooleanValue and reusing it was raising a
ValueError exception because BooleanValue was evaluating False as None.

Thanks to @abbottc for catching this error.
2014-12-27 10:34:40 -02:00
Christian Abbott
c4ba5ca559 Add TupleOfTuplesValue along with associated tests and updated documentation 2014-12-18 07:15:20 -08:00
Jannis Leidel
fb9275744e Merge pull request #78 from slafs/validationmixinfix
fix ValidationMixin instantiation with no default
2014-12-12 16:28:58 +01:00
Sławek Ehlert
8d366fca44 fix ValidationMixin instantiation with no default
with tests. fixes #69
2014-10-30 23:44:48 +01:00
He Weiwei
f8ebb564da fix bug of setup_value func for EmailURLValue 2014-10-08 12:19:35 +08:00
Sven Aßmann
4018f7b42a - add late_binding to value with default False
- this enables a value to load from environment if the env variable name is given at construction time
- cache value of environment value now in property value
- add __new__ to allow a construction of a given type from environment directly. In this case now Value instance is constructed but an instance of the desired type that is covered by the Value implementation. For Value it is str, for DictValue it is dict etc.
- extend tests for this new behavior
- extend test coverage for some other places
2014-05-02 22:51:48 +02:00
joke2k
27eb748d68 refactoring of DotConfiguration 2014-04-17 18:07:33 +02:00
joke2k
5279ae4ace add support to load .env file into os.environ 2014-04-17 16:23:36 +02:00
Dmitry Kozhedubov
e33eeeb871 Ability to pass keyword args to CastingMixin casters 2014-03-02 13:31:42 +04:00
Jannis Leidel
713dce0048 Bump version. 2014-01-16 19:01:35 +01:00
Jannis Leidel
f087cea84d Added SearchURLValue. 2014-01-16 19:00:29 +01:00
Jannis Leidel
11b1dc2a46 Updated version. 2013-11-26 16:29:00 +01:00
Jannis Leidel
ab0c748318 Fixed #43 — Removed stdout wrapper from management command hook to not accidently raise an exception too early. Instead use a logger. 2013-11-26 12:25:50 +01:00
Jannis Leidel
ed8d284d66 Merge branch 'master' of github.com:jezdez/django-configurations 2013-10-08 09:32:43 +02:00
Stefan Wehrmeyer
275a5b409a Fix check_options of ConfigurationImporter 2013-10-08 09:32:05 +02:00
Stefan Wehrmeyer
5e8dc290df Fix CacheURLValue default value
Remove unused kwarg 'name' that shadows kwarg
'default'.
2013-10-06 16:33:24 +02:00
Jannis Leidel
df71a193a3 Bumped version up a notch. 2013-09-19 18:56:23 +02:00
Jannis Leidel
52cc7ee4bd Bumped version up to 0.6a1. 2013-09-18 23:25:19 +02:00
Jannis Leidel
50a6a6ad0b Added iPython extension to make sure the import hook is loaded correctly.
Fixes #22.
2013-09-18 23:24:51 +02:00
Jannis Leidel
ff2b636081 Updated changelog and bumped version up a notch. 2013-09-12 19:22:25 +02:00
Jannis Leidel
2fd4966549 Add check_options option to the install method of the ConfigurationImporter to prevent unwanted command line option checks outside the management commands. 2013-09-12 18:51:59 +02:00
Jannis Leidel
5898acb594 Moved tests out of the configurations packages. 2013-09-09 11:02:43 +02:00
Jannis Leidel
46809d02b2 Worked around an issue with Django 1.6's six. 2013-09-06 23:39:53 +02:00
Jannis Leidel
e453d2355d Fix a Python2ism 2013-09-06 23:28:50 +02:00
Jannis Leidel
3848e6b818 Drastically simplified exception messages in the importer.
Less eyebleed® included!
2013-09-06 22:41:14 +02:00
Jannis Leidel
dacca7e073 Use ValueError instead of Django's ImproperlyConfigured.
This is to prevent hiding the real reason of a configuration failure behind one of Django's import time exceptions.
2013-09-06 22:40:15 +02:00
Jannis Leidel
1da2414ee1 Minor style changes and bumping version. 2013-09-03 13:10:25 +02:00
Jannis Leidel
927c052be5 Changed the default of the Value's environ option to True. 2013-09-03 12:03:34 +02:00
Jannis Leidel
61bb7b0e44 Fixed string formatting. Part 2. 2013-07-27 16:07:43 +02:00
Jannis Leidel
90292e3cec Fixed string formatting. 2013-07-27 16:05:23 +02:00
Jannis Leidel
b8222d2271 Raise an ImproperlyConfigured exception if value handling doesn't work, thanks @pydanny for the suggestion. 2013-07-27 15:38:30 +02:00
Jannis Leidel
2cc38d9ff7 Don't use django-discover-runner on 1.6 and up. 2013-07-27 13:46:18 +02:00
Jannis Leidel
ef26377f13 Force list return value for filtered result. 2013-07-27 13:20:42 +02:00
Jannis Leidel
0882b97972 Fixed test method names. 2013-07-27 13:18:20 +02:00
Jannis Leidel
2c39f5f29b Also don't raise an exception during import for the Settings class since that's now deprecated. 2013-07-27 13:05:11 +02:00
Jannis Leidel
1a54847375 Added a configuration values system.
This also adds some advanced features like a setup classmethod to the Configuration class.
Reorganized and extended the documentation.
2013-07-27 12:37:28 +02:00
Jannis Leidel
e31adbaeed Renamed Settings class to Configuration to better match what it means. Settings is still importable and is marked to be deprecated in 1.0. 2013-07-27 12:05:39 +02:00
Jannis Leidel
822397799b Fix the test suite for the post_load method. 2013-05-15 13:15:47 +02:00
Jannis Leidel
0b9e5ed1cf Bumped version up a notch. 2013-05-15 12:50:49 +02:00
Jannis Leidel
bebe4f254b Extended the setup methods in pre and post phase. Fixes #27. 2013-05-15 11:32:57 +02:00
Jannis Leidel
d4da16273a Merge branch 'master' of github.com:jezdez/django-configurations
Conflicts:
	configurations/decorators.py
2013-05-15 11:06:51 +02:00
Jannis Leidel
708fb9ac50 Renamed the pristine decorator to pristinemethod for consistency. 2013-05-15 10:59:02 +02:00
Jannis Leidel
df865840bc Added a setup method hook for easier startup time code. 2013-05-15 10:57:30 +02:00
Jannis Leidel
efd0206da1 Fixed a typo. Thanks @peritus. 2013-05-13 10:18:38 +02:00
Jannis Leidel
6596e191f0 Added pristine decorator to handle callable settings. Fixes #28. 2013-04-30 17:11:29 +02:00
Jannis Leidel
e15070288c Renamed assertEquals to assertEqual. 2013-04-30 17:09:01 +02:00
Jannis Leidel
35271f7200 Added a lambda setting, just to be sure. Refs #28. 2013-04-26 09:02:26 +02:00
Jannis Leidel
f51049dc00 Renamed a few test settings to better describe what they are. 2013-04-26 09:01:59 +02:00
Jannis Leidel
5700d96d14 Updated changes and bumped version up a notch. 2013-04-11 17:14:58 +02:00
Jannis Leidel
bbd5f2dce3 Use Django's lax option parser when looking for the configuration option to prevent overlapping with Django's own option parsing.
Fixes #21, #22, #24. Thanks to @rolo for helping our in #24.
2013-04-11 16:08:47 +02:00
Jannis Leidel
f7c1206a1e D'oh, there never was a 0.2 on PyPI. Bumped version down again. 2013-03-27 16:59:50 +01:00
Jannis Leidel
87f2b4723d Add a fastcgi helper. Fixes #19. 2013-03-27 16:57:05 +01:00
Jannis Leidel
90beffa13b Bumped version up a notch. 2013-03-27 15:30:32 +01:00
Jannis Leidel
b7d6faa46d Fixed exception syntax of a parallel branch. 2013-03-27 12:04:34 +01:00
Jannis Leidel
f7696e5810 Merge pull request #18 from mvantellingen/python3
Python3
2013-03-27 03:58:03 -07:00
Jannis Leidel
560a8b2b84 Merge pull request #16 from bclermont/fix-import
catch error raised inside settings code
2013-03-27 03:57:05 -07:00
Jannis Leidel
5b90971f6d Merge pull request #17 from mfogel/explicit-mixin-test
Test using mixins with settings
2013-03-27 03:56:38 -07:00
Jannis Leidel
7db5db8bff Handle the --configuration option for management commands during installation of the import hook. 2013-03-27 11:55:43 +01:00
Michael van Tellingen
d654e56040 Set SECRET_KEY in settings.main 2013-01-30 21:48:15 +01:00
Michael van Tellingen
2877b66982 Initial fixes for python 3 support 2013-01-30 21:45:36 +01:00
Mike Fogel
0f83894494 Test using mixins with settings 2012-11-26 13:39:57 -08:00
Bruno Clermont
41b8f3655c fix indentation 2012-11-26 23:11:26 +08:00
Bruno Clermont
53bf1b5548 oups bad copy-paste 2012-11-26 16:29:59 +08:00
Bruno Clermont
1b052a3a0e catch error raised inside the settings code 2012-11-26 16:25:00 +08:00
Jannis Leidel
c5c0feff9f Bumped version. 2012-09-21 20:58:03 +02:00
Jannis Leidel
08d36754f6 Merge branch 'master' of github.com:jezdez/django-configurations 2012-09-21 16:34:35 +02:00
Jannis Leidel
26bc0d692f Added a global --configuration option to management commands and show configuration class path when using runserver. Fixes #9. 2012-09-21 16:34:16 +02:00
Bruno Clermont
fb90a168aa use absolute import
fix test
2012-09-05 15:52:49 +02:00
Bruno Clermont
8b78278921 Don't catch AttributeError during cls init
if obj = cls() do have an attribute error inside it's initialization, it will appears as if the module could not be find.

which is hard to troubleshoot, when the module is really there :)
2012-09-05 14:29:05 +03:00
Jannis Leidel
543151d511 Re-added 1.3 tests. Refs #4. 2012-07-28 00:05:49 +02:00
Jannis Leidel
5b40d68675 Bumped version to 0.1. 2012-07-21 16:12:26 +02:00