Merged in personal/henrik/django-1.7@9020 which upgrades Django from 1.6.0 to 1.7.4 and applies the needed changes to the datatracker code to work with release 1.7.x.
- Legacy-Id: 9028
This commit is contained in:
parent
028b7e315a
commit
7ecfac6308
|
@ -5,7 +5,8 @@
|
|||
# Requires modelviz.py from
|
||||
# http://code.djangoproject.com/wiki/DjangoGraphviz
|
||||
#
|
||||
PYTHONPATH=`dirname $PWD`
|
||||
cd ${0%/*}/../ietf
|
||||
PYTHONPATH=`dirname $PWD`:`dirname $PWD/..`
|
||||
export PYTHONPATH
|
||||
module=${PWD##*/}
|
||||
DJANGO_SETTINGS_MODULE=$module.settings
|
||||
|
@ -18,4 +19,4 @@ do
|
|||
fi
|
||||
done
|
||||
modelviz.py $* $models > models.dot
|
||||
dot -Tpng models.dot
|
||||
dot -Tpng models.dot > models.png
|
||||
|
|
|
@ -25,6 +25,7 @@ settings_module = args.settings or "ietf.settings"
|
|||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
|
||||
|
||||
import django
|
||||
import django.test
|
||||
|
||||
# prevent memory from leaking when settings.DEBUG=True
|
||||
|
@ -77,6 +78,7 @@ def extract_html_urls(content):
|
|||
|
||||
yield url
|
||||
|
||||
django.setup()
|
||||
client = django.test.Client()
|
||||
|
||||
for url in initial_urls:
|
||||
|
|
19
changelog
19
changelog
|
@ -1,3 +1,22 @@
|
|||
ietfdb (5.11.0) ietf; urgency=medium
|
||||
|
||||
This relese upgrades Django from 1.6.4 to 1.7.1, and tastypie from 0.11.1 to
|
||||
0.12.1. It changes the database migrations infrastructure from that provided
|
||||
by "south", to the builtin replacement newly introduced with Django 1.7.
|
||||
|
||||
There are also a set of changes required by the upgrade, and some fixes
|
||||
to bugs revealed by the improved infrastructure provided by Django 1.7.
|
||||
|
||||
Deployment note: When deploying this, migrations need some extra care.
|
||||
You should run the following:
|
||||
$ ietf/manage.py migrate --fake doc
|
||||
$ ietf/manage.py migrate --fake community
|
||||
$ ietf/manage.py migrate --fake dbtemplate
|
||||
$ ietf/manage.py migrate
|
||||
|
||||
-- Henrik Levkowetz <henrik@levkowetz.com> 08 Feb 2015 21:02:38 +0000
|
||||
|
||||
|
||||
ietfdb (5.10.3) ietf; urgency=medium
|
||||
|
||||
This is a minor bugfix release in preparation for the upcoming upgrade from
|
||||
|
|
|
@ -1,7 +1,21 @@
|
|||
VERSION = (1, 6, 0, 'final', 0)
|
||||
VERSION = (1, 7, 4, 'final', 0)
|
||||
|
||||
|
||||
def get_version(*args, **kwargs):
|
||||
# Don't litter django/__init__.py with all the get_version stuff.
|
||||
# Only import if it's actually called.
|
||||
from django.utils.version import get_version
|
||||
return get_version(*args, **kwargs)
|
||||
|
||||
|
||||
def setup():
|
||||
"""
|
||||
Configure the settings (this happens as a side effect of accessing the
|
||||
first setting), configure logging and populate the app registry.
|
||||
"""
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.utils.log import configure_logging
|
||||
|
||||
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
|
||||
apps.populate(settings.INSTALLED_APPS)
|
||||
|
|
2
django/apps/__init__.py
Normal file
2
django/apps/__init__.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
from .config import AppConfig # NOQA
|
||||
from .registry import apps # NOQA
|
207
django/apps/config.py
Normal file
207
django/apps/config.py
Normal file
|
@ -0,0 +1,207 @@
|
|||
from importlib import import_module
|
||||
import os
|
||||
|
||||
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
|
||||
from django.utils.module_loading import module_has_submodule
|
||||
from django.utils._os import upath
|
||||
|
||||
|
||||
MODELS_MODULE_NAME = 'models'
|
||||
|
||||
|
||||
class AppConfig(object):
|
||||
"""
|
||||
Class representing a Django application and its configuration.
|
||||
"""
|
||||
|
||||
def __init__(self, app_name, app_module):
|
||||
# Full Python path to the application eg. 'django.contrib.admin'.
|
||||
self.name = app_name
|
||||
|
||||
# Root module for the application eg. <module 'django.contrib.admin'
|
||||
# from 'django/contrib/admin/__init__.pyc'>.
|
||||
self.module = app_module
|
||||
|
||||
# The following attributes could be defined at the class level in a
|
||||
# subclass, hence the test-and-set pattern.
|
||||
|
||||
# Last component of the Python path to the application eg. 'admin'.
|
||||
# This value must be unique across a Django project.
|
||||
if not hasattr(self, 'label'):
|
||||
self.label = app_name.rpartition(".")[2]
|
||||
|
||||
# Human-readable name for the application eg. "Admin".
|
||||
if not hasattr(self, 'verbose_name'):
|
||||
self.verbose_name = self.label.title()
|
||||
|
||||
# Filesystem path to the application directory eg.
|
||||
# u'/usr/lib/python2.7/dist-packages/django/contrib/admin'. Unicode on
|
||||
# Python 2 and a str on Python 3.
|
||||
if not hasattr(self, 'path'):
|
||||
self.path = self._path_from_module(app_module)
|
||||
|
||||
# Module containing models eg. <module 'django.contrib.admin.models'
|
||||
# from 'django/contrib/admin/models.pyc'>. Set by import_models().
|
||||
# None if the application doesn't have a models module.
|
||||
self.models_module = None
|
||||
|
||||
# Mapping of lower case model names to model classes. Initially set to
|
||||
# None to prevent accidental access before import_models() runs.
|
||||
self.models = None
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s: %s>' % (self.__class__.__name__, self.label)
|
||||
|
||||
def _path_from_module(self, module):
|
||||
"""Attempt to determine app's filesystem path from its module."""
|
||||
# See #21874 for extended discussion of the behavior of this method in
|
||||
# various cases.
|
||||
# Convert paths to list because Python 3.3 _NamespacePath does not
|
||||
# support indexing.
|
||||
paths = list(getattr(module, '__path__', []))
|
||||
if len(paths) != 1:
|
||||
filename = getattr(module, '__file__', None)
|
||||
if filename is not None:
|
||||
paths = [os.path.dirname(filename)]
|
||||
if len(paths) > 1:
|
||||
raise ImproperlyConfigured(
|
||||
"The app module %r has multiple filesystem locations (%r); "
|
||||
"you must configure this app with an AppConfig subclass "
|
||||
"with a 'path' class attribute." % (module, paths))
|
||||
elif not paths:
|
||||
raise ImproperlyConfigured(
|
||||
"The app module %r has no filesystem location, "
|
||||
"you must configure this app with an AppConfig subclass "
|
||||
"with a 'path' class attribute." % (module,))
|
||||
return upath(paths[0])
|
||||
|
||||
@classmethod
|
||||
def create(cls, entry):
|
||||
"""
|
||||
Factory that creates an app config from an entry in INSTALLED_APPS.
|
||||
"""
|
||||
try:
|
||||
# If import_module succeeds, entry is a path to an app module,
|
||||
# which may specify an app config class with default_app_config.
|
||||
# Otherwise, entry is a path to an app config class or an error.
|
||||
module = import_module(entry)
|
||||
|
||||
except ImportError:
|
||||
# Track that importing as an app module failed. If importing as an
|
||||
# app config class fails too, we'll trigger the ImportError again.
|
||||
module = None
|
||||
|
||||
mod_path, _, cls_name = entry.rpartition('.')
|
||||
|
||||
# Raise the original exception when entry cannot be a path to an
|
||||
# app config class.
|
||||
if not mod_path:
|
||||
raise
|
||||
|
||||
else:
|
||||
try:
|
||||
# If this works, the app module specifies an app config class.
|
||||
entry = module.default_app_config
|
||||
except AttributeError:
|
||||
# Otherwise, it simply uses the default app config class.
|
||||
return cls(entry, module)
|
||||
else:
|
||||
mod_path, _, cls_name = entry.rpartition('.')
|
||||
|
||||
# If we're reaching this point, we must attempt to load the app config
|
||||
# class located at <mod_path>.<cls_name>
|
||||
|
||||
# Avoid django.utils.module_loading.import_by_path because it
|
||||
# masks errors -- it reraises ImportError as ImproperlyConfigured.
|
||||
mod = import_module(mod_path)
|
||||
try:
|
||||
cls = getattr(mod, cls_name)
|
||||
except AttributeError:
|
||||
if module is None:
|
||||
# If importing as an app module failed, that error probably
|
||||
# contains the most informative traceback. Trigger it again.
|
||||
import_module(entry)
|
||||
else:
|
||||
raise
|
||||
|
||||
# Check for obvious errors. (This check prevents duck typing, but
|
||||
# it could be removed if it became a problem in practice.)
|
||||
if not issubclass(cls, AppConfig):
|
||||
raise ImproperlyConfigured(
|
||||
"'%s' isn't a subclass of AppConfig." % entry)
|
||||
|
||||
# Obtain app name here rather than in AppClass.__init__ to keep
|
||||
# all error checking for entries in INSTALLED_APPS in one place.
|
||||
try:
|
||||
app_name = cls.name
|
||||
except AttributeError:
|
||||
raise ImproperlyConfigured(
|
||||
"'%s' must supply a name attribute." % entry)
|
||||
|
||||
# Ensure app_name points to a valid module.
|
||||
app_module = import_module(app_name)
|
||||
|
||||
# Entry is a path to an app config class.
|
||||
return cls(app_name, app_module)
|
||||
|
||||
def check_models_ready(self):
|
||||
"""
|
||||
Raises an exception if models haven't been imported yet.
|
||||
"""
|
||||
if self.models is None:
|
||||
raise AppRegistryNotReady(
|
||||
"Models for app '%s' haven't been imported yet." % self.label)
|
||||
|
||||
def get_model(self, model_name):
|
||||
"""
|
||||
Returns the model with the given case-insensitive model_name.
|
||||
|
||||
Raises LookupError if no model exists with this name.
|
||||
"""
|
||||
self.check_models_ready()
|
||||
try:
|
||||
return self.models[model_name.lower()]
|
||||
except KeyError:
|
||||
raise LookupError(
|
||||
"App '%s' doesn't have a '%s' model." % (self.label, model_name))
|
||||
|
||||
def get_models(self, include_auto_created=False,
|
||||
include_deferred=False, include_swapped=False):
|
||||
"""
|
||||
Returns an iterable of models.
|
||||
|
||||
By default, the following models aren't included:
|
||||
|
||||
- auto-created models for many-to-many relations without
|
||||
an explicit intermediate table,
|
||||
- models created to satisfy deferred attribute queries,
|
||||
- models that have been swapped out.
|
||||
|
||||
Set the corresponding keyword argument to True to include such models.
|
||||
Keyword arguments aren't documented; they're a private API.
|
||||
"""
|
||||
self.check_models_ready()
|
||||
for model in self.models.values():
|
||||
if model._deferred and not include_deferred:
|
||||
continue
|
||||
if model._meta.auto_created and not include_auto_created:
|
||||
continue
|
||||
if model._meta.swapped and not include_swapped:
|
||||
continue
|
||||
yield model
|
||||
|
||||
def import_models(self, all_models):
|
||||
# Dictionary of models for this app, primarily maintained in the
|
||||
# 'all_models' attribute of the Apps this AppConfig is attached to.
|
||||
# Injected as a parameter because it gets populated when models are
|
||||
# imported, which might happen before populate() imports models.
|
||||
self.models = all_models
|
||||
|
||||
if module_has_submodule(self.module, MODELS_MODULE_NAME):
|
||||
models_module_name = '%s.%s' % (self.name, MODELS_MODULE_NAME)
|
||||
self.models_module = import_module(models_module_name)
|
||||
|
||||
def ready(self):
|
||||
"""
|
||||
Override this method in subclasses to run code when Django starts.
|
||||
"""
|
441
django/apps/registry.py
Normal file
441
django/apps/registry.py
Normal file
|
@ -0,0 +1,441 @@
|
|||
from collections import Counter, defaultdict, OrderedDict
|
||||
import os
|
||||
import sys
|
||||
import threading
|
||||
import warnings
|
||||
|
||||
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
|
||||
from django.utils import lru_cache
|
||||
from django.utils.deprecation import RemovedInDjango19Warning
|
||||
from django.utils._os import upath
|
||||
|
||||
from .config import AppConfig
|
||||
|
||||
|
||||
class Apps(object):
|
||||
"""
|
||||
A registry that stores the configuration of installed applications.
|
||||
|
||||
It also keeps track of models eg. to provide reverse-relations.
|
||||
"""
|
||||
|
||||
def __init__(self, installed_apps=()):
|
||||
# installed_apps is set to None when creating the master registry
|
||||
# because it cannot be populated at that point. Other registries must
|
||||
# provide a list of installed apps and are populated immediately.
|
||||
if installed_apps is None and hasattr(sys.modules[__name__], 'apps'):
|
||||
raise RuntimeError("You must supply an installed_apps argument.")
|
||||
|
||||
# Mapping of app labels => model names => model classes. Every time a
|
||||
# model is imported, ModelBase.__new__ calls apps.register_model which
|
||||
# creates an entry in all_models. All imported models are registered,
|
||||
# regardless of whether they're defined in an installed application
|
||||
# and whether the registry has been populated. Since it isn't possible
|
||||
# to reimport a module safely (it could reexecute initialization code)
|
||||
# all_models is never overridden or reset.
|
||||
self.all_models = defaultdict(OrderedDict)
|
||||
|
||||
# Mapping of labels to AppConfig instances for installed apps.
|
||||
self.app_configs = OrderedDict()
|
||||
|
||||
# Stack of app_configs. Used to store the current state in
|
||||
# set_available_apps and set_installed_apps.
|
||||
self.stored_app_configs = []
|
||||
|
||||
# Whether the registry is populated.
|
||||
self.apps_ready = self.models_ready = self.ready = False
|
||||
|
||||
# Lock for thread-safe population.
|
||||
self._lock = threading.Lock()
|
||||
|
||||
# Pending lookups for lazy relations.
|
||||
self._pending_lookups = {}
|
||||
|
||||
# Populate apps and models, unless it's the master registry.
|
||||
if installed_apps is not None:
|
||||
self.populate(installed_apps)
|
||||
|
||||
def populate(self, installed_apps=None):
|
||||
"""
|
||||
Loads application configurations and models.
|
||||
|
||||
This method imports each application module and then each model module.
|
||||
|
||||
It is thread safe and idempotent, but not reentrant.
|
||||
"""
|
||||
if self.ready:
|
||||
return
|
||||
|
||||
# populate() might be called by two threads in parallel on servers
|
||||
# that create threads before initializing the WSGI callable.
|
||||
with self._lock:
|
||||
if self.ready:
|
||||
return
|
||||
|
||||
# app_config should be pristine, otherwise the code below won't
|
||||
# guarantee that the order matches the order in INSTALLED_APPS.
|
||||
if self.app_configs:
|
||||
raise RuntimeError("populate() isn't reentrant")
|
||||
|
||||
# Load app configs and app modules.
|
||||
for entry in installed_apps:
|
||||
if isinstance(entry, AppConfig):
|
||||
app_config = entry
|
||||
else:
|
||||
app_config = AppConfig.create(entry)
|
||||
if app_config.label in self.app_configs:
|
||||
raise ImproperlyConfigured(
|
||||
"Application labels aren't unique, "
|
||||
"duplicates: %s" % app_config.label)
|
||||
|
||||
self.app_configs[app_config.label] = app_config
|
||||
|
||||
# Check for duplicate app names.
|
||||
counts = Counter(
|
||||
app_config.name for app_config in self.app_configs.values())
|
||||
duplicates = [
|
||||
name for name, count in counts.most_common() if count > 1]
|
||||
if duplicates:
|
||||
raise ImproperlyConfigured(
|
||||
"Application names aren't unique, "
|
||||
"duplicates: %s" % ", ".join(duplicates))
|
||||
|
||||
self.apps_ready = True
|
||||
|
||||
# Load models.
|
||||
for app_config in self.app_configs.values():
|
||||
all_models = self.all_models[app_config.label]
|
||||
app_config.import_models(all_models)
|
||||
|
||||
self.clear_cache()
|
||||
|
||||
self.models_ready = True
|
||||
|
||||
for app_config in self.get_app_configs():
|
||||
app_config.ready()
|
||||
|
||||
self.ready = True
|
||||
|
||||
def check_apps_ready(self):
|
||||
"""
|
||||
Raises an exception if all apps haven't been imported yet.
|
||||
"""
|
||||
if not self.apps_ready:
|
||||
raise AppRegistryNotReady("Apps aren't loaded yet.")
|
||||
|
||||
def check_models_ready(self):
|
||||
"""
|
||||
Raises an exception if all models haven't been imported yet.
|
||||
"""
|
||||
if not self.models_ready:
|
||||
raise AppRegistryNotReady("Models aren't loaded yet.")
|
||||
|
||||
def get_app_configs(self):
|
||||
"""
|
||||
Imports applications and returns an iterable of app configs.
|
||||
"""
|
||||
self.check_apps_ready()
|
||||
return self.app_configs.values()
|
||||
|
||||
def get_app_config(self, app_label):
|
||||
"""
|
||||
Imports applications and returns an app config for the given label.
|
||||
|
||||
Raises LookupError if no application exists with this label.
|
||||
"""
|
||||
self.check_apps_ready()
|
||||
try:
|
||||
return self.app_configs[app_label]
|
||||
except KeyError:
|
||||
raise LookupError("No installed app with label '%s'." % app_label)
|
||||
|
||||
# This method is performance-critical at least for Django's test suite.
|
||||
@lru_cache.lru_cache(maxsize=None)
|
||||
def get_models(self, app_mod=None, include_auto_created=False,
|
||||
include_deferred=False, include_swapped=False):
|
||||
"""
|
||||
Returns a list of all installed models.
|
||||
|
||||
By default, the following models aren't included:
|
||||
|
||||
- auto-created models for many-to-many relations without
|
||||
an explicit intermediate table,
|
||||
- models created to satisfy deferred attribute queries,
|
||||
- models that have been swapped out.
|
||||
|
||||
Set the corresponding keyword argument to True to include such models.
|
||||
"""
|
||||
self.check_models_ready()
|
||||
if app_mod:
|
||||
warnings.warn(
|
||||
"The app_mod argument of get_models is deprecated.",
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
app_label = app_mod.__name__.split('.')[-2]
|
||||
try:
|
||||
return list(self.get_app_config(app_label).get_models(
|
||||
include_auto_created, include_deferred, include_swapped))
|
||||
except LookupError:
|
||||
return []
|
||||
|
||||
result = []
|
||||
for app_config in self.app_configs.values():
|
||||
result.extend(list(app_config.get_models(
|
||||
include_auto_created, include_deferred, include_swapped)))
|
||||
return result
|
||||
|
||||
def get_model(self, app_label, model_name=None):
|
||||
"""
|
||||
Returns the model matching the given app_label and model_name.
|
||||
|
||||
As a shortcut, this function also accepts a single argument in the
|
||||
form <app_label>.<model_name>.
|
||||
|
||||
model_name is case-insensitive.
|
||||
|
||||
Raises LookupError if no application exists with this label, or no
|
||||
model exists with this name in the application. Raises ValueError if
|
||||
called with a single argument that doesn't contain exactly one dot.
|
||||
"""
|
||||
self.check_models_ready()
|
||||
if model_name is None:
|
||||
app_label, model_name = app_label.split('.')
|
||||
return self.get_app_config(app_label).get_model(model_name.lower())
|
||||
|
||||
def register_model(self, app_label, model):
|
||||
# Since this method is called when models are imported, it cannot
|
||||
# perform imports because of the risk of import loops. It mustn't
|
||||
# call get_app_config().
|
||||
model_name = model._meta.model_name
|
||||
app_models = self.all_models[app_label]
|
||||
if model_name in app_models:
|
||||
if (model.__name__ == app_models[model_name].__name__ and
|
||||
model.__module__ == app_models[model_name].__module__):
|
||||
warnings.warn(
|
||||
"Model '%s.%s' was already registered. "
|
||||
"Reloading models is not advised as it can lead to inconsistencies, "
|
||||
"most notably with related models." % (model_name, app_label),
|
||||
RuntimeWarning, stacklevel=2)
|
||||
else:
|
||||
raise RuntimeError(
|
||||
"Conflicting '%s' models in application '%s': %s and %s." %
|
||||
(model_name, app_label, app_models[model_name], model))
|
||||
app_models[model_name] = model
|
||||
self.clear_cache()
|
||||
|
||||
def is_installed(self, app_name):
|
||||
"""
|
||||
Checks whether an application with this name exists in the registry.
|
||||
|
||||
app_name is the full name of the app eg. 'django.contrib.admin'.
|
||||
"""
|
||||
self.check_apps_ready()
|
||||
return any(ac.name == app_name for ac in self.app_configs.values())
|
||||
|
||||
def get_containing_app_config(self, object_name):
|
||||
"""
|
||||
Look for an app config containing a given object.
|
||||
|
||||
object_name is the dotted Python path to the object.
|
||||
|
||||
Returns the app config for the inner application in case of nesting.
|
||||
Returns None if the object isn't in any registered app config.
|
||||
"""
|
||||
# In Django 1.7 and 1.8, it's allowed to call this method at import
|
||||
# time, even while the registry is being populated. In Django 1.9 and
|
||||
# later, that should be forbidden with `self.check_apps_ready()`.
|
||||
candidates = []
|
||||
for app_config in self.app_configs.values():
|
||||
if object_name.startswith(app_config.name):
|
||||
subpath = object_name[len(app_config.name):]
|
||||
if subpath == '' or subpath[0] == '.':
|
||||
candidates.append(app_config)
|
||||
if candidates:
|
||||
return sorted(candidates, key=lambda ac: -len(ac.name))[0]
|
||||
|
||||
def get_registered_model(self, app_label, model_name):
|
||||
"""
|
||||
Similar to get_model(), but doesn't require that an app exists with
|
||||
the given app_label.
|
||||
|
||||
It's safe to call this method at import time, even while the registry
|
||||
is being populated.
|
||||
"""
|
||||
model = self.all_models[app_label].get(model_name.lower())
|
||||
if model is None:
|
||||
raise LookupError(
|
||||
"Model '%s.%s' not registered." % (app_label, model_name))
|
||||
return model
|
||||
|
||||
def set_available_apps(self, available):
|
||||
"""
|
||||
Restricts the set of installed apps used by get_app_config[s].
|
||||
|
||||
available must be an iterable of application names.
|
||||
|
||||
set_available_apps() must be balanced with unset_available_apps().
|
||||
|
||||
Primarily used for performance optimization in TransactionTestCase.
|
||||
|
||||
This method is safe is the sense that it doesn't trigger any imports.
|
||||
"""
|
||||
available = set(available)
|
||||
installed = set(app_config.name for app_config in self.get_app_configs())
|
||||
if not available.issubset(installed):
|
||||
raise ValueError("Available apps isn't a subset of installed "
|
||||
"apps, extra apps: %s" % ", ".join(available - installed))
|
||||
|
||||
self.stored_app_configs.append(self.app_configs)
|
||||
self.app_configs = OrderedDict(
|
||||
(label, app_config)
|
||||
for label, app_config in self.app_configs.items()
|
||||
if app_config.name in available)
|
||||
self.clear_cache()
|
||||
|
||||
def unset_available_apps(self):
|
||||
"""
|
||||
Cancels a previous call to set_available_apps().
|
||||
"""
|
||||
self.app_configs = self.stored_app_configs.pop()
|
||||
self.clear_cache()
|
||||
|
||||
def set_installed_apps(self, installed):
|
||||
"""
|
||||
Enables a different set of installed apps for get_app_config[s].
|
||||
|
||||
installed must be an iterable in the same format as INSTALLED_APPS.
|
||||
|
||||
set_installed_apps() must be balanced with unset_installed_apps(),
|
||||
even if it exits with an exception.
|
||||
|
||||
Primarily used as a receiver of the setting_changed signal in tests.
|
||||
|
||||
This method may trigger new imports, which may add new models to the
|
||||
registry of all imported models. They will stay in the registry even
|
||||
after unset_installed_apps(). Since it isn't possible to replay
|
||||
imports safely (eg. that could lead to registering listeners twice),
|
||||
models are registered when they're imported and never removed.
|
||||
"""
|
||||
if not self.ready:
|
||||
raise AppRegistryNotReady("App registry isn't ready yet.")
|
||||
self.stored_app_configs.append(self.app_configs)
|
||||
self.app_configs = OrderedDict()
|
||||
self.apps_ready = self.models_ready = self.ready = False
|
||||
self.clear_cache()
|
||||
self.populate(installed)
|
||||
|
||||
def unset_installed_apps(self):
|
||||
"""
|
||||
Cancels a previous call to set_installed_apps().
|
||||
"""
|
||||
self.app_configs = self.stored_app_configs.pop()
|
||||
self.apps_ready = self.models_ready = self.ready = True
|
||||
self.clear_cache()
|
||||
|
||||
def clear_cache(self):
|
||||
"""
|
||||
Clears all internal caches, for methods that alter the app registry.
|
||||
|
||||
This is mostly used in tests.
|
||||
"""
|
||||
self.get_models.cache_clear()
|
||||
|
||||
### DEPRECATED METHODS GO BELOW THIS LINE ###
|
||||
|
||||
def load_app(self, app_name):
|
||||
"""
|
||||
Loads the app with the provided fully qualified name, and returns the
|
||||
model module.
|
||||
"""
|
||||
warnings.warn(
|
||||
"load_app(app_name) is deprecated.",
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
app_config = AppConfig.create(app_name)
|
||||
app_config.import_models(self.all_models[app_config.label])
|
||||
self.app_configs[app_config.label] = app_config
|
||||
self.clear_cache()
|
||||
return app_config.models_module
|
||||
|
||||
def app_cache_ready(self):
|
||||
warnings.warn(
|
||||
"app_cache_ready() is deprecated in favor of the ready property.",
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
return self.ready
|
||||
|
||||
def get_app(self, app_label):
|
||||
"""
|
||||
Returns the module containing the models for the given app_label.
|
||||
"""
|
||||
warnings.warn(
|
||||
"get_app_config(app_label).models_module supersedes get_app(app_label).",
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
try:
|
||||
models_module = self.get_app_config(app_label).models_module
|
||||
except LookupError as exc:
|
||||
# Change the exception type for backwards compatibility.
|
||||
raise ImproperlyConfigured(*exc.args)
|
||||
if models_module is None:
|
||||
raise ImproperlyConfigured(
|
||||
"App '%s' doesn't have a models module." % app_label)
|
||||
return models_module
|
||||
|
||||
def get_apps(self):
|
||||
"""
|
||||
Returns a list of all installed modules that contain models.
|
||||
"""
|
||||
warnings.warn(
|
||||
"[a.models_module for a in get_app_configs()] supersedes get_apps().",
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
app_configs = self.get_app_configs()
|
||||
return [app_config.models_module for app_config in app_configs
|
||||
if app_config.models_module is not None]
|
||||
|
||||
def _get_app_package(self, app):
|
||||
return '.'.join(app.__name__.split('.')[:-1])
|
||||
|
||||
def get_app_package(self, app_label):
|
||||
warnings.warn(
|
||||
"get_app_config(label).name supersedes get_app_package(label).",
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
return self._get_app_package(self.get_app(app_label))
|
||||
|
||||
def _get_app_path(self, app):
|
||||
if hasattr(app, '__path__'): # models/__init__.py package
|
||||
app_path = app.__path__[0]
|
||||
else: # models.py module
|
||||
app_path = app.__file__
|
||||
return os.path.dirname(upath(app_path))
|
||||
|
||||
def get_app_path(self, app_label):
|
||||
warnings.warn(
|
||||
"get_app_config(label).path supersedes get_app_path(label).",
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
return self._get_app_path(self.get_app(app_label))
|
||||
|
||||
def get_app_paths(self):
|
||||
"""
|
||||
Returns a list of paths to all installed apps.
|
||||
|
||||
Useful for discovering files at conventional locations inside apps
|
||||
(static files, templates, etc.)
|
||||
"""
|
||||
warnings.warn(
|
||||
"[a.path for a in get_app_configs()] supersedes get_app_paths().",
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
self.check_apps_ready()
|
||||
app_paths = []
|
||||
for app in self.get_apps():
|
||||
app_paths.append(self._get_app_path(app))
|
||||
return app_paths
|
||||
|
||||
def register_models(self, app_label, *models):
|
||||
"""
|
||||
Register a set of models as belonging to an app.
|
||||
"""
|
||||
warnings.warn(
|
||||
"register_models(app_label, *models) is deprecated.",
|
||||
RemovedInDjango19Warning, stacklevel=2)
|
||||
for model in models:
|
||||
self.register_model(app_label, model)
|
||||
|
||||
|
||||
apps = Apps(installed_apps=None)
|
|
@ -1,19 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Daily cleanup job.
|
||||
|
||||
Can be run as a cronjob to clean out old data from the database (only expired
|
||||
sessions at the moment).
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
from django.core import management
|
||||
|
||||
if __name__ == "__main__":
|
||||
warnings.warn(
|
||||
"The `daily_cleanup` script has been deprecated "
|
||||
"in favor of `django-admin.py clearsessions`.",
|
||||
DeprecationWarning)
|
||||
management.call_command('clearsessions')
|
|
@ -1,10 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# This works exactly like 2to3, except that it uses Django's fixers rather
|
||||
# than 2to3's built-in fixers.
|
||||
|
||||
import sys
|
||||
from lib2to3.main import main
|
||||
|
||||
sys.exit(main("django.utils.2to3_fixes"))
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
gather_profile_stats.py /path/to/dir/of/profiles
|
||||
|
||||
Note that the aggregated profiles must be read with pstats.Stats, not
|
||||
hotshot.stats (the formats are incompatible)
|
||||
"""
|
||||
|
||||
from hotshot import stats
|
||||
import os
|
||||
import pstats
|
||||
import sys
|
||||
|
||||
def gather_stats(p):
|
||||
profiles = {}
|
||||
for f in os.listdir(p):
|
||||
if f.endswith('.agg.prof'):
|
||||
path = f[:-9]
|
||||
prof = pstats.Stats(os.path.join(p, f))
|
||||
elif f.endswith('.prof'):
|
||||
bits = f.split('.')
|
||||
path = ".".join(bits[:-3])
|
||||
prof = stats.load(os.path.join(p, f))
|
||||
else:
|
||||
continue
|
||||
print("Processing %s" % f)
|
||||
if path in profiles:
|
||||
profiles[path].add(prof)
|
||||
else:
|
||||
profiles[path] = prof
|
||||
os.unlink(os.path.join(p, f))
|
||||
for (path, prof) in profiles.items():
|
||||
prof.dump_stats(os.path.join(p, "%s.agg.prof" % path))
|
||||
|
||||
if __name__ == '__main__':
|
||||
gather_stats(sys.argv[1])
|
|
@ -1,29 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
def unique_messages():
|
||||
basedir = None
|
||||
|
||||
if os.path.isdir(os.path.join('conf', 'locale')):
|
||||
basedir = os.path.abspath(os.path.join('conf', 'locale'))
|
||||
elif os.path.isdir('locale'):
|
||||
basedir = os.path.abspath('locale')
|
||||
else:
|
||||
print("This script should be run from the Django Git tree or your project or app tree.")
|
||||
sys.exit(1)
|
||||
|
||||
for (dirpath, dirnames, filenames) in os.walk(basedir):
|
||||
for f in filenames:
|
||||
if f.endswith('.po'):
|
||||
sys.stderr.write('processing file %s in %s\n' % (f, dirpath))
|
||||
pf = os.path.splitext(os.path.join(dirpath, f))[0]
|
||||
cmd = 'msguniq "%s.po"' % pf
|
||||
stdout = os.popen(cmd)
|
||||
msg = stdout.read()
|
||||
with open('%s.po' % pf, 'w') as fp:
|
||||
fp.write(msg)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unique_messages()
|
|
@ -6,17 +6,13 @@ variable, and then from django.conf.global_settings; see the global settings fil
|
|||
a list of all possible variables.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import importlib
|
||||
import os
|
||||
import sys
|
||||
import time # Needed for Windows
|
||||
import warnings
|
||||
|
||||
from django.conf import global_settings
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils.functional import LazyObject, empty
|
||||
from django.utils import importlib
|
||||
from django.utils.module_loading import import_by_path
|
||||
from django.utils import six
|
||||
|
||||
ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
|
||||
|
@ -34,11 +30,8 @@ class LazySettings(LazyObject):
|
|||
is used the first time we need any settings at all, if the user has not
|
||||
previously configured the settings manually.
|
||||
"""
|
||||
try:
|
||||
settings_module = os.environ[ENVIRONMENT_VARIABLE]
|
||||
if not settings_module: # If it's set but is an empty string.
|
||||
raise KeyError
|
||||
except KeyError:
|
||||
settings_module = os.environ.get(ENVIRONMENT_VARIABLE)
|
||||
if not settings_module:
|
||||
desc = ("setting %s" % name) if name else "settings"
|
||||
raise ImproperlyConfigured(
|
||||
"Requested %s, but settings are not configured. "
|
||||
|
@ -47,38 +40,12 @@ class LazySettings(LazyObject):
|
|||
% (desc, ENVIRONMENT_VARIABLE))
|
||||
|
||||
self._wrapped = Settings(settings_module)
|
||||
self._configure_logging()
|
||||
|
||||
def __getattr__(self, name):
|
||||
if self._wrapped is empty:
|
||||
self._setup(name)
|
||||
return getattr(self._wrapped, name)
|
||||
|
||||
def _configure_logging(self):
|
||||
"""
|
||||
Setup logging from LOGGING_CONFIG and LOGGING settings.
|
||||
"""
|
||||
if not sys.warnoptions:
|
||||
try:
|
||||
# Route warnings through python logging
|
||||
logging.captureWarnings(True)
|
||||
# Allow DeprecationWarnings through the warnings filters
|
||||
warnings.simplefilter("default", DeprecationWarning)
|
||||
except AttributeError:
|
||||
# No captureWarnings on Python 2.6, DeprecationWarnings are on anyway
|
||||
pass
|
||||
|
||||
if self.LOGGING_CONFIG:
|
||||
from django.utils.log import DEFAULT_LOGGING
|
||||
# First find the logging configuration function ...
|
||||
logging_config_func = import_by_path(self.LOGGING_CONFIG)
|
||||
|
||||
logging_config_func(DEFAULT_LOGGING)
|
||||
|
||||
# ... then invoke it with the logging settings
|
||||
if self.LOGGING:
|
||||
logging_config_func(self.LOGGING)
|
||||
|
||||
def configure(self, default_settings=global_settings, **options):
|
||||
"""
|
||||
Called to manually configure the settings. The 'default_settings'
|
||||
|
@ -91,7 +58,6 @@ class LazySettings(LazyObject):
|
|||
for name, value in options.items():
|
||||
setattr(holder, name, value)
|
||||
self._wrapped = holder
|
||||
self._configure_logging()
|
||||
|
||||
@property
|
||||
def configured(self):
|
||||
|
@ -118,7 +84,7 @@ class Settings(BaseSettings):
|
|||
def __init__(self, settings_module):
|
||||
# update this dict from global settings (but only for ALL_CAPS settings)
|
||||
for setting in dir(global_settings):
|
||||
if setting == setting.upper():
|
||||
if setting.isupper():
|
||||
setattr(self, setting, getattr(global_settings, setting))
|
||||
|
||||
# store the settings module in case someone later cares
|
||||
|
@ -132,20 +98,18 @@ class Settings(BaseSettings):
|
|||
% (self.SETTINGS_MODULE, e)
|
||||
)
|
||||
|
||||
# Settings that should be converted into tuples if they're mistakenly entered
|
||||
# as strings.
|
||||
tuple_settings = ("INSTALLED_APPS", "TEMPLATE_DIRS")
|
||||
|
||||
self._explicit_settings = set()
|
||||
for setting in dir(mod):
|
||||
if setting == setting.upper():
|
||||
if setting.isupper():
|
||||
setting_value = getattr(mod, setting)
|
||||
if setting in tuple_settings and \
|
||||
isinstance(setting_value, six.string_types):
|
||||
warnings.warn("The %s setting must be a tuple. Please fix your "
|
||||
"settings, as auto-correction is now deprecated." % setting,
|
||||
DeprecationWarning, stacklevel=2)
|
||||
setting_value = (setting_value,) # In case the user forgot the comma.
|
||||
|
||||
if (setting in tuple_settings and
|
||||
isinstance(setting_value, six.string_types)):
|
||||
raise ImproperlyConfigured("The %s setting must be a tuple. "
|
||||
"Please fix your settings." % setting)
|
||||
setattr(self, setting, setting_value)
|
||||
self._explicit_settings.add(setting)
|
||||
|
||||
if not self.SECRET_KEY:
|
||||
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
|
||||
|
@ -162,6 +126,9 @@ class Settings(BaseSettings):
|
|||
os.environ['TZ'] = self.TIME_ZONE
|
||||
time.tzset()
|
||||
|
||||
def is_overridden(self, setting):
|
||||
return setting in self._explicit_settings
|
||||
|
||||
|
||||
class UserSettingsHolder(BaseSettings):
|
||||
"""
|
||||
|
@ -186,13 +153,20 @@ class UserSettingsHolder(BaseSettings):
|
|||
|
||||
def __setattr__(self, name, value):
|
||||
self._deleted.discard(name)
|
||||
return super(UserSettingsHolder, self).__setattr__(name, value)
|
||||
super(UserSettingsHolder, self).__setattr__(name, value)
|
||||
|
||||
def __delattr__(self, name):
|
||||
self._deleted.add(name)
|
||||
return super(UserSettingsHolder, self).__delattr__(name)
|
||||
if hasattr(self, name):
|
||||
super(UserSettingsHolder, self).__delattr__(name)
|
||||
|
||||
def __dir__(self):
|
||||
return list(self.__dict__) + dir(self.default_settings)
|
||||
|
||||
def is_overridden(self, setting):
|
||||
deleted = (setting in self._deleted)
|
||||
set_locally = (setting in self.__dict__)
|
||||
set_on_default = getattr(self.default_settings, 'is_overridden', lambda s: False)(setting)
|
||||
return (deleted or set_locally or set_on_default)
|
||||
|
||||
settings = LazySettings()
|
||||
|
|
|
@ -50,6 +50,7 @@ LANGUAGE_CODE = 'en-us'
|
|||
LANGUAGES = (
|
||||
('af', gettext_noop('Afrikaans')),
|
||||
('ar', gettext_noop('Arabic')),
|
||||
('ast', gettext_noop('Asturian')),
|
||||
('az', gettext_noop('Azerbaijani')),
|
||||
('bg', gettext_noop('Bulgarian')),
|
||||
('be', gettext_noop('Belarusian')),
|
||||
|
@ -63,6 +64,7 @@ LANGUAGES = (
|
|||
('de', gettext_noop('German')),
|
||||
('el', gettext_noop('Greek')),
|
||||
('en', gettext_noop('English')),
|
||||
('en-au', gettext_noop('Australian English')),
|
||||
('en-gb', gettext_noop('British English')),
|
||||
('eo', gettext_noop('Esperanto')),
|
||||
('es', gettext_noop('Spanish')),
|
||||
|
@ -75,7 +77,7 @@ LANGUAGES = (
|
|||
('fa', gettext_noop('Persian')),
|
||||
('fi', gettext_noop('Finnish')),
|
||||
('fr', gettext_noop('French')),
|
||||
('fy-nl', gettext_noop('Frisian')),
|
||||
('fy', gettext_noop('Frisian')),
|
||||
('ga', gettext_noop('Irish')),
|
||||
('gl', gettext_noop('Galician')),
|
||||
('he', gettext_noop('Hebrew')),
|
||||
|
@ -84,6 +86,7 @@ LANGUAGES = (
|
|||
('hu', gettext_noop('Hungarian')),
|
||||
('ia', gettext_noop('Interlingua')),
|
||||
('id', gettext_noop('Indonesian')),
|
||||
('io', gettext_noop('Ido')),
|
||||
('is', gettext_noop('Icelandic')),
|
||||
('it', gettext_noop('Italian')),
|
||||
('ja', gettext_noop('Japanese')),
|
||||
|
@ -98,6 +101,7 @@ LANGUAGES = (
|
|||
('mk', gettext_noop('Macedonian')),
|
||||
('ml', gettext_noop('Malayalam')),
|
||||
('mn', gettext_noop('Mongolian')),
|
||||
('mr', gettext_noop('Marathi')),
|
||||
('my', gettext_noop('Burmese')),
|
||||
('nb', gettext_noop('Norwegian Bokmal')),
|
||||
('ne', gettext_noop('Nepali')),
|
||||
|
@ -127,6 +131,8 @@ LANGUAGES = (
|
|||
('ur', gettext_noop('Urdu')),
|
||||
('vi', gettext_noop('Vietnamese')),
|
||||
('zh-cn', gettext_noop('Simplified Chinese')),
|
||||
('zh-hans', gettext_noop('Simplified Chinese')),
|
||||
('zh-hant', gettext_noop('Traditional Chinese')),
|
||||
('zh-tw', gettext_noop('Traditional Chinese')),
|
||||
)
|
||||
|
||||
|
@ -137,7 +143,13 @@ LANGUAGES_BIDI = ("he", "ar", "fa", "ur")
|
|||
# to load the internationalization machinery.
|
||||
USE_I18N = True
|
||||
LOCALE_PATHS = ()
|
||||
|
||||
# Settings for language cookie
|
||||
LANGUAGE_COOKIE_NAME = 'django_language'
|
||||
LANGUAGE_COOKIE_AGE = None
|
||||
LANGUAGE_COOKIE_DOMAIN = None
|
||||
LANGUAGE_COOKIE_PATH = '/'
|
||||
|
||||
|
||||
# If you set this to True, Django will format dates, numbers and calendars
|
||||
# according to user current locale.
|
||||
|
@ -184,6 +196,7 @@ EMAIL_PORT = 25
|
|||
EMAIL_HOST_USER = ''
|
||||
EMAIL_HOST_PASSWORD = ''
|
||||
EMAIL_USE_TLS = False
|
||||
EMAIL_USE_SSL = False
|
||||
|
||||
# List of strings representing installed apps.
|
||||
INSTALLED_APPS = ()
|
||||
|
@ -197,7 +210,7 @@ TEMPLATE_DIRS = ()
|
|||
TEMPLATE_LOADERS = (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
# 'django.template.loaders.eggs.Loader',
|
||||
# 'django.template.loaders.eggs.Loader',
|
||||
)
|
||||
|
||||
# List of processors used by RequestContext to populate the context.
|
||||
|
@ -210,7 +223,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
|||
'django.core.context_processors.media',
|
||||
'django.core.context_processors.static',
|
||||
'django.core.context_processors.tz',
|
||||
# 'django.core.context_processors.request',
|
||||
# 'django.core.context_processors.request',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
)
|
||||
|
||||
|
@ -252,7 +265,7 @@ ABSOLUTE_URL_OVERRIDES = {}
|
|||
# Example: ('/home/html', '/var/www')
|
||||
ALLOWED_INCLUDE_ROOTS = ()
|
||||
|
||||
# If this is a admin settings module, this should be a list of
|
||||
# If this is an admin settings module, this should be a list of
|
||||
# settings modules (in the format 'foo.bar.baz') for which this admin
|
||||
# is an admin.
|
||||
ADMIN_FOR = ()
|
||||
|
@ -287,7 +300,7 @@ MEDIA_URL = ''
|
|||
|
||||
# Absolute path to the directory static files should be collected to.
|
||||
# Example: "/var/www/example.com/static/"
|
||||
STATIC_ROOT = ''
|
||||
STATIC_ROOT = None
|
||||
|
||||
# URL that handles the static files served from STATIC_ROOT.
|
||||
# Example: "http://example.com/static/", "http://static.example.com/"
|
||||
|
@ -301,7 +314,7 @@ FILE_UPLOAD_HANDLERS = (
|
|||
|
||||
# Maximum size, in bytes, of a request before it will be streamed to the
|
||||
# file system instead of into memory.
|
||||
FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440 # i.e. 2.5 MB
|
||||
FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440 # i.e. 2.5 MB
|
||||
|
||||
# Directory in which upload streamed files will be temporarily saved. A value of
|
||||
# `None` will make Django use the operating system's default temporary directory
|
||||
|
@ -312,6 +325,11 @@ FILE_UPLOAD_TEMP_DIR = None
|
|||
# you'd pass directly to os.chmod; see http://docs.python.org/lib/os-file-dir.html.
|
||||
FILE_UPLOAD_PERMISSIONS = None
|
||||
|
||||
# The numeric mode to assign to newly-created directories, when uploading files.
|
||||
# The value should be a mode as you'd pass to os.chmod;
|
||||
# see http://docs.python.org/lib/os-file-dir.html.
|
||||
FILE_UPLOAD_DIRECTORY_PERMISSIONS = None
|
||||
|
||||
# Python module path where user will place custom format definition.
|
||||
# The directory where this setting is pointing should contain subdirectories
|
||||
# named as the locales, containing a formats.py file
|
||||
|
@ -354,11 +372,11 @@ SHORT_DATETIME_FORMAT = 'm/d/Y P'
|
|||
# http://docs.python.org/library/datetime.html#strftime-behavior
|
||||
# * Note that these format strings are different from the ones to display dates
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
|
||||
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
|
||||
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
|
||||
'%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
|
||||
'%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
|
||||
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
|
||||
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
|
||||
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
|
||||
'%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
|
||||
'%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
|
||||
)
|
||||
|
||||
# Default formats to be used when parsing times from input boxes, in order
|
||||
|
@ -446,12 +464,7 @@ SECURE_PROXY_SSL_HEADER = None
|
|||
# response phase the middleware will be applied in reverse order.
|
||||
MIDDLEWARE_CLASSES = (
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
# 'django.middleware.http.ConditionalGetMiddleware',
|
||||
# 'django.middleware.gzip.GZipMiddleware',
|
||||
)
|
||||
|
||||
############
|
||||
|
@ -543,6 +556,7 @@ CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure'
|
|||
|
||||
# Settings for CSRF cookie.
|
||||
CSRF_COOKIE_NAME = 'csrftoken'
|
||||
CSRF_COOKIE_AGE = 60 * 60 * 24 * 7 * 52
|
||||
CSRF_COOKIE_DOMAIN = None
|
||||
CSRF_COOKIE_PATH = '/'
|
||||
CSRF_COOKIE_SECURE = False
|
||||
|
@ -563,7 +577,7 @@ MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
|
|||
###########
|
||||
|
||||
# The callable to use to configure logging
|
||||
LOGGING_CONFIG = 'django.utils.log.dictConfig'
|
||||
LOGGING_CONFIG = 'logging.config.dictConfig'
|
||||
|
||||
# Custom logging configuration.
|
||||
LOGGING = {}
|
||||
|
@ -579,6 +593,10 @@ DEFAULT_EXCEPTION_REPORTER_FILTER = 'django.views.debug.SafeExceptionReporterFil
|
|||
# The name of the class to use to run the test suite
|
||||
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
|
||||
|
||||
# Apps that don't need to be serialized at test database creation time
|
||||
# (only apps with migrations are to start with)
|
||||
TEST_NON_SERIALIZED_APPS = []
|
||||
|
||||
############
|
||||
# FIXTURES #
|
||||
############
|
||||
|
@ -601,5 +619,22 @@ STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
|
|||
STATICFILES_FINDERS = (
|
||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
||||
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
||||
)
|
||||
|
||||
##############
|
||||
# MIGRATIONS #
|
||||
##############
|
||||
|
||||
# Migration module overrides for apps, by app label.
|
||||
MIGRATION_MODULES = {}
|
||||
|
||||
#################
|
||||
# SYSTEM CHECKS #
|
||||
#################
|
||||
|
||||
# List of all issues generated by system checks that should be silenced. Light
|
||||
# issues like warnings, infos or debugs will not generate a message. Silencing
|
||||
# serious issues like errors and criticals does not result in hiding the
|
||||
# message, but Django will not stop you from e.g. running server.
|
||||
SILENCED_SYSTEM_CHECKS = []
|
||||
|
|
|
@ -17,6 +17,12 @@ LANG_INFO = {
|
|||
'name': 'Arabic',
|
||||
'name_local': 'العربيّة',
|
||||
},
|
||||
'ast': {
|
||||
'bidi': False,
|
||||
'code': 'ast',
|
||||
'name': 'Asturian',
|
||||
'name_local': 'asturianu',
|
||||
},
|
||||
'az': {
|
||||
'bidi': True,
|
||||
'code': 'az',
|
||||
|
@ -95,6 +101,12 @@ LANG_INFO = {
|
|||
'name': 'English',
|
||||
'name_local': 'English',
|
||||
},
|
||||
'en-au': {
|
||||
'bidi': False,
|
||||
'code': 'en-au',
|
||||
'name': 'Australian English',
|
||||
'name_local': 'Australian English',
|
||||
},
|
||||
'en-gb': {
|
||||
'bidi': False,
|
||||
'code': 'en-gb',
|
||||
|
@ -167,11 +179,11 @@ LANG_INFO = {
|
|||
'name': 'French',
|
||||
'name_local': 'français',
|
||||
},
|
||||
'fy-nl': {
|
||||
'fy': {
|
||||
'bidi': False,
|
||||
'code': 'fy-nl',
|
||||
'code': 'fy',
|
||||
'name': 'Frisian',
|
||||
'name_local': 'Frisian',
|
||||
'name_local': 'frysk',
|
||||
},
|
||||
'ga': {
|
||||
'bidi': False,
|
||||
|
@ -215,6 +227,12 @@ LANG_INFO = {
|
|||
'name': 'Interlingua',
|
||||
'name_local': 'Interlingua',
|
||||
},
|
||||
'io': {
|
||||
'bidi': False,
|
||||
'code': 'io',
|
||||
'name': 'Ido',
|
||||
'name_local': 'ido',
|
||||
},
|
||||
'id': {
|
||||
'bidi': False,
|
||||
'code': 'id',
|
||||
|
@ -305,6 +323,12 @@ LANG_INFO = {
|
|||
'name': 'Mongolian',
|
||||
'name_local': 'Mongolian',
|
||||
},
|
||||
'mr': {
|
||||
'bidi': False,
|
||||
'code': 'mr',
|
||||
'name': 'Marathi',
|
||||
'name_local': 'मराठी',
|
||||
},
|
||||
'my': {
|
||||
'bidi': False,
|
||||
'code': 'my',
|
||||
|
@ -485,6 +509,18 @@ LANG_INFO = {
|
|||
'name': 'Simplified Chinese',
|
||||
'name_local': '简体中文',
|
||||
},
|
||||
'zh-hans': {
|
||||
'bidi': False,
|
||||
'code': 'zh-hans',
|
||||
'name': 'Simplified Chinese',
|
||||
'name_local': '简体中文',
|
||||
},
|
||||
'zh-hant': {
|
||||
'bidi': False,
|
||||
'code': 'zh-hant',
|
||||
'name': 'Traditional Chinese',
|
||||
'name_local': '繁體中文',
|
||||
},
|
||||
'zh-tw': {
|
||||
'bidi': False,
|
||||
'code': 'zh-tw',
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
BIN
django/conf/locale/ast/LC_MESSAGES/django.mo
Normal file
BIN
django/conf/locale/ast/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
1402
django/conf/locale/ast/LC_MESSAGES/django.po
Normal file
1402
django/conf/locale/ast/LC_MESSAGES/django.po
Normal file
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -20,5 +20,5 @@ SHORT_DATE_FORMAT = 'd.m.Y'
|
|||
# TIME_INPUT_FORMATS =
|
||||
# DATETIME_INPUT_FORMATS =
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = ' ' # Non-breaking space
|
||||
THOUSAND_SEPARATOR = ' ' # Non-breaking space
|
||||
# NUMBER_GROUPING =
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -12,7 +12,7 @@ YEAR_MONTH_FORMAT = r'F \d\e\l Y'
|
|||
MONTH_DAY_FORMAT = r'j \d\e F'
|
||||
SHORT_DATE_FORMAT = 'd/m/Y'
|
||||
SHORT_DATETIME_FORMAT = 'd/m/Y G:i'
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
|
@ -31,4 +31,3 @@ DATETIME_INPUT_FORMATS = (
|
|||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = '.'
|
||||
NUMBER_GROUPING = 3
|
||||
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -12,34 +12,34 @@ YEAR_MONTH_FORMAT = 'F Y'
|
|||
MONTH_DAY_FORMAT = 'j. F'
|
||||
SHORT_DATE_FORMAT = 'd.m.Y'
|
||||
SHORT_DATETIME_FORMAT = 'd.m.Y G:i:s'
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%d.%m.%Y', '%d.%m.%y', # '05.01.2006', '05.01.06'
|
||||
'%d. %m. %Y', '%d. %m. %y', # '5. 1. 2006', '5. 1. 06'
|
||||
'%d. %m. %Y', '%d. %m. %y', # '5. 1. 2006', '5. 1. 06'
|
||||
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
|
||||
)
|
||||
# Kept ISO formats as one is in first position
|
||||
TIME_INPUT_FORMATS = (
|
||||
'%H:%M:%S', # '04:30:59'
|
||||
'%H:%M:%S', # '04:30:59'
|
||||
'%H.%M', # '04.30'
|
||||
'%H:%M', # '04:30'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d.%m.%Y %H:%M:%S', # '05.01.2006 04:30:59'
|
||||
'%d.%m.%Y %H:%M:%S.%f', # '05.01.2006 04:30:59.000200'
|
||||
'%d.%m.%Y %H:%M:%S.%f', # '05.01.2006 04:30:59.000200'
|
||||
'%d.%m.%Y %H.%M', # '05.01.2006 04.30'
|
||||
'%d.%m.%Y %H:%M', # '05.01.2006 04:30'
|
||||
'%d.%m.%Y', # '05.01.2006'
|
||||
'%d. %m. %Y %H:%M:%S', # '05. 01. 2006 04:30:59'
|
||||
'%d. %m. %Y %H:%M:%S.%f', # '05. 01. 2006 04:30:59.000200'
|
||||
'%d. %m. %Y %H:%M:%S.%f', # '05. 01. 2006 04:30:59.000200'
|
||||
'%d. %m. %Y %H.%M', # '05. 01. 2006 04.30'
|
||||
'%d. %m. %Y %H:%M', # '05. 01. 2006 04:30'
|
||||
'%d. %m. %Y', # '05. 01. 2006'
|
||||
'%Y-%m-%d %H.%M', # '2006-01-05 04.30'
|
||||
)
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
|
||||
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
|
||||
NUMBER_GROUPING = 3
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -5,20 +5,34 @@ from __future__ import unicode_literals
|
|||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'd F Y'
|
||||
TIME_FORMAT = 'g:i:s A'
|
||||
# DATETIME_FORMAT =
|
||||
# YEAR_MONTH_FORMAT =
|
||||
# MONTH_DAY_FORMAT =
|
||||
SHORT_DATE_FORMAT = 'j M Y'
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
DATE_FORMAT = 'j F Y' # '25 Hydref 2006'
|
||||
TIME_FORMAT = 'P' # '2:30 y.b.'
|
||||
DATETIME_FORMAT = 'j F Y, P' # '25 Hydref 2006, 2:30 y.b.'
|
||||
YEAR_MONTH_FORMAT = 'F Y' # 'Hydref 2006'
|
||||
MONTH_DAY_FORMAT = 'j F' # '25 Hydref'
|
||||
SHORT_DATE_FORMAT = 'd/m/Y' # '25/10/2006'
|
||||
SHORT_DATETIME_FORMAT = 'd/m/Y P' # '25/10/2006 2:30 y.b.'
|
||||
FIRST_DAY_OF_WEEK = 1 # 'Dydd Llun'
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
# DATE_INPUT_FORMATS =
|
||||
# TIME_INPUT_FORMATS =
|
||||
# DATETIME_INPUT_FORMATS =
|
||||
# DECIMAL_SEPARATOR =
|
||||
# THOUSAND_SEPARATOR =
|
||||
# NUMBER_GROUPING =
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
|
||||
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
|
||||
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
|
||||
'%Y-%m-%d', # '2006-10-25'
|
||||
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
|
||||
'%d/%m/%Y %H:%M:%S.%f', # '25/10/2006 14:30:59.000200'
|
||||
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
|
||||
'%d/%m/%Y', # '25/10/2006'
|
||||
'%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'
|
||||
'%d/%m/%y %H:%M:%S.%f', # '25/10/06 14:30:59.000200'
|
||||
'%d/%m/%y %H:%M', # '25/10/06 14:30'
|
||||
'%d/%m/%y', # '25/10/06'
|
||||
)
|
||||
DECIMAL_SEPARATOR = '.'
|
||||
THOUSAND_SEPARATOR = ','
|
||||
NUMBER_GROUPING = 3
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -12,7 +12,7 @@ YEAR_MONTH_FORMAT = 'F Y'
|
|||
MONTH_DAY_FORMAT = 'j. F'
|
||||
SHORT_DATE_FORMAT = 'd.m.Y'
|
||||
SHORT_DATETIME_FORMAT = 'd.m.Y H:i:s'
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
|
@ -22,7 +22,7 @@ DATE_INPUT_FORMATS = (
|
|||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
|
||||
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
|
||||
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
|
||||
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
|
||||
'%d.%m.%Y', # '25.10.2006'
|
||||
)
|
||||
|
|
|
@ -13,7 +13,7 @@ YEAR_MONTH_FORMAT = 'F Y'
|
|||
MONTH_DAY_FORMAT = 'j. F'
|
||||
SHORT_DATE_FORMAT = 'd.m.Y'
|
||||
SHORT_DATETIME_FORMAT = 'd.m.Y H:i:s'
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
|
@ -23,7 +23,7 @@ DATE_INPUT_FORMATS = (
|
|||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
|
||||
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
|
||||
'%d.%m.%Y %H:%M:%S.%f', # '25.10.2006 14:30:59.000200'
|
||||
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
|
||||
'%d.%m.%Y', # '25.10.2006'
|
||||
)
|
||||
|
@ -34,5 +34,5 @@ DATETIME_INPUT_FORMATS = (
|
|||
# For details, please refer to http://www.bk.admin.ch/dokumentation/sprachen/04915/05016/index.html?lang=de
|
||||
# (in German) and the documentation
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
|
||||
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
|
||||
NUMBER_GROUPING = 3
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -5,20 +5,34 @@ from __future__ import unicode_literals
|
|||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'd E Y'
|
||||
TIME_FORMAT = 'g:i:s A'
|
||||
# DATETIME_FORMAT =
|
||||
DATE_FORMAT = 'd/m/Y'
|
||||
TIME_FORMAT = 'P'
|
||||
DATETIME_FORMAT = 'd/m/Y P'
|
||||
YEAR_MONTH_FORMAT = 'F Y'
|
||||
MONTH_DAY_FORMAT = 'j F'
|
||||
SHORT_DATE_FORMAT = 'd M Y'
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
SHORT_DATE_FORMAT = 'd/m/Y'
|
||||
SHORT_DATETIME_FORMAT = 'd/m/Y P'
|
||||
FIRST_DAY_OF_WEEK = 0 # Sunday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
# DATE_INPUT_FORMATS =
|
||||
# TIME_INPUT_FORMATS =
|
||||
# DATETIME_INPUT_FORMATS =
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%d/%m/%Y', '%d/%m/%y', '%Y-%m-%d', # '25/10/2006', '25/10/06', '2006-10-25',
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
|
||||
'%d/%m/%Y %H:%M:%S.%f', # '25/10/2006 14:30:59.000200'
|
||||
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
|
||||
'%d/%m/%Y', # '25/10/2006'
|
||||
'%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'
|
||||
'%d/%m/%y %H:%M:%S.%f', # '25/10/06 14:30:59.000200'
|
||||
'%d/%m/%y %H:%M', # '25/10/06 14:30'
|
||||
'%d/%m/%y', # '25/10/06'
|
||||
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
|
||||
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
|
||||
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
|
||||
'%Y-%m-%d', # '2006-10-25'
|
||||
)
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = '.'
|
||||
# NUMBER_GROUPING =
|
||||
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
|
||||
NUMBER_GROUPING = 3
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -12,13 +12,13 @@ YEAR_MONTH_FORMAT = 'F Y'
|
|||
MONTH_DAY_FORMAT = 'F j'
|
||||
SHORT_DATE_FORMAT = 'm/d/Y'
|
||||
SHORT_DATETIME_FORMAT = 'm/d/Y P'
|
||||
FIRST_DAY_OF_WEEK = 0 # Sunday
|
||||
FIRST_DAY_OF_WEEK = 0 # Sunday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
# Kept ISO formats as they are in first position
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
|
||||
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
|
||||
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
|
||||
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
|
||||
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
|
||||
|
@ -41,4 +41,3 @@ DATETIME_INPUT_FORMATS = (
|
|||
DECIMAL_SEPARATOR = '.'
|
||||
THOUSAND_SEPARATOR = ','
|
||||
NUMBER_GROUPING = 3
|
||||
|
||||
|
|
BIN
django/conf/locale/en_AU/LC_MESSAGES/django.mo
Normal file
BIN
django/conf/locale/en_AU/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
1395
django/conf/locale/en_AU/LC_MESSAGES/django.po
Normal file
1395
django/conf/locale/en_AU/LC_MESSAGES/django.po
Normal file
File diff suppressed because it is too large
Load diff
42
django/conf/locale/en_AU/formats.py
Normal file
42
django/conf/locale/en_AU/formats.py
Normal file
|
@ -0,0 +1,42 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'j M Y' # '25 Oct 2006'
|
||||
TIME_FORMAT = 'P' # '2:30 pm'
|
||||
DATETIME_FORMAT = 'j M Y, P' # '25 Oct 2006, 2:30 pm'
|
||||
YEAR_MONTH_FORMAT = 'F Y' # 'October 2006'
|
||||
MONTH_DAY_FORMAT = 'j F' # '25 October'
|
||||
SHORT_DATE_FORMAT = 'd/m/Y' # '25/10/2006'
|
||||
SHORT_DATETIME_FORMAT = 'd/m/Y P' # '25/10/2006 2:30 pm'
|
||||
FIRST_DAY_OF_WEEK = 0 # Sunday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
|
||||
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
|
||||
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
|
||||
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
|
||||
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
|
||||
'%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
|
||||
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
|
||||
'%Y-%m-%d', # '2006-10-25'
|
||||
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
|
||||
'%d/%m/%Y %H:%M:%S.%f', # '25/10/2006 14:30:59.000200'
|
||||
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
|
||||
'%d/%m/%Y', # '25/10/2006'
|
||||
'%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'
|
||||
'%d/%m/%y %H:%M:%S.%f', # '25/10/06 14:30:59.000200'
|
||||
'%d/%m/%y %H:%M', # '25/10/06 14:30'
|
||||
'%d/%m/%y', # '25/10/06'
|
||||
)
|
||||
DECIMAL_SEPARATOR = '.'
|
||||
THOUSAND_SEPARATOR = ','
|
||||
NUMBER_GROUPING = 3
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -40,4 +40,3 @@ DATETIME_INPUT_FORMATS = (
|
|||
DECIMAL_SEPARATOR = '.'
|
||||
THOUSAND_SEPARATOR = ','
|
||||
NUMBER_GROUPING = 3
|
||||
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
52
django/conf/locale/eo/formats.py
Normal file
52
django/conf/locale/eo/formats.py
Normal file
|
@ -0,0 +1,52 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = r'j\-\a \d\e F Y' # '26-a de julio 1887'
|
||||
TIME_FORMAT = 'H:i:s' # '18:59:00'
|
||||
DATETIME_FORMAT = r'j\-\a \d\e F Y\, \j\e H:i:s' # '26-a de julio 1887, je 18:59:00'
|
||||
YEAR_MONTH_FORMAT = r'F \d\e Y' # 'julio de 1887'
|
||||
MONTH_DAY_FORMAT = r'j\-\a \d\e F' # '26-a de julio'
|
||||
SHORT_DATE_FORMAT = 'Y-m-d' # '1887-07-26'
|
||||
SHORT_DATETIME_FORMAT = 'Y-m-d H:i:s' # '1887-07-26 18:59:00'
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday (lundo)
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%Y-%m-%d', # '1887-07-26'
|
||||
'%y-%m-%d', # '87-07-26'
|
||||
'%Y %m %d', # '1887 07 26'
|
||||
'%d-a de %b %Y', # '26-a de jul 1887'
|
||||
'%d %b %Y', # '26 jul 1887'
|
||||
'%d-a de %B %Y', # '26-a de julio 1887'
|
||||
'%d %B %Y', # '26 julio 1887'
|
||||
'%d %m %Y', # '26 07 1887'
|
||||
)
|
||||
TIME_INPUT_FORMATS = (
|
||||
'%H:%M:%S', # '18:59:00'
|
||||
'%H:%M', # '18:59'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%Y-%m-%d %H:%M:%S', # '1887-07-26 18:59:00'
|
||||
'%Y-%m-%d %H:%M', # '1887-07-26 18:59'
|
||||
'%Y-%m-%d', # '1887-07-26'
|
||||
|
||||
'%Y.%m.%d %H:%M:%S', # '1887.07.26 18:59:00'
|
||||
'%Y.%m.%d %H:%M', # '1887.07.26 18:59'
|
||||
'%Y.%m.%d', # '1887.07.26'
|
||||
|
||||
'%d/%m/%Y %H:%M:%S', # '26/07/1887 18:59:00'
|
||||
'%d/%m/%Y %H:%M', # '26/07/1887 18:59'
|
||||
'%d/%m/%Y', # '26/07/1887'
|
||||
|
||||
'%y-%m-%d %H:%M:%S', # '87-07-26 18:59:00'
|
||||
'%y-%m-%d %H:%M', # '87-07-26 18:59'
|
||||
'%y-%m-%d', # '87-07-26'
|
||||
)
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
|
||||
NUMBER_GROUPING = 3
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -12,7 +12,7 @@ YEAR_MONTH_FORMAT = r'F \d\e Y'
|
|||
MONTH_DAY_FORMAT = r'j \d\e F'
|
||||
SHORT_DATE_FORMAT = 'd/m/Y'
|
||||
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
|
@ -31,4 +31,3 @@ DATETIME_INPUT_FORMATS = (
|
|||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = '.'
|
||||
NUMBER_GROUPING = 3
|
||||
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -12,13 +12,13 @@ YEAR_MONTH_FORMAT = r'F Y'
|
|||
MONTH_DAY_FORMAT = r'j \d\e F'
|
||||
SHORT_DATE_FORMAT = r'd/m/Y'
|
||||
SHORT_DATETIME_FORMAT = r'd/m/Y H:i'
|
||||
FIRST_DAY_OF_WEEK = 0 # 0: Sunday, 1: Monday
|
||||
FIRST_DAY_OF_WEEK = 0 # 0: Sunday, 1: Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%d/%m/%Y', # '31/12/2009'
|
||||
'%d/%m/%y', # '31/12/09'
|
||||
'%d/%m/%Y', # '31/12/2009'
|
||||
'%d/%m/%y', # '31/12/09'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d/%m/%Y %H:%M:%S',
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -24,5 +24,5 @@ DATETIME_INPUT_FORMATS = (
|
|||
'%d/%m/%y %H:%M',
|
||||
)
|
||||
DECIMAL_SEPARATOR = '.' # ',' is also official (less common): NOM-008-SCFI-2002
|
||||
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
|
||||
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
|
||||
NUMBER_GROUPING = 3
|
||||
|
|
|
@ -10,10 +10,10 @@ YEAR_MONTH_FORMAT = r'F \d\e Y'
|
|||
MONTH_DAY_FORMAT = r'j \d\e F'
|
||||
SHORT_DATE_FORMAT = 'd/m/Y'
|
||||
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday: ISO 8601
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday: ISO 8601
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
|
||||
'%Y%m%d', # '20061025'
|
||||
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
|
||||
'%Y%m%d', # '20061025'
|
||||
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
|
@ -27,4 +27,3 @@ DATETIME_INPUT_FORMATS = (
|
|||
DECIMAL_SEPARATOR = '.'
|
||||
THOUSAND_SEPARATOR = ','
|
||||
NUMBER_GROUPING = 3
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ YEAR_MONTH_FORMAT = r'F \d\e Y'
|
|||
MONTH_DAY_FORMAT = r'j \d\e F'
|
||||
SHORT_DATE_FORMAT = 'd/m/Y'
|
||||
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
|
||||
FIRST_DAY_OF_WEEK = 0 # Sunday
|
||||
FIRST_DAY_OF_WEEK = 0 # Sunday
|
||||
|
||||
DATE_INPUT_FORMATS = (
|
||||
# '31/12/2009', '31/12/09'
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -20,5 +20,5 @@ SHORT_DATE_FORMAT = 'd.m.Y'
|
|||
# TIME_INPUT_FORMATS =
|
||||
# DATETIME_INPUT_FORMATS =
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = ' ' # Non-breaking space
|
||||
THOUSAND_SEPARATOR = ' ' # Non-breaking space
|
||||
# NUMBER_GROUPING =
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -11,14 +11,32 @@ DATETIME_FORMAT = r'j. E Y \k\e\l\l\o G.i.s'
|
|||
YEAR_MONTH_FORMAT = 'F Y'
|
||||
MONTH_DAY_FORMAT = 'j. F'
|
||||
SHORT_DATE_FORMAT = 'j.n.Y'
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
SHORT_DATETIME_FORMAT = 'j.n.Y G.i'
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
# DATE_INPUT_FORMATS =
|
||||
# TIME_INPUT_FORMATS =
|
||||
# DATETIME_INPUT_FORMATS =
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%d.%m.%Y', # '20.3.2014'
|
||||
'%d.%m.%y', # '20.3.14'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d.%m.%Y %H.%M.%S', # '20.3.2014 14.30.59'
|
||||
'%d.%m.%Y %H.%M.%S.%f', # '20.3.2014 14.30.59.000200'
|
||||
'%d.%m.%Y %H.%M', # '20.3.2014 14.30'
|
||||
'%d.%m.%Y', # '20.3.2014'
|
||||
|
||||
'%d.%m.%y %H.%M.%S', # '20.3.14 14.30.59'
|
||||
'%d.%m.%y %H.%M.%S.%f', # '20.3.14 14.30.59.000200'
|
||||
'%d.%m.%y %H.%M', # '20.3.14 14.30'
|
||||
'%d.%m.%y', # '20.3.14'
|
||||
)
|
||||
TIME_INPUT_FORMATS = (
|
||||
'%H.%M.%S', # '14.30.59'
|
||||
'%H.%M.%S.%f', # '14.30.59.000200'
|
||||
'%H.%M', # '14.30'
|
||||
)
|
||||
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = ' ' # Non-breaking space
|
||||
# NUMBER_GROUPING =
|
||||
THOUSAND_SEPARATOR = '\xa0' # Non-breaking space
|
||||
NUMBER_GROUPING = 3
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -12,25 +12,25 @@ YEAR_MONTH_FORMAT = 'F Y'
|
|||
MONTH_DAY_FORMAT = 'j F'
|
||||
SHORT_DATE_FORMAT = 'j N Y'
|
||||
SHORT_DATETIME_FORMAT = 'j N Y H:i:s'
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
|
||||
'%d.%m.%Y', '%d.%m.%y', # Swiss (fr_CH), '25.10.2006', '25.10.06'
|
||||
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
|
||||
'%d.%m.%Y', '%d.%m.%y', # Swiss (fr_CH), '25.10.2006', '25.10.06'
|
||||
# '%d %B %Y', '%d %b %Y', # '25 octobre 2006', '25 oct. 2006'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
|
||||
'%d/%m/%Y %H:%M:%S.%f', # '25/10/2006 14:30:59.000200'
|
||||
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
|
||||
'%d/%m/%Y', # '25/10/2006'
|
||||
'%d.%m.%Y %H:%M:%S', # Swiss (fr_CH), '25.10.2006 14:30:59'
|
||||
'%d.%m.%Y %H:%M:%S.%f', # Swiss (fr_CH), '25.10.2006 14:30:59.000200'
|
||||
'%d.%m.%Y %H:%M', # Swiss (fr_CH), '25.10.2006 14:30'
|
||||
'%d.%m.%Y', # Swiss (fr_CH), '25.10.2006'
|
||||
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
|
||||
'%d/%m/%Y %H:%M:%S.%f', # '25/10/2006 14:30:59.000200'
|
||||
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
|
||||
'%d/%m/%Y', # '25/10/2006'
|
||||
'%d.%m.%Y %H:%M:%S', # Swiss (fr_CH), '25.10.2006 14:30:59'
|
||||
'%d.%m.%Y %H:%M:%S.%f', # Swiss (fr_CH), '25.10.2006 14:30:59.000200'
|
||||
'%d.%m.%Y %H:%M', # Swiss (fr_CH), '25.10.2006 14:30'
|
||||
'%d.%m.%Y', # Swiss (fr_CH), '25.10.2006'
|
||||
)
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
|
||||
THOUSAND_SEPARATOR = '\xa0' # non-breaking space
|
||||
NUMBER_GROUPING = 3
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue