- Remove outdated material relating to old versions of Django
- State that Oscar assumes that the email field is unique
- Update a number of links to Django documentation.
- Minor fixes to other bits of documentation.
Conflicts:
docs/source/internals/getting_started.rst
Cherry-picked from #1934, because that PR was onto releases/1.1 and I
merged it to there by accident.
django-compressor used to trigger processing of the less files during
development. But with the browser-based compiler, an easy replacement is
available. This even lowers the barrier to altering styles, because
getting npm up and running isn't required.
Offline compilation isn't impacted.
Using the most current less version seems to not cause any trouble, so I
removed the version requirement.
Update getting started documentation for Django 1.8
The TEMPLATE_DIRS and TEMPLATE_CONTEXT_PROCESSORS are no longer separate
settings thus given an example for the new TEMPLATES setting.
Also note that the user should include widget_tweaks in the
INSTALLED_APPS setting.
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.
The getting started guide now explicitly mentions copying the "missing
image" image when working with a remote file storage. Was raised in
issue #1314.
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.