Replace countries.json fixture by management command
I started looking at this because on the mailing list, having the UK as
only shipping country led to confusion. This is mostly due to the
shipping address form hiding the country field if there's only one
country enabled, but all the validation then requiring UK postcodes and
phone numbers.
It's bothered me for a while that we're using a fixture to populate the
countries, which is at risk of becoming stale.
pycountry offers an excellent data source for a list of countries, so I
polished an existing management command to use it to populate the
country database.
This commit has two immediate effects:
* New setups will use a more current country database
* By default, all countries will be marked as shipping countries
pycountry also ships with localised names of the countries, which should
allow us to populate the database with localised country names.
Include location helper in docs, and use it more in settings
Two people on the mailing list tripped over the location helper, so it's
now included right next to where it is used.
The helper is now also used in a few more spots in the settings.
Extend docs on application instances and customising them
Understanding the application tree these days is only necessary when
wanting to change URLs or views. Hence, it's been moved from the
customising doc and reworked into the how-to. This reduced some
considerable duplication and hopefully makes the customisation section
clearer.
The getting started guide now explicitly mentions copying the "missing
image" image when working with a remote file storage. Was raised in
issue #1314.
Several of Oscar dependencies don't support Windows, some of them don't
work at all. Added a warning that indicates installing Oscar on Windows
is a tricky process.
Remove useless entropy-increasing calls of django.conf.urls.patterns
The function essentially does two things:
1. it applies a prefix - the first argument - to the given urls. In no
instance a prefix was given
2. it calls url() for simple tuple or list elements in the given iterable.
Cases where such a tuple or list was passed to patterns have been
replaced by direct calls to url()
2 allowed for both calls to url() and simple tuples to be listed in
get_urls() and similar places. This allowed for unnecessary variation.
Always calling url() makes the url lists look less noisy and more uniform,
allowing the reader to focus on the actual differences of the urls instead
of superfluities.
django.conf.urls.patterns will also undergo deprecation starting from
Django 1.8. This commit anticipates that change.
https://docs.djangoproject.com/en/dev/releases/1.8/#django-conf-urls-patterns
Add support for i18n_patterns and enable for sandbox
This required:
* Moving Django's i18n urls into the main urls.py and outside of the
scope of Oscar's main application class, because they need to live
outside of the scope of i18n_patterns
* Add a language-code stripped version of the current URL to the
template context to get the language switcher working.
I also updated the language switcher code to mimic what is currently
given as an example in Django's docs.
Fixes #797
Moved description of what is required of MIDDLEWARE_CLASSES into a single location in the document for easier reference. It appears that BasketMiddleware is easy to miss. I missed it and someone else on the mailing list had the same error.
nose-django-querycount gives individual and total query counts. This is
helpful to double-check changes that claim to affect query count
(e.g. #1056).
Total query count gives a quick overview, and diff'ing the output for
two different branches works well.
# Last 5 commit messages
# ----------------------
# 30eead5 Remove custom user app from sandbox [Maik Hoepfel]
# ee3ee02 Drop create_migration.py helper [Maik Hoepfel]
# a77e78c Don't show country field if only one is available [David Winterbottom]
# b5790aa Handle products without a category in GA subission [David Winterbottom]
# 39e0932 Merge pull request #782 from tangentlabs/feature/add_eway_extension_to_docs [David Winterbottom]