Compare commits
226 Commits
main
...
stable/1.3
Author | SHA1 | Date |
---|---|---|
Tim Graham | 6726d75097 | |
Luke Plant | e982cbd4a1 | |
Tim Graham | 8892b0c2c3 | |
Luke Plant | 8dc1b2e03f | |
Tim Graham | adea5a3880 | |
John Heasly | 1989df6014 | |
Tim Graham | 7dd37edf62 | |
Carl Meyer | 956b755d7e | |
James Bennett | 304a5e0628 | |
Carl Meyer | a57743c9ff | |
Carl Meyer | a6927d8219 | |
Carl Meyer | 2378c31430 | |
James Bennett | 747d3f0d03 | |
Carl Meyer | f6f6f87a98 | |
Aymeric Augustin | d7094bbce8 | |
Carl Meyer | d3a45e10c8 | |
Carl Meyer | d19a27066b | |
Carl Meyer | 27cd872e6e | |
Florian Apolloner | 6e70f67470 | |
James Bennett | 59a3e26425 | |
Florian Apolloner | 2da4ace0bc | |
Florian Apolloner | 1515eb46da | |
Preston Holmes | 6383d2358c | |
James Bennett | 25d23d9846 | |
Preston Holmes | b45c377f8f | |
James Bennett | c718b4a036 | |
Florian Apolloner | d0d5dc6cd7 | |
James Bennett | e2ac91735f | |
James Bennett | 0b0c51a095 | |
Florian Apolloner | 4dea4883e6 | |
Florian Apolloner | b2eb4787a0 | |
Florian Apolloner | 9ca0ff6268 | |
Anssi Kääriäinen | 7ca10b1dac | |
Michael Newman | a15d3b58d8 | |
Julien Phalip | e293d82c36 | |
Aymeric Augustin | 0bbe7379ee | |
Aymeric Augustin | 15fb61c62c | |
Aymeric Augustin | 8e73302070 | |
Aymeric Augustin | fd2efb35fb | |
Aymeric Augustin | 651c0414a8 | |
Ramiro Morales | 92929d5ef4 | |
Claude Paroz | 1dd8848beb | |
Julien Phalip | 2f6b8482f6 | |
Julien Phalip | 838adb2312 | |
Claude Paroz | 2acf028b4b | |
Paul McMillan | 1f924cf72d | |
Claude Paroz | d498033818 | |
Claude Paroz | ddfa89b959 | |
Jannis Leidel | 6951879023 | |
Jannis Leidel | 523d6167d6 | |
Carl Meyer | dad3e55234 | |
Timo Graham | 41cd3b2ab1 | |
Timo Graham | c0258f1da7 | |
Timo Graham | 38715d8af8 | |
Chris Beaven | b45fbc6667 | |
Timo Graham | 0af93e108e | |
Timo Graham | 4f6c36435c | |
Aymeric Augustin | 4d959686e6 | |
Aymeric Augustin | 25b5da2abd | |
Aymeric Augustin | 7baee7a03b | |
Aymeric Augustin | 2a5a0b8097 | |
Aymeric Augustin | 1addaafa0a | |
Timo Graham | 9729ad7466 | |
Timo Graham | 5144f72be2 | |
Aymeric Augustin | 813dc01cd8 | |
Timo Graham | c63a454bb6 | |
Timo Graham | ce9916a2c8 | |
Timo Graham | f202387e6c | |
Ramiro Morales | 2646df4537 | |
Timo Graham | a7a703dbdc | |
Timo Graham | 46c08c8f95 | |
Ramiro Morales | 33f9ba7ba0 | |
Ramiro Morales | 723f995658 | |
Aymeric Augustin | 0d7431774f | |
Aymeric Augustin | 405a0ba9de | |
Jacob Kaplan-Moss | 2b793b1a35 | |
Carl Meyer | 9bc6119daf | |
Aymeric Augustin | 9e12492616 | |
Aymeric Augustin | a9789c0d44 | |
Carl Meyer | ca14105128 | |
Timo Graham | 79248a7e0a | |
Timo Graham | 7bee6b451a | |
Timo Graham | 580389c588 | |
Timo Graham | 7b9016e5a2 | |
Timo Graham | c9ab2bfb39 | |
Aymeric Augustin | b5853cf043 | |
Aymeric Augustin | 68f37a9081 | |
Timo Graham | bf5fdf1397 | |
Carl Meyer | eabbb361d2 | |
Carl Meyer | 6372368b56 | |
Carl Meyer | 07c404be88 | |
Paul McMillan | a084a07ebe | |
Paul McMillan | e3bc259081 | |
Paul McMillan | ed156a44ca | |
Paul McMillan | 4443c6fd72 | |
Paul McMillan | 35e807c4a5 | |
Paul McMillan | 2a4aa8bcf7 | |
Paul McMillan | 5978d7a341 | |
Carl Meyer | 65942eb31f | |
Simon Meers | 3606f1f7b2 | |
Simon Meers | add0628528 | |
Justin Bronn | ae51b46d19 | |
Carl Meyer | c9676d035f | |
Julien Phalip | 27c8d61280 | |
Carl Meyer | ee23919a8a | |
Carl Meyer | 70a6901775 | |
James Bennett | 2c8e45e1f4 | |
James Bennett | 460150975c | |
James Bennett | 16787c6903 | |
James Bennett | f242c02fb9 | |
James Bennett | 0326e2e611 | |
James Bennett | 2954c36ff7 | |
James Bennett | 5e451b9e6f | |
James Bennett | 722d4068a7 | |
Russell Keith-Magee | 1a76dbefdf | |
Russell Keith-Magee | fbe2eead2f | |
Russell Keith-Magee | 2f7fadc38e | |
Gabriel Hurley | afe47636f7 | |
Justin Bronn | 52279a4113 | |
Gabriel Hurley | 1f7c6c011a | |
Julien Phalip | 71836f4c76 | |
Russell Keith-Magee | 8b42dfa47e | |
Russell Keith-Magee | e2d7a784c8 | |
Russell Keith-Magee | f317bd20d7 | |
Russell Keith-Magee | 38530700bf | |
Russell Keith-Magee | 3e7d79b6ac | |
Russell Keith-Magee | e9a1c03dba | |
Russell Keith-Magee | 671483f37b | |
Julien Phalip | a7ec5c433c | |
Julien Phalip | e71d0133bd | |
Timo Graham | 6f9d250698 | |
Timo Graham | 329d80faab | |
Timo Graham | 3e5fc7ebb1 | |
Timo Graham | 199f10f9c0 | |
Timo Graham | 4217f358c0 | |
Timo Graham | fe96e20a3e | |
Timo Graham | 1959aa939d | |
Jannis Leidel | c0fa1965e2 | |
Chris Beaven | 41e086cfb5 | |
Brian Rosner | 2a1874521e | |
Ramiro Morales | a925b3780e | |
Simon Meers | 220ce42333 | |
Simon Meers | c828cc1ba6 | |
Simon Meers | 00886dfd2b | |
Jannis Leidel | 5a0787f904 | |
Justin Bronn | a441032e0e | |
Simon Meers | d8ef686e24 | |
Timo Graham | a0285bb612 | |
Jannis Leidel | d90bd88d73 | |
Jannis Leidel | 7880d99900 | |
Jannis Leidel | 25ee9b4913 | |
Jannis Leidel | eb96665b7a | |
Timo Graham | 4f215cfcd7 | |
Timo Graham | 5d71bec5e4 | |
Timo Graham | 1b51aa74b8 | |
Carl Meyer | a5b44ed873 | |
Karen Tracey | c1baaa8c87 | |
Timo Graham | f578563291 | |
Luke Plant | 0e90de0a15 | |
Timo Graham | 9f71bef7e9 | |
Timo Graham | d2abec535e | |
Luke Plant | 6e87dacf62 | |
Timo Graham | 4124ef339c | |
Jannis Leidel | 879267f254 | |
Luke Plant | 7f3eda2f76 | |
Luke Plant | afa092853f | |
Chris Beaven | 18ecfad767 | |
Timo Graham | b9bdc96f9e | |
Timo Graham | 82b9fed1c7 | |
Timo Graham | 2c3d3400ef | |
Timo Graham | 08f5ac3d51 | |
Chris Beaven | b5c6b4f1d4 | |
Chris Beaven | be776521db | |
Ramiro Morales | 770b91ca7b | |
Gabriel Hurley | d12ac6d048 | |
Gabriel Hurley | 49f4a28cce | |
Jannis Leidel | e1dfa95cd1 | |
Timo Graham | 5be8fdb03e | |
Simon Meers | 8385b31c89 | |
Simon Meers | fc39163177 | |
Chris Beaven | 9a4e5112b2 | |
Luke Plant | 5c08cda611 | |
Chris Beaven | 7fd113e618 | |
Chris Beaven | 4cb2b53c22 | |
Luke Plant | fda65ffea5 | |
Simon Meers | af1943f139 | |
Luke Plant | fb052a15ed | |
Luke Plant | b3a4613595 | |
Chris Beaven | d06531d3f0 | |
Timo Graham | 64e625b6a1 | |
Timo Graham | 53354f80f6 | |
Timo Graham | fa261ea432 | |
Jannis Leidel | b44757ce51 | |
Timo Graham | c05dd20fa5 | |
Ramiro Morales | 0e9e0f0b21 | |
Simon Meers | 5aeeafba26 | |
Simon Meers | 637cf5de3a | |
Timo Graham | 44dbac6482 | |
Timo Graham | f53fe1e79e | |
Carl Meyer | 6a3d91828f | |
Chris Beaven | fe2713dd5e | |
Chris Beaven | 9269b606ba | |
Jannis Leidel | 5977193c01 | |
Jannis Leidel | e87c9da437 | |
Jannis Leidel | 4d62386cad | |
Ian Kelly | 53678ef508 | |
Gabriel Hurley | 64995cdd63 | |
Gabriel Hurley | 24adaf76f1 | |
Gabriel Hurley | b061cb97be | |
Ramiro Morales | 1d499d50d0 | |
Jacob Kaplan-Moss | 9b21a0c921 | |
Karen Tracey | cdd75e078a | |
Ian Kelly | 79bb9c1456 | |
Simon Meers | 05054aba76 | |
Russell Keith-Magee | e5aa2bdcec | |
Russell Keith-Magee | 686ef6c759 | |
Jannis Leidel | e6fe336f10 | |
Jannis Leidel | 6bf0fe6c4e | |
Justin Bronn | e37fae7fb9 | |
Justin Bronn | 032beb11da | |
Timo Graham | d935b232a2 | |
Luke Plant | ce9b216882 | |
Timo Graham | 9b0f1de566 | |
Ramiro Morales | 258957f4b9 | |
Simon Meers | d0052fcc5c | |
James Bennett | 81f7a6587f |
|
@ -1,47 +0,0 @@
|
|||
# https://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
|
||||
# Docstrings and comments use max_line_length = 79
|
||||
[*.py]
|
||||
max_line_length = 88
|
||||
|
||||
# Use 2 spaces for the HTML files
|
||||
[*.html]
|
||||
indent_size = 2
|
||||
|
||||
# The JSON files contain newlines inconsistently
|
||||
[*.json]
|
||||
indent_size = 2
|
||||
insert_final_newline = ignore
|
||||
|
||||
[**/admin/js/vendor/**]
|
||||
indent_style = ignore
|
||||
indent_size = ignore
|
||||
|
||||
# Minified JavaScript files shouldn't be changed
|
||||
[**.min.js]
|
||||
indent_style = ignore
|
||||
insert_final_newline = ignore
|
||||
|
||||
# Makefiles always use tabs for indentation
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
|
||||
# Batch files use tabs for indentation
|
||||
[*.bat]
|
||||
indent_style = tab
|
||||
|
||||
[docs/**.txt]
|
||||
max_line_length = 79
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
|
@ -1,6 +0,0 @@
|
|||
**/*.min.js
|
||||
**/vendor/**/*.js
|
||||
django/contrib/gis/templates/**/*.js
|
||||
docs/_build/**/*.js
|
||||
node_modules/**.js
|
||||
tests/**/*.js
|
37
.eslintrc
37
.eslintrc
|
@ -1,37 +0,0 @@
|
|||
{
|
||||
"rules": {
|
||||
"camelcase": ["off", {"properties": "always"}],
|
||||
"comma-spacing": ["error", {"before": false, "after": true}],
|
||||
"curly": ["error", "all"],
|
||||
"dot-notation": ["error", {"allowKeywords": true}],
|
||||
"eqeqeq": ["error"],
|
||||
"indent": ["error", 4],
|
||||
"key-spacing": ["error", {"beforeColon": false, "afterColon": true}],
|
||||
"linebreak-style": ["error", "unix"],
|
||||
"new-cap": ["off", {"newIsCap": true, "capIsNew": true}],
|
||||
"no-alert": ["off"],
|
||||
"no-eval": ["error"],
|
||||
"no-extend-native": ["error", {"exceptions": ["Date", "String"]}],
|
||||
"no-multi-spaces": ["error"],
|
||||
"no-octal-escape": ["error"],
|
||||
"no-script-url": ["error"],
|
||||
"no-shadow": ["error", {"hoist": "functions"}],
|
||||
"no-underscore-dangle": ["error"],
|
||||
"no-unused-vars": ["error", {"vars": "local", "args": "none"}],
|
||||
"no-var": ["error"],
|
||||
"prefer-const": ["error"],
|
||||
"quotes": ["off", "single"],
|
||||
"semi": ["error", "always"],
|
||||
"space-before-blocks": ["error", "always"],
|
||||
"space-before-function-paren": ["error", {"anonymous": "never", "named": "never"}],
|
||||
"space-infix-ops": ["error", {"int32Hint": false}],
|
||||
"strict": ["error", "global"]
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"globals": {
|
||||
"django": false
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
ca88caa1031c0de545d82de8d90dcae0e03651fb
|
||||
c5cd8783825b5f6384417dac5f3889b4210b7d08
|
||||
9c19aff7c7561e3a82978a272ecdaad40dda5c00
|
||||
7119f40c9881666b6f9b5cf7df09ee1d21cc8344
|
||||
c18861804feb6a97afbeabb51be748dd60a04458
|
|
@ -1,7 +0,0 @@
|
|||
# Normalize line endings to avoid spurious failures in the core test suite on Windows.
|
||||
*html text eol=lf
|
||||
*css text eol=lf
|
||||
*js text eol=lf
|
||||
tests/staticfiles_tests/apps/test/static/test/*txt text eol=lf
|
||||
tests/staticfiles_tests/project/documents/test/*txt text eol=lf
|
||||
docs/releases/*.txt merge=union
|
|
@ -1,3 +0,0 @@
|
|||
# Django Code of Conduct
|
||||
|
||||
See https://www.djangoproject.com/conduct/.
|
|
@ -1,2 +0,0 @@
|
|||
custom: https://www.djangoproject.com/fundraising/
|
||||
github: [django]
|
|
@ -1,3 +0,0 @@
|
|||
# Django Security Policies
|
||||
|
||||
Please see https://www.djangoproject.com/security/.
|
|
@ -1,41 +0,0 @@
|
|||
name: Benchmark
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [ labeled, synchronize, opened, reopened ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
Run_benchmarks:
|
||||
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Benchmark Repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: django/django-asv
|
||||
path: "."
|
||||
- name: Install Requirements
|
||||
run: pip install -r requirements.txt
|
||||
- name: Cache Django
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: Django/*
|
||||
key: Django
|
||||
- name: Run Benchmarks
|
||||
shell: bash -l {0}
|
||||
run: |-
|
||||
asv machine --machine ubuntu-latest --yes > /dev/null
|
||||
echo 'Beginning benchmarks...'
|
||||
asv continuous --interleave-processes -a processes=2 --split --show-stderr 'HEAD^' 'HEAD' |\
|
||||
sed -n -E '/(before.*after.*ratio)|(BENCHMARKS)/,$p' >> out.txt
|
||||
echo 'Benchmarks Done.'
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
cat out.txt >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
if grep -q "PERFORMANCE DECREASED" out.txt;
|
||||
then
|
||||
exit 1
|
||||
fi
|
|
@ -1,40 +0,0 @@
|
|||
name: Docs
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- '.github/workflows/docs.yml'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- '.github/workflows/docs.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
# OS must be the same as on djangoproject.com.
|
||||
runs-on: ubuntu-20.04
|
||||
name: docs
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
cache: 'pip'
|
||||
cache-dependency-path: 'docs/requirements.txt'
|
||||
- run: python -m pip install -r docs/requirements.txt
|
||||
- name: Build docs
|
||||
run: |
|
||||
cd docs
|
||||
sphinx-build -b spelling -n -q -W --keep-going -d _build/doctrees -D language=en_US -j auto . _build/spelling
|
|
@ -1,62 +0,0 @@
|
|||
name: Linters
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
flake8:
|
||||
name: flake8
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- run: python -m pip install flake8
|
||||
- name: flake8
|
||||
# Pinned to v1.0.1.
|
||||
uses: liskin/gh-problem-matcher-wrap@d9e345a28ab1eeb00c349e8bb199a102aa58acba
|
||||
with:
|
||||
linters: flake8
|
||||
run: flake8
|
||||
|
||||
isort:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- run: python -m pip install isort
|
||||
- name: isort
|
||||
# Pinned to v1.0.1.
|
||||
uses: liskin/gh-problem-matcher-wrap@d9e345a28ab1eeb00c349e8bb199a102aa58acba
|
||||
with:
|
||||
linters: isort
|
||||
run: isort --check --diff django tests scripts
|
||||
|
||||
black:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: black
|
||||
uses: psf/black@stable
|
|
@ -1,27 +0,0 @@
|
|||
name: New contributor message
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Hello new contributor
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
pr-message: |
|
||||
Hello! Thank you for your contribution 💪
|
||||
|
||||
As it's your first contribution be sure to check out the [patch review checklist](https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#patch-review-checklist).
|
||||
|
||||
If you're fixing a ticket [from Trac](https://code.djangoproject.com/) make sure to set the _"Has patch"_ flag and include a link to this PR in the ticket!
|
||||
|
||||
If you have any design or process questions then you can ask in the [Django forum](https://forum.djangoproject.com/c/internals/5).
|
||||
|
||||
Welcome aboard ⛵️!
|
|
@ -1,53 +0,0 @@
|
|||
name: Schedule tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version:
|
||||
- '3.8'
|
||||
- '3.9'
|
||||
- '3.10'
|
||||
- '3.11-dev'
|
||||
name: Windows, SQLite, Python ${{ matrix.python-version }}
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip'
|
||||
cache-dependency-path: 'tests/requirements/py3.txt'
|
||||
- name: Install and upgrade packaging tools
|
||||
run: python -m pip install --upgrade pip setuptools wheel
|
||||
- run: python -m pip install -r tests/requirements/py3.txt -e .
|
||||
- name: Run tests
|
||||
run: python tests/runtests.py -v2
|
||||
|
||||
javascript-tests:
|
||||
runs-on: ubuntu-latest
|
||||
name: JavaScript tests
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '14'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package.json'
|
||||
- run: npm install
|
||||
- run: npm test
|
|
@ -1,46 +0,0 @@
|
|||
name: Schedule
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '42 2 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
trigger-runs:
|
||||
runs-on: ubuntu-latest
|
||||
environment: schedules
|
||||
name: Trigger Full Build
|
||||
# Only trigger on the main Django repository
|
||||
if: (github.event_name == 'schedule' && github.repository == 'django/django') || (github.event_name != 'schedule')
|
||||
strategy:
|
||||
matrix:
|
||||
branch:
|
||||
- main
|
||||
steps:
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{secrets.SCHEDULE_WORKFLOW_TOKEN}}
|
||||
script: |
|
||||
const yesterday = new Date(new Date() - (1000 * 3600 * 24)).toISOString();
|
||||
const { data: commits } = await github.rest.repos.listCommits({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
sha: '${{ matrix.branch }}',
|
||||
since: yesterday,
|
||||
per_page: 1
|
||||
});
|
||||
if (commits.length) {
|
||||
console.log(`Found new commit with SHA ${commits[0].sha} on branch ${{ matrix.branch }}`)
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: '.github/workflows/schedule_tests.yml',
|
||||
ref: '${{ matrix.branch }}',
|
||||
})
|
||||
} else {
|
||||
console.log(`No commits found since ${yesterday} on brach ${{ matrix.branch }}`)
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
name: Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version:
|
||||
- '3.10'
|
||||
name: Windows, SQLite, Python ${{ matrix.python-version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip'
|
||||
cache-dependency-path: 'tests/requirements/py3.txt'
|
||||
- name: Install and upgrade packaging tools
|
||||
run: python -m pip install --upgrade pip setuptools wheel
|
||||
- run: python -m pip install -r tests/requirements/py3.txt -e .
|
||||
- name: Run tests
|
||||
run: python tests/runtests.py -v2
|
||||
|
||||
javascript-tests:
|
||||
runs-on: ubuntu-latest
|
||||
name: JavaScript tests
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '14'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package.json'
|
||||
- run: npm install
|
||||
- run: npm test
|
|
@ -1,18 +1,4 @@
|
|||
# If you need to exclude files such as those generated by an IDE, use
|
||||
# $GIT_DIR/info/exclude or the core.excludesFile configuration variable as
|
||||
# described in https://git-scm.com/docs/gitignore
|
||||
|
||||
*.egg-info
|
||||
*.pot
|
||||
*.py[co]
|
||||
.tox/
|
||||
__pycache__
|
||||
MANIFEST
|
||||
dist/
|
||||
docs/_build/
|
||||
docs/locale/
|
||||
node_modules/
|
||||
tests/coverage_html/
|
||||
tests/.coverage
|
||||
build/
|
||||
tests/report/
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.10.0
|
||||
hooks:
|
||||
- id: black
|
||||
exclude: \.py-tpl$
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.10.1
|
||||
hooks:
|
||||
- id: isort
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 5.0.4
|
||||
hooks:
|
||||
- id: flake8
|
||||
- repo: https://github.com/pre-commit/mirrors-eslint
|
||||
rev: v8.24.0
|
||||
hooks:
|
||||
- id: eslint
|
|
@ -1,18 +0,0 @@
|
|||
# Configuration for the Read The Docs (RTD) builds of the documentation.
|
||||
# Ref: https://docs.readthedocs.io/en/stable/config-file/v2.html
|
||||
# The python.install.requirements pins the version of Sphinx used.
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: ubuntu-20.04
|
||||
tools:
|
||||
python: "3.8"
|
||||
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
|
||||
formats: all
|
24
.tx/config
24
.tx/config
|
@ -1,6 +1,5 @@
|
|||
[main]
|
||||
host = https://www.transifex.com
|
||||
lang_map = sr@latin:sr_Latn, zh_CN:zh_Hans, zh_TW:zh_Hant
|
||||
host = https://www.transifex.net
|
||||
|
||||
[django.core]
|
||||
file_filter = django/conf/locale/<lang>/LC_MESSAGES/django.po
|
||||
|
@ -27,6 +26,11 @@ file_filter = django/contrib/auth/locale/<lang>/LC_MESSAGES/django.po
|
|||
source_file = django/contrib/auth/locale/en/LC_MESSAGES/django.po
|
||||
source_lang = en
|
||||
|
||||
[django.contrib-comments]
|
||||
file_filter = django/contrib/comments/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = django/contrib/comments/locale/en/LC_MESSAGES/django.po
|
||||
source_lang = en
|
||||
|
||||
[django.contrib-contenttypes]
|
||||
file_filter = django/contrib/contenttypes/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = django/contrib/contenttypes/locale/en/LC_MESSAGES/django.po
|
||||
|
@ -37,6 +41,11 @@ file_filter = django/contrib/flatpages/locale/<lang>/LC_MESSAGES/django.po
|
|||
source_file = django/contrib/flatpages/locale/en/LC_MESSAGES/django.po
|
||||
source_lang = en
|
||||
|
||||
[django.contrib-formtools]
|
||||
file_filter = django/contrib/formtools/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = django/contrib/formtools/locale/en/LC_MESSAGES/django.po
|
||||
source_lang = en
|
||||
|
||||
[django.contrib-gis]
|
||||
file_filter = django/contrib/gis/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = django/contrib/gis/locale/en/LC_MESSAGES/django.po
|
||||
|
@ -47,9 +56,14 @@ file_filter = django/contrib/humanize/locale/<lang>/LC_MESSAGES/django.po
|
|||
source_file = django/contrib/humanize/locale/en/LC_MESSAGES/django.po
|
||||
source_lang = en
|
||||
|
||||
[django.contrib-postgres]
|
||||
file_filter = django/contrib/postgres/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = django/contrib/postgres/locale/en/LC_MESSAGES/django.po
|
||||
[django.contrib-localflavor]
|
||||
file_filter = django/contrib/localflavor/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = django/contrib/localflavor/locale/en/LC_MESSAGES/django.po
|
||||
source_lang = en
|
||||
|
||||
[django.contrib-messages]
|
||||
file_filter = django/contrib/messages/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = django/contrib/messages/locale/en/LC_MESSAGES/django.po
|
||||
source_lang = en
|
||||
|
||||
[django.contrib-redirects]
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
======================
|
||||
Contributing to Django
|
||||
======================
|
||||
|
||||
As an open source project, Django welcomes contributions of many forms.
|
||||
|
||||
Examples of contributions include:
|
||||
|
||||
* Code patches
|
||||
* Documentation improvements
|
||||
* Bug reports and patch reviews
|
||||
|
||||
Extensive contribution guidelines are available in the repository at
|
||||
``docs/internals/contributing/``, or online at:
|
||||
|
||||
https://docs.djangoproject.com/en/dev/internals/contributing/
|
||||
|
||||
**Warning: non-trivial pull requests (anything more than fixing a typo) without
|
||||
Trac tickets will be closed!** `Please file a ticket`__ to suggest changes.
|
||||
|
||||
__ https://code.djangoproject.com/newticket
|
||||
|
||||
Django uses Trac to keep track of bugs, feature requests, and associated
|
||||
patches because GitHub doesn't provide adequate tooling for its community.
|
||||
Patches can be submitted as pull requests, but if you don't file a ticket,
|
||||
it's unlikely that we'll notice your contribution.
|
||||
|
||||
Code of Conduct
|
||||
===============
|
||||
|
||||
As a contributor, you can help us keep the Django community open and inclusive.
|
||||
Please read and follow our `Code of Conduct <https://www.djangoproject.com/conduct/>`_.
|
15
Gruntfile.js
15
Gruntfile.js
|
@ -1,15 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
const globalThreshold = 50; // Global code coverage threshold (as a percentage)
|
||||
|
||||
module.exports = function(grunt) {
|
||||
grunt.initConfig({
|
||||
qunit: {
|
||||
all: ['js_tests/tests.html']
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-qunit');
|
||||
grunt.registerTask('test', ['qunit']);
|
||||
grunt.registerTask('default', ['test']);
|
||||
};
|
12
INSTALL
12
INSTALL
|
@ -1,8 +1,16 @@
|
|||
Thanks for downloading Django.
|
||||
|
||||
To install it, make sure you have Python 3.8 or greater installed. Then run
|
||||
To install it, make sure you have Python 2.4 or greater installed. Then run
|
||||
this command from the command prompt:
|
||||
|
||||
python -m pip install .
|
||||
python setup.py install
|
||||
|
||||
AS AN ALTERNATIVE, you can just copy the entire "django" directory to Python's
|
||||
site-packages directory, which is located wherever your Python installation
|
||||
lives. Some places you might check are:
|
||||
|
||||
/usr/lib/python2.5/site-packages (Unix, Python 2.5)
|
||||
/usr/lib/python2.4/site-packages (Unix, Python 2.4)
|
||||
C:\\PYTHON\site-packages (Windows)
|
||||
|
||||
For more detailed instructions, see docs/intro/install.txt.
|
||||
|
|
6
LICENSE
6
LICENSE
|
@ -4,10 +4,10 @@ All rights reserved.
|
|||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
|
|
290
LICENSE.python
290
LICENSE.python
|
@ -1,290 +0,0 @@
|
|||
Django is licensed under the three-clause BSD license; see the file
|
||||
LICENSE for details.
|
||||
|
||||
Django includes code from the Python standard library, which is licensed under
|
||||
the Python license, a permissive open source license. The copyright and license
|
||||
is included below for compliance with Python's terms.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2001-present Python Software Foundation; All Rights Reserved
|
||||
|
||||
A. HISTORY OF THE SOFTWARE
|
||||
==========================
|
||||
|
||||
Python was created in the early 1990s by Guido van Rossum at Stichting
|
||||
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
|
||||
as a successor of a language called ABC. Guido remains Python's
|
||||
principal author, although it includes many contributions from others.
|
||||
|
||||
In 1995, Guido continued his work on Python at the Corporation for
|
||||
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
|
||||
in Reston, Virginia where he released several versions of the
|
||||
software.
|
||||
|
||||
In May 2000, Guido and the Python core development team moved to
|
||||
BeOpen.com to form the BeOpen PythonLabs team. In October of the same
|
||||
year, the PythonLabs team moved to Digital Creations, which became
|
||||
Zope Corporation. In 2001, the Python Software Foundation (PSF, see
|
||||
https://www.python.org/psf/) was formed, a non-profit organization
|
||||
created specifically to own Python-related Intellectual Property.
|
||||
Zope Corporation was a sponsoring member of the PSF.
|
||||
|
||||
All Python releases are Open Source (see http://www.opensource.org for
|
||||
the Open Source Definition). Historically, most, but not all, Python
|
||||
releases have also been GPL-compatible; the table below summarizes
|
||||
the various releases.
|
||||
|
||||
Release Derived Year Owner GPL-
|
||||
from compatible? (1)
|
||||
|
||||
0.9.0 thru 1.2 1991-1995 CWI yes
|
||||
1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
|
||||
1.6 1.5.2 2000 CNRI no
|
||||
2.0 1.6 2000 BeOpen.com no
|
||||
1.6.1 1.6 2001 CNRI yes (2)
|
||||
2.1 2.0+1.6.1 2001 PSF no
|
||||
2.0.1 2.0+1.6.1 2001 PSF yes
|
||||
2.1.1 2.1+2.0.1 2001 PSF yes
|
||||
2.1.2 2.1.1 2002 PSF yes
|
||||
2.1.3 2.1.2 2002 PSF yes
|
||||
2.2 and above 2.1.1 2001-now PSF yes
|
||||
|
||||
Footnotes:
|
||||
|
||||
(1) GPL-compatible doesn't mean that we're distributing Python under
|
||||
the GPL. All Python licenses, unlike the GPL, let you distribute
|
||||
a modified version without making your changes open source. The
|
||||
GPL-compatible licenses make it possible to combine Python with
|
||||
other software that is released under the GPL; the others don't.
|
||||
|
||||
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
|
||||
because its license has a choice of law clause. According to
|
||||
CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
|
||||
is "not incompatible" with the GPL.
|
||||
|
||||
Thanks to the many outside volunteers who have worked under Guido's
|
||||
direction to make these releases possible.
|
||||
|
||||
|
||||
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
|
||||
===============================================================
|
||||
|
||||
Python software and documentation are licensed under the
|
||||
Python Software Foundation License Version 2.
|
||||
|
||||
Starting with Python 3.8.6, examples, recipes, and other code in
|
||||
the documentation are dual licensed under the PSF License Version 2
|
||||
and the Zero-Clause BSD license.
|
||||
|
||||
Some software incorporated into Python is under different licenses.
|
||||
The licenses are listed with code falling under that license.
|
||||
|
||||
|
||||
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
|
||||
--------------------------------------------
|
||||
|
||||
1. This LICENSE AGREEMENT is between the Python Software Foundation
|
||||
("PSF"), and the Individual or Organization ("Licensee") accessing and
|
||||
otherwise using this software ("Python") in source or binary form and
|
||||
its associated documentation.
|
||||
|
||||
2. Subject to the terms and conditions of this License Agreement, PSF hereby
|
||||
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
|
||||
analyze, test, perform and/or display publicly, prepare derivative works,
|
||||
distribute, and otherwise use Python alone or in any derivative version,
|
||||
provided, however, that PSF's License Agreement and PSF's notice of copyright,
|
||||
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Python Software Foundation;
|
||||
All Rights Reserved" are retained in Python alone or in any derivative version
|
||||
prepared by Licensee.
|
||||
|
||||
3. In the event Licensee prepares a derivative work that is based on
|
||||
or incorporates Python or any part thereof, and wants to make
|
||||
the derivative work available to others as provided herein, then
|
||||
Licensee hereby agrees to include in any such work a brief summary of
|
||||
the changes made to Python.
|
||||
|
||||
4. PSF is making Python available to Licensee on an "AS IS"
|
||||
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
|
||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
|
||||
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
|
||||
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
|
||||
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||
|
||||
6. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
7. Nothing in this License Agreement shall be deemed to create any
|
||||
relationship of agency, partnership, or joint venture between PSF and
|
||||
Licensee. This License Agreement does not grant permission to use PSF
|
||||
trademarks or trade name in a trademark sense to endorse or promote
|
||||
products or services of Licensee, or any third party.
|
||||
|
||||
8. By copying, installing or otherwise using Python, Licensee
|
||||
agrees to be bound by the terms and conditions of this License
|
||||
Agreement.
|
||||
|
||||
|
||||
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
|
||||
-------------------------------------------
|
||||
|
||||
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
|
||||
|
||||
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
|
||||
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
|
||||
Individual or Organization ("Licensee") accessing and otherwise using
|
||||
this software in source or binary form and its associated
|
||||
documentation ("the Software").
|
||||
|
||||
2. Subject to the terms and conditions of this BeOpen Python License
|
||||
Agreement, BeOpen hereby grants Licensee a non-exclusive,
|
||||
royalty-free, world-wide license to reproduce, analyze, test, perform
|
||||
and/or display publicly, prepare derivative works, distribute, and
|
||||
otherwise use the Software alone or in any derivative version,
|
||||
provided, however, that the BeOpen Python License is retained in the
|
||||
Software, alone or in any derivative version prepared by Licensee.
|
||||
|
||||
3. BeOpen is making the Software available to Licensee on an "AS IS"
|
||||
basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
|
||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
|
||||
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
|
||||
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
|
||||
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||
|
||||
5. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
6. This License Agreement shall be governed by and interpreted in all
|
||||
respects by the law of the State of California, excluding conflict of
|
||||
law provisions. Nothing in this License Agreement shall be deemed to
|
||||
create any relationship of agency, partnership, or joint venture
|
||||
between BeOpen and Licensee. This License Agreement does not grant
|
||||
permission to use BeOpen trademarks or trade names in a trademark
|
||||
sense to endorse or promote products or services of Licensee, or any
|
||||
third party. As an exception, the "BeOpen Python" logos available at
|
||||
http://www.pythonlabs.com/logos.html may be used according to the
|
||||
permissions granted on that web page.
|
||||
|
||||
7. By copying, installing or otherwise using the software, Licensee
|
||||
agrees to be bound by the terms and conditions of this License
|
||||
Agreement.
|
||||
|
||||
|
||||
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
|
||||
---------------------------------------
|
||||
|
||||
1. This LICENSE AGREEMENT is between the Corporation for National
|
||||
Research Initiatives, having an office at 1895 Preston White Drive,
|
||||
Reston, VA 20191 ("CNRI"), and the Individual or Organization
|
||||
("Licensee") accessing and otherwise using Python 1.6.1 software in
|
||||
source or binary form and its associated documentation.
|
||||
|
||||
2. Subject to the terms and conditions of this License Agreement, CNRI
|
||||
hereby grants Licensee a nonexclusive, royalty-free, world-wide
|
||||
license to reproduce, analyze, test, perform and/or display publicly,
|
||||
prepare derivative works, distribute, and otherwise use Python 1.6.1
|
||||
alone or in any derivative version, provided, however, that CNRI's
|
||||
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
|
||||
1995-2001 Corporation for National Research Initiatives; All Rights
|
||||
Reserved" are retained in Python 1.6.1 alone or in any derivative
|
||||
version prepared by Licensee. Alternately, in lieu of CNRI's License
|
||||
Agreement, Licensee may substitute the following text (omitting the
|
||||
quotes): "Python 1.6.1 is made available subject to the terms and
|
||||
conditions in CNRI's License Agreement. This Agreement together with
|
||||
Python 1.6.1 may be located on the internet using the following
|
||||
unique, persistent identifier (known as a handle): 1895.22/1013. This
|
||||
Agreement may also be obtained from a proxy server on the internet
|
||||
using the following URL: http://hdl.handle.net/1895.22/1013".
|
||||
|
||||
3. In the event Licensee prepares a derivative work that is based on
|
||||
or incorporates Python 1.6.1 or any part thereof, and wants to make
|
||||
the derivative work available to others as provided herein, then
|
||||
Licensee hereby agrees to include in any such work a brief summary of
|
||||
the changes made to Python 1.6.1.
|
||||
|
||||
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
|
||||
basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
|
||||
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
|
||||
INFRINGE ANY THIRD PARTY RIGHTS.
|
||||
|
||||
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
|
||||
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
|
||||
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
|
||||
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
|
||||
|
||||
6. This License Agreement will automatically terminate upon a material
|
||||
breach of its terms and conditions.
|
||||
|
||||
7. This License Agreement shall be governed by the federal
|
||||
intellectual property law of the United States, including without
|
||||
limitation the federal copyright law, and, to the extent such
|
||||
U.S. federal law does not apply, by the law of the Commonwealth of
|
||||
Virginia, excluding Virginia's conflict of law provisions.
|
||||
Notwithstanding the foregoing, with regard to derivative works based
|
||||
on Python 1.6.1 that incorporate non-separable material that was
|
||||
previously distributed under the GNU General Public License (GPL), the
|
||||
law of the Commonwealth of Virginia shall govern this License
|
||||
Agreement only as to issues arising under or with respect to
|
||||
Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
|
||||
License Agreement shall be deemed to create any relationship of
|
||||
agency, partnership, or joint venture between CNRI and Licensee. This
|
||||
License Agreement does not grant permission to use CNRI trademarks or
|
||||
trade name in a trademark sense to endorse or promote products or
|
||||
services of Licensee, or any third party.
|
||||
|
||||
8. By clicking on the "ACCEPT" button where indicated, or by copying,
|
||||
installing or otherwise using Python 1.6.1, Licensee agrees to be
|
||||
bound by the terms and conditions of this License Agreement.
|
||||
|
||||
ACCEPT
|
||||
|
||||
|
||||
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
|
||||
--------------------------------------------------
|
||||
|
||||
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
|
||||
The Netherlands. All rights reserved.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of Stichting Mathematisch
|
||||
Centrum or CWI not be used in advertising or publicity pertaining to
|
||||
distribution of the software without specific, written prior
|
||||
permission.
|
||||
|
||||
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
|
||||
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
|
||||
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
42
MANIFEST.in
42
MANIFEST.in
|
@ -1,16 +1,34 @@
|
|||
include README
|
||||
include AUTHORS
|
||||
include Gruntfile.js
|
||||
include INSTALL
|
||||
include LICENSE
|
||||
include LICENSE.python
|
||||
include MANIFEST.in
|
||||
include package.json
|
||||
include *.rst
|
||||
graft django
|
||||
graft docs
|
||||
graft extras
|
||||
graft js_tests
|
||||
graft scripts
|
||||
graft tests
|
||||
global-exclude __pycache__
|
||||
global-exclude *.py[co]
|
||||
include django/contrib/gis/gdal/LICENSE
|
||||
include django/contrib/gis/geos/LICENSE
|
||||
include django/dispatch/license.txt
|
||||
include django/utils/simplejson/LICENSE.txt
|
||||
recursive-include docs *
|
||||
recursive-include scripts *
|
||||
recursive-include extras *
|
||||
recursive-include tests *
|
||||
recursive-include django/conf/locale *
|
||||
recursive-include django/contrib/*/locale *
|
||||
recursive-include django/contrib/admin/templates *
|
||||
recursive-include django/contrib/admin/media *
|
||||
recursive-include django/contrib/admindocs/templates *
|
||||
recursive-include django/contrib/auth/fixtures *
|
||||
recursive-include django/contrib/auth/tests/templates *
|
||||
recursive-include django/contrib/comments/templates *
|
||||
recursive-include django/contrib/databrowse/templates *
|
||||
recursive-include django/contrib/formtools/templates *
|
||||
recursive-include django/contrib/formtools/tests/templates *
|
||||
recursive-include django/contrib/flatpages/fixtures *
|
||||
recursive-include django/contrib/flatpages/tests/templates *
|
||||
recursive-include django/contrib/gis/templates *
|
||||
recursive-include django/contrib/gis/tests/data *
|
||||
recursive-include django/contrib/gis/tests/distapp/fixtures *
|
||||
recursive-include django/contrib/gis/tests/geoapp/fixtures *
|
||||
recursive-include django/contrib/gis/tests/geogapp/fixtures *
|
||||
recursive-include django/contrib/gis/tests/relatedapp/fixtures *
|
||||
recursive-include django/contrib/sitemaps/templates *
|
||||
recursive-include django/contrib/sitemaps/tests/templates *
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
Django is a high-level Python Web framework that encourages rapid development
|
||||
and clean, pragmatic design.
|
||||
|
||||
All documentation is in the "docs" directory and online at
|
||||
http://docs.djangoproject.com/en/dev/. If you're just getting started, here's
|
||||
how we recommend you read the docs:
|
||||
|
||||
* First, read docs/intro/install.txt for instructions on installing Django.
|
||||
|
||||
* Next, work through the tutorials in order (docs/intro/tutorial01.txt,
|
||||
docs/intro/tutorial02.txt, etc.).
|
||||
|
||||
* If you want to set up an actual deployment server, read
|
||||
docs/howto/deployment/index.txt for instructions.
|
||||
|
||||
* You'll probably want to read through the topical guides (in docs/topics)
|
||||
next; from there you can jump to the HOWTOs (in docs/howto) for specific
|
||||
problems, and check out the reference (docs/ref) for gory details.
|
||||
|
||||
* See docs/README for instructions on building an HTML version of the docs.
|
||||
|
||||
Docs are updated rigorously. If you find any problems in the docs, or think they
|
||||
should be clarified in any way, please take 30 seconds to fill out a ticket
|
||||
here:
|
||||
|
||||
http://code.djangoproject.com/newticket
|
||||
|
||||
To get more help:
|
||||
|
||||
* Join the #django channel on irc.freenode.net. Lots of helpful people
|
||||
hang out there. Read the archives at http://django-irc-logs.com/.
|
||||
|
||||
* Join the django-users mailing list, or read the archives, at
|
||||
http://groups.google.com/group/django-users.
|
||||
|
||||
To contribute to Django:
|
||||
|
||||
* Check out http://www.djangoproject.com/community/ for information
|
||||
about getting involved.
|
||||
|
||||
To run Django's test suite:
|
||||
|
||||
* Follow the instructions in the "Unit tests" section of
|
||||
docs/internals/contributing.txt, published online at
|
||||
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-the-unit-tests
|
||||
|
54
README.rst
54
README.rst
|
@ -1,54 +0,0 @@
|
|||
======
|
||||
Django
|
||||
======
|
||||
|
||||
Django is a high-level Python web framework that encourages rapid development
|
||||
and clean, pragmatic design. Thanks for checking it out.
|
||||
|
||||
All documentation is in the "``docs``" directory and online at
|
||||
https://docs.djangoproject.com/en/stable/. If you're just getting started,
|
||||
here's how we recommend you read the docs:
|
||||
|
||||
* First, read ``docs/intro/install.txt`` for instructions on installing Django.
|
||||
|
||||
* Next, work through the tutorials in order (``docs/intro/tutorial01.txt``,
|
||||
``docs/intro/tutorial02.txt``, etc.).
|
||||
|
||||
* If you want to set up an actual deployment server, read
|
||||
``docs/howto/deployment/index.txt`` for instructions.
|
||||
|
||||
* You'll probably want to read through the topical guides (in ``docs/topics``)
|
||||
next; from there you can jump to the HOWTOs (in ``docs/howto``) for specific
|
||||
problems, and check out the reference (``docs/ref``) for gory details.
|
||||
|
||||
* See ``docs/README`` for instructions on building an HTML version of the docs.
|
||||
|
||||
Docs are updated rigorously. If you find any problems in the docs, or think
|
||||
they should be clarified in any way, please take 30 seconds to fill out a
|
||||
ticket here: https://code.djangoproject.com/newticket
|
||||
|
||||
To get more help:
|
||||
|
||||
* Join the ``#django`` channel on ``irc.libera.chat``. Lots of helpful people
|
||||
hang out there. See https://web.libera.chat if you're new to IRC.
|
||||
|
||||
* Join the django-users mailing list, or read the archives, at
|
||||
https://groups.google.com/group/django-users.
|
||||
|
||||
To contribute to Django:
|
||||
|
||||
* Check out https://docs.djangoproject.com/en/dev/internals/contributing/ for
|
||||
information about getting involved.
|
||||
|
||||
To run Django's test suite:
|
||||
|
||||
* Follow the instructions in the "Unit tests" section of
|
||||
``docs/internals/contributing/writing-code/unit-tests.txt``, published online at
|
||||
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-the-unit-tests
|
||||
|
||||
Supporting the Development of Django
|
||||
====================================
|
||||
|
||||
Django's development depends on your contributions.
|
||||
|
||||
If you depend on Django, remember to support the Django Software Foundation: https://www.djangoproject.com/fundraising/
|
|
@ -1,24 +1,16 @@
|
|||
from django.utils.version import get_version
|
||||
VERSION = (1, 3, 8, 'alpha', 0)
|
||||
|
||||
VERSION = (4, 2, 0, "alpha", 0)
|
||||
|
||||
__version__ = get_version(VERSION)
|
||||
|
||||
|
||||
def setup(set_prefix=True):
|
||||
"""
|
||||
Configure the settings (this happens as a side effect of accessing the
|
||||
first setting), configure logging and populate the app registry.
|
||||
Set the thread-local urlresolvers script prefix if `set_prefix` is True.
|
||||
"""
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.urls import set_script_prefix
|
||||
from django.utils.log import configure_logging
|
||||
|
||||
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
|
||||
if set_prefix:
|
||||
set_script_prefix(
|
||||
"/" if settings.FORCE_SCRIPT_NAME is None else settings.FORCE_SCRIPT_NAME
|
||||
)
|
||||
apps.populate(settings.INSTALLED_APPS)
|
||||
def get_version():
|
||||
version = '%s.%s' % (VERSION[0], VERSION[1])
|
||||
if VERSION[2]:
|
||||
version = '%s.%s' % (version, VERSION[2])
|
||||
if VERSION[3:] == ('alpha', 0):
|
||||
version = '%s pre-alpha' % version
|
||||
else:
|
||||
if VERSION[3] != 'final':
|
||||
version = '%s %s %s' % (version, VERSION[3], VERSION[4])
|
||||
from django.utils.version import get_svn_revision
|
||||
svn_rev = get_svn_revision()
|
||||
if svn_rev != u'SVN-unknown':
|
||||
version = "%s %s" % (version, svn_rev)
|
||||
return version
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
"""
|
||||
Invokes django-admin when the django module is run as a script.
|
||||
|
||||
Example: python -m django check
|
||||
"""
|
||||
from django.core import management
|
||||
|
||||
if __name__ == "__main__":
|
||||
management.execute_from_command_line()
|
|
@ -1,4 +0,0 @@
|
|||
from .config import AppConfig
|
||||
from .registry import apps
|
||||
|
||||
__all__ = ["AppConfig", "apps"]
|
|
@ -1,274 +0,0 @@
|
|||
import inspect
|
||||
import os
|
||||
from importlib import import_module
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.module_loading import import_string, module_has_submodule
|
||||
|
||||
APPS_MODULE_NAME = "apps"
|
||||
MODELS_MODULE_NAME = "models"
|
||||
|
||||
|
||||
class AppConfig:
|
||||
"""Class representing a Django application and its configuration."""
|
||||
|
||||
def __init__(self, app_name, app_module):
|
||||
# Full Python path to the application e.g. 'django.contrib.admin'.
|
||||
self.name = app_name
|
||||
|
||||
# Root module for the application e.g. <module 'django.contrib.admin'
|
||||
# from 'django/contrib/admin/__init__.py'>.
|
||||
self.module = app_module
|
||||
|
||||
# Reference to the Apps registry that holds this AppConfig. Set by the
|
||||
# registry when it registers the AppConfig instance.
|
||||
self.apps = None
|
||||
|
||||
# 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 e.g. 'admin'.
|
||||
# This value must be unique across a Django project.
|
||||
if not hasattr(self, "label"):
|
||||
self.label = app_name.rpartition(".")[2]
|
||||
if not self.label.isidentifier():
|
||||
raise ImproperlyConfigured(
|
||||
"The app label '%s' is not a valid Python identifier." % self.label
|
||||
)
|
||||
|
||||
# Human-readable name for the application e.g. "Admin".
|
||||
if not hasattr(self, "verbose_name"):
|
||||
self.verbose_name = self.label.title()
|
||||
|
||||
# Filesystem path to the application directory e.g.
|
||||
# '/path/to/django/contrib/admin'.
|
||||
if not hasattr(self, "path"):
|
||||
self.path = self._path_from_module(app_module)
|
||||
|
||||
# Module containing models e.g. <module 'django.contrib.admin.models'
|
||||
# from 'django/contrib/admin/models.py'>. Set by import_models().
|
||||
# None if the application doesn't have a models module.
|
||||
self.models_module = None
|
||||
|
||||
# Mapping of lowercase 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)
|
||||
|
||||
@cached_property
|
||||
def default_auto_field(self):
|
||||
from django.conf import settings
|
||||
|
||||
return settings.DEFAULT_AUTO_FIELD
|
||||
|
||||
@property
|
||||
def _is_default_auto_field_overridden(self):
|
||||
return self.__class__.default_auto_field is not AppConfig.default_auto_field
|
||||
|
||||
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 to list because __path__ may 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)]
|
||||
else:
|
||||
# For unknown reasons, sometimes the list returned by __path__
|
||||
# contains duplicates that must be removed (#25246).
|
||||
paths = list(set(paths))
|
||||
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 paths[0]
|
||||
|
||||
@classmethod
|
||||
def create(cls, entry):
|
||||
"""
|
||||
Factory that creates an app config from an entry in INSTALLED_APPS.
|
||||
"""
|
||||
# create() eventually returns app_config_class(app_name, app_module).
|
||||
app_config_class = None
|
||||
app_name = None
|
||||
app_module = None
|
||||
|
||||
# If import_module succeeds, entry points to the app module.
|
||||
try:
|
||||
app_module = import_module(entry)
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
# If app_module has an apps submodule that defines a single
|
||||
# AppConfig subclass, use it automatically.
|
||||
# To prevent this, an AppConfig subclass can declare a class
|
||||
# variable default = False.
|
||||
# If the apps module defines more than one AppConfig subclass,
|
||||
# the default one can declare default = True.
|
||||
if module_has_submodule(app_module, APPS_MODULE_NAME):
|
||||
mod_path = "%s.%s" % (entry, APPS_MODULE_NAME)
|
||||
mod = import_module(mod_path)
|
||||
# Check if there's exactly one AppConfig candidate,
|
||||
# excluding those that explicitly define default = False.
|
||||
app_configs = [
|
||||
(name, candidate)
|
||||
for name, candidate in inspect.getmembers(mod, inspect.isclass)
|
||||
if (
|
||||
issubclass(candidate, cls)
|
||||
and candidate is not cls
|
||||
and getattr(candidate, "default", True)
|
||||
)
|
||||
]
|
||||
if len(app_configs) == 1:
|
||||
app_config_class = app_configs[0][1]
|
||||
else:
|
||||
# Check if there's exactly one AppConfig subclass,
|
||||
# among those that explicitly define default = True.
|
||||
app_configs = [
|
||||
(name, candidate)
|
||||
for name, candidate in app_configs
|
||||
if getattr(candidate, "default", False)
|
||||
]
|
||||
if len(app_configs) > 1:
|
||||
candidates = [repr(name) for name, _ in app_configs]
|
||||
raise RuntimeError(
|
||||
"%r declares more than one default AppConfig: "
|
||||
"%s." % (mod_path, ", ".join(candidates))
|
||||
)
|
||||
elif len(app_configs) == 1:
|
||||
app_config_class = app_configs[0][1]
|
||||
|
||||
# Use the default app config class if we didn't find anything.
|
||||
if app_config_class is None:
|
||||
app_config_class = cls
|
||||
app_name = entry
|
||||
|
||||
# If import_string succeeds, entry is an app config class.
|
||||
if app_config_class is None:
|
||||
try:
|
||||
app_config_class = import_string(entry)
|
||||
except Exception:
|
||||
pass
|
||||
# If both import_module and import_string failed, it means that entry
|
||||
# doesn't have a valid value.
|
||||
if app_module is None and app_config_class is None:
|
||||
# If the last component of entry starts with an uppercase letter,
|
||||
# then it was likely intended to be an app config class; if not,
|
||||
# an app module. Provide a nice error message in both cases.
|
||||
mod_path, _, cls_name = entry.rpartition(".")
|
||||
if mod_path and cls_name[0].isupper():
|
||||
# We could simply re-trigger the string import exception, but
|
||||
# we're going the extra mile and providing a better error
|
||||
# message for typos in INSTALLED_APPS.
|
||||
# This may raise ImportError, which is the best exception
|
||||
# possible if the module at mod_path cannot be imported.
|
||||
mod = import_module(mod_path)
|
||||
candidates = [
|
||||
repr(name)
|
||||
for name, candidate in inspect.getmembers(mod, inspect.isclass)
|
||||
if issubclass(candidate, cls) and candidate is not cls
|
||||
]
|
||||
msg = "Module '%s' does not contain a '%s' class." % (
|
||||
mod_path,
|
||||
cls_name,
|
||||
)
|
||||
if candidates:
|
||||
msg += " Choices are: %s." % ", ".join(candidates)
|
||||
raise ImportError(msg)
|
||||
else:
|
||||
# Re-trigger the module import exception.
|
||||
import_module(entry)
|
||||
|
||||
# Check for obvious errors. (This check prevents duck typing, but
|
||||
# it could be removed if it became a problem in practice.)
|
||||
if not issubclass(app_config_class, 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.
|
||||
if app_name is None:
|
||||
try:
|
||||
app_name = app_config_class.name
|
||||
except AttributeError:
|
||||
raise ImproperlyConfigured("'%s' must supply a name attribute." % entry)
|
||||
|
||||
# Ensure app_name points to a valid module.
|
||||
try:
|
||||
app_module = import_module(app_name)
|
||||
except ImportError:
|
||||
raise ImproperlyConfigured(
|
||||
"Cannot import '%s'. Check that '%s.%s.name' is correct."
|
||||
% (
|
||||
app_name,
|
||||
app_config_class.__module__,
|
||||
app_config_class.__qualname__,
|
||||
)
|
||||
)
|
||||
|
||||
# Entry is a path to an app config class.
|
||||
return app_config_class(app_name, app_module)
|
||||
|
||||
def get_model(self, model_name, require_ready=True):
|
||||
"""
|
||||
Return the model with the given case-insensitive model_name.
|
||||
|
||||
Raise LookupError if no model exists with this name.
|
||||
"""
|
||||
if require_ready:
|
||||
self.apps.check_models_ready()
|
||||
else:
|
||||
self.apps.check_apps_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_swapped=False):
|
||||
"""
|
||||
Return 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 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.apps.check_models_ready()
|
||||
for model in self.models.values():
|
||||
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):
|
||||
# Dictionary of models for this app, primarily maintained in the
|
||||
# 'all_models' attribute of the Apps this AppConfig is attached to.
|
||||
self.models = self.apps.all_models[self.label]
|
||||
|
||||
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.
|
||||
"""
|
|
@ -1,436 +0,0 @@
|
|||
import functools
|
||||
import sys
|
||||
import threading
|
||||
import warnings
|
||||
from collections import Counter, defaultdict
|
||||
from functools import partial
|
||||
|
||||
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
|
||||
|
||||
from .config import AppConfig
|
||||
|
||||
|
||||
class Apps:
|
||||
"""
|
||||
A registry that stores the configuration of installed applications.
|
||||
|
||||
It also keeps track of models, e.g. to provide reverse relations.
|
||||
"""
|
||||
|
||||
def __init__(self, installed_apps=()):
|
||||
# installed_apps is set to None when creating the main 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(dict)
|
||||
|
||||
# Mapping of labels to AppConfig instances for installed apps.
|
||||
self.app_configs = {}
|
||||
|
||||
# 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
|
||||
# For the autoreloader.
|
||||
self.ready_event = threading.Event()
|
||||
|
||||
# Lock for thread-safe population.
|
||||
self._lock = threading.RLock()
|
||||
self.loading = False
|
||||
|
||||
# Maps ("app_label", "modelname") tuples to lists of functions to be
|
||||
# called when the corresponding model is ready. Used by this class's
|
||||
# `lazy_model_operation()` and `do_pending_operations()` methods.
|
||||
self._pending_operations = defaultdict(list)
|
||||
|
||||
# Populate apps and models, unless it's the main registry.
|
||||
if installed_apps is not None:
|
||||
self.populate(installed_apps)
|
||||
|
||||
def populate(self, installed_apps=None):
|
||||
"""
|
||||
Load application configurations and models.
|
||||
|
||||
Import 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
|
||||
|
||||
# An RLock prevents other threads from entering this section. The
|
||||
# compare and set operation below is atomic.
|
||||
if self.loading:
|
||||
# Prevent reentrant calls to avoid running AppConfig.ready()
|
||||
# methods twice.
|
||||
raise RuntimeError("populate() isn't reentrant")
|
||||
self.loading = True
|
||||
|
||||
# Phase 1: initialize app configs and import 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
|
||||
app_config.apps = self
|
||||
|
||||
# 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
|
||||
|
||||
# Phase 2: import models modules.
|
||||
for app_config in self.app_configs.values():
|
||||
app_config.import_models()
|
||||
|
||||
self.clear_cache()
|
||||
|
||||
self.models_ready = True
|
||||
|
||||
# Phase 3: run ready() methods of app configs.
|
||||
for app_config in self.get_app_configs():
|
||||
app_config.ready()
|
||||
|
||||
self.ready = True
|
||||
self.ready_event.set()
|
||||
|
||||
def check_apps_ready(self):
|
||||
"""Raise an exception if all apps haven't been imported yet."""
|
||||
if not self.apps_ready:
|
||||
from django.conf import settings
|
||||
|
||||
# If "not ready" is due to unconfigured settings, accessing
|
||||
# INSTALLED_APPS raises a more helpful ImproperlyConfigured
|
||||
# exception.
|
||||
settings.INSTALLED_APPS
|
||||
raise AppRegistryNotReady("Apps aren't loaded yet.")
|
||||
|
||||
def check_models_ready(self):
|
||||
"""Raise 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):
|
||||
"""Import applications and return an iterable of app configs."""
|
||||
self.check_apps_ready()
|
||||
return self.app_configs.values()
|
||||
|
||||
def get_app_config(self, app_label):
|
||||
"""
|
||||
Import applications and returns an app config for the given label.
|
||||
|
||||
Raise LookupError if no application exists with this label.
|
||||
"""
|
||||
self.check_apps_ready()
|
||||
try:
|
||||
return self.app_configs[app_label]
|
||||
except KeyError:
|
||||
message = "No installed app with label '%s'." % app_label
|
||||
for app_config in self.get_app_configs():
|
||||
if app_config.name == app_label:
|
||||
message += " Did you mean '%s'?" % app_config.label
|
||||
break
|
||||
raise LookupError(message)
|
||||
|
||||
# This method is performance-critical at least for Django's test suite.
|
||||
@functools.lru_cache(maxsize=None)
|
||||
def get_models(self, include_auto_created=False, include_swapped=False):
|
||||
"""
|
||||
Return 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 that have been swapped out.
|
||||
|
||||
Set the corresponding keyword argument to True to include such models.
|
||||
"""
|
||||
self.check_models_ready()
|
||||
|
||||
result = []
|
||||
for app_config in self.app_configs.values():
|
||||
result.extend(app_config.get_models(include_auto_created, include_swapped))
|
||||
return result
|
||||
|
||||
def get_model(self, app_label, model_name=None, require_ready=True):
|
||||
"""
|
||||
Return the model matching the given app_label and model_name.
|
||||
|
||||
As a shortcut, app_label may be in the form <app_label>.<model_name>.
|
||||
|
||||
model_name is case-insensitive.
|
||||
|
||||
Raise LookupError if no application exists with this label, or no
|
||||
model exists with this name in the application. Raise ValueError if
|
||||
called with a single argument that doesn't contain exactly one dot.
|
||||
"""
|
||||
if require_ready:
|
||||
self.check_models_ready()
|
||||
else:
|
||||
self.check_apps_ready()
|
||||
|
||||
if model_name is None:
|
||||
app_label, model_name = app_label.split(".")
|
||||
|
||||
app_config = self.get_app_config(app_label)
|
||||
|
||||
if not require_ready and app_config.models is None:
|
||||
app_config.import_models()
|
||||
|
||||
return app_config.get_model(model_name, require_ready=require_ready)
|
||||
|
||||
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." % (app_label, model_name),
|
||||
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.do_pending_operations(model)
|
||||
self.clear_cache()
|
||||
|
||||
def is_installed(self, app_name):
|
||||
"""
|
||||
Check whether an application with this name exists in the registry.
|
||||
|
||||
app_name is the full name of the app e.g. '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.
|
||||
|
||||
Return the app config for the inner application in case of nesting.
|
||||
Return None if the object isn't in any registered app config.
|
||||
"""
|
||||
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
|
||||
|
||||
@functools.lru_cache(maxsize=None)
|
||||
def get_swappable_settings_name(self, to_string):
|
||||
"""
|
||||
For a given model string (e.g. "auth.User"), return the name of the
|
||||
corresponding settings name if it refers to a swappable model. If the
|
||||
referred model is not swappable, return None.
|
||||
|
||||
This method is decorated with lru_cache because it's performance
|
||||
critical when it comes to migrations. Since the swappable settings don't
|
||||
change after Django has loaded the settings, there is no reason to get
|
||||
the respective settings attribute over and over again.
|
||||
"""
|
||||
to_string = to_string.lower()
|
||||
for model in self.get_models(include_swapped=True):
|
||||
swapped = model._meta.swapped
|
||||
# Is this model swapped out for the model given by to_string?
|
||||
if swapped and swapped.lower() == to_string:
|
||||
return model._meta.swappable
|
||||
# Is this model swappable and the one given by to_string?
|
||||
if model._meta.swappable and model._meta.label_lower == to_string:
|
||||
return model._meta.swappable
|
||||
return None
|
||||
|
||||
def set_available_apps(self, available):
|
||||
"""
|
||||
Restrict 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 in the sense that it doesn't trigger any imports.
|
||||
"""
|
||||
available = set(available)
|
||||
installed = {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 = {
|
||||
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):
|
||||
"""Cancel a previous call to set_available_apps()."""
|
||||
self.app_configs = self.stored_app_configs.pop()
|
||||
self.clear_cache()
|
||||
|
||||
def set_installed_apps(self, installed):
|
||||
"""
|
||||
Enable 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 (e.g. 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 = {}
|
||||
self.apps_ready = self.models_ready = self.loading = self.ready = False
|
||||
self.clear_cache()
|
||||
self.populate(installed)
|
||||
|
||||
def unset_installed_apps(self):
|
||||
"""Cancel 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):
|
||||
"""
|
||||
Clear all internal caches, for methods that alter the app registry.
|
||||
|
||||
This is mostly used in tests.
|
||||
"""
|
||||
# Call expire cache on each model. This will purge
|
||||
# the relation tree and the fields cache.
|
||||
self.get_models.cache_clear()
|
||||
if self.ready:
|
||||
# Circumvent self.get_models() to prevent that the cache is refilled.
|
||||
# This particularly prevents that an empty value is cached while cloning.
|
||||
for app_config in self.app_configs.values():
|
||||
for model in app_config.get_models(include_auto_created=True):
|
||||
model._meta._expire_cache()
|
||||
|
||||
def lazy_model_operation(self, function, *model_keys):
|
||||
"""
|
||||
Take a function and a number of ("app_label", "modelname") tuples, and
|
||||
when all the corresponding models have been imported and registered,
|
||||
call the function with the model classes as its arguments.
|
||||
|
||||
The function passed to this method must accept exactly n models as
|
||||
arguments, where n=len(model_keys).
|
||||
"""
|
||||
# Base case: no arguments, just execute the function.
|
||||
if not model_keys:
|
||||
function()
|
||||
# Recursive case: take the head of model_keys, wait for the
|
||||
# corresponding model class to be imported and registered, then apply
|
||||
# that argument to the supplied function. Pass the resulting partial
|
||||
# to lazy_model_operation() along with the remaining model args and
|
||||
# repeat until all models are loaded and all arguments are applied.
|
||||
else:
|
||||
next_model, *more_models = model_keys
|
||||
|
||||
# This will be executed after the class corresponding to next_model
|
||||
# has been imported and registered. The `func` attribute provides
|
||||
# duck-type compatibility with partials.
|
||||
def apply_next_model(model):
|
||||
next_function = partial(apply_next_model.func, model)
|
||||
self.lazy_model_operation(next_function, *more_models)
|
||||
|
||||
apply_next_model.func = function
|
||||
|
||||
# If the model has already been imported and registered, partially
|
||||
# apply it to the function now. If not, add it to the list of
|
||||
# pending operations for the model, where it will be executed with
|
||||
# the model class as its sole argument once the model is ready.
|
||||
try:
|
||||
model_class = self.get_registered_model(*next_model)
|
||||
except LookupError:
|
||||
self._pending_operations[next_model].append(apply_next_model)
|
||||
else:
|
||||
apply_next_model(model_class)
|
||||
|
||||
def do_pending_operations(self, model):
|
||||
"""
|
||||
Take a newly-prepared model and pass it to each function waiting for
|
||||
it. This is called at the very end of Apps.register_model().
|
||||
"""
|
||||
key = model._meta.app_label, model._meta.model_name
|
||||
for function in self._pending_operations.pop(key, []):
|
||||
function(model)
|
||||
|
||||
|
||||
apps = Apps(installed_apps=None)
|
|
@ -0,0 +1,13 @@
|
|||
#!/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).
|
||||
"""
|
||||
|
||||
from django.core import management
|
||||
|
||||
if __name__ == "__main__":
|
||||
management.call_command('cleanup')
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
from django.core import management
|
||||
|
||||
if __name__ == "__main__":
|
||||
management.execute_from_command_line()
|
|
@ -0,0 +1,36 @@
|
|||
#!/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 pstats
|
||||
import sys, os
|
||||
|
||||
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])
|
|
@ -0,0 +1,28 @@
|
|||
#!/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 svn 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()
|
||||
open('%s.po' % pf, 'w').write(msg)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unique_messages()
|
|
@ -1,57 +1,22 @@
|
|||
"""
|
||||
Settings and configuration for Django.
|
||||
|
||||
Read values from the module specified by the DJANGO_SETTINGS_MODULE environment
|
||||
variable, and then from django.conf.global_settings; see the global_settings.py
|
||||
for a list of all possible variables.
|
||||
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
|
||||
variable, and then from django.conf.global_settings; see the global settings file for
|
||||
a list of all possible variables.
|
||||
"""
|
||||
|
||||
import importlib
|
||||
import os
|
||||
import time
|
||||
import traceback
|
||||
import re
|
||||
import time # Needed for Windows
|
||||
import warnings
|
||||
from pathlib import Path
|
||||
|
||||
import django
|
||||
from django.conf import global_settings
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils.deprecation import RemovedInDjango50Warning
|
||||
from django.utils.functional import LazyObject, empty
|
||||
from django.utils.functional import LazyObject
|
||||
from django.utils import importlib
|
||||
|
||||
ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
|
||||
|
||||
# RemovedInDjango50Warning
|
||||
USE_DEPRECATED_PYTZ_DEPRECATED_MSG = (
|
||||
"The USE_DEPRECATED_PYTZ setting, and support for pytz timezones is "
|
||||
"deprecated in favor of the stdlib zoneinfo module. Please update your "
|
||||
"code to use zoneinfo and remove the USE_DEPRECATED_PYTZ setting."
|
||||
)
|
||||
|
||||
USE_L10N_DEPRECATED_MSG = (
|
||||
"The USE_L10N setting is deprecated. Starting with Django 5.0, localized "
|
||||
"formatting of data will always be enabled. For example Django will "
|
||||
"display numbers and dates using the format of the current locale."
|
||||
)
|
||||
|
||||
CSRF_COOKIE_MASKED_DEPRECATED_MSG = (
|
||||
"The CSRF_COOKIE_MASKED transitional setting is deprecated. Support for "
|
||||
"it will be removed in Django 5.0."
|
||||
)
|
||||
|
||||
|
||||
class SettingsReference(str):
|
||||
"""
|
||||
String subclass which references a current settings value. It's treated as
|
||||
the value in memory but serializes to a settings.NAME attribute reference.
|
||||
"""
|
||||
|
||||
def __new__(self, value, setting_name):
|
||||
return str.__new__(self, value)
|
||||
|
||||
def __init__(self, value, setting_name):
|
||||
self.setting_name = setting_name
|
||||
|
||||
|
||||
class LazySettings(LazyObject):
|
||||
"""
|
||||
|
@ -59,199 +24,128 @@ class LazySettings(LazyObject):
|
|||
The user can manually configure settings prior to using them. Otherwise,
|
||||
Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.
|
||||
"""
|
||||
|
||||
def _setup(self, name=None):
|
||||
def _setup(self):
|
||||
"""
|
||||
Load the settings module pointed to by the environment variable. This
|
||||
is used the first time settings are needed, if the user hasn't
|
||||
configured settings manually.
|
||||
is used the first time we need any settings at all, if the user has not
|
||||
previously configured the settings manually.
|
||||
"""
|
||||
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. "
|
||||
"You must either define the environment variable %s "
|
||||
"or call settings.configure() before accessing settings."
|
||||
% (desc, ENVIRONMENT_VARIABLE)
|
||||
)
|
||||
try:
|
||||
settings_module = os.environ[ENVIRONMENT_VARIABLE]
|
||||
if not settings_module: # If it's set but is an empty string.
|
||||
raise KeyError
|
||||
except KeyError:
|
||||
# NOTE: This is arguably an EnvironmentError, but that causes
|
||||
# problems with Python's interactive help.
|
||||
raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
|
||||
|
||||
self._wrapped = Settings(settings_module)
|
||||
|
||||
def __repr__(self):
|
||||
# Hardcode the class name as otherwise it yields 'Settings'.
|
||||
if self._wrapped is empty:
|
||||
return "<LazySettings [Unevaluated]>"
|
||||
return '<LazySettings "%(settings_module)s">' % {
|
||||
"settings_module": self._wrapped.SETTINGS_MODULE,
|
||||
}
|
||||
|
||||
def __getattr__(self, name):
|
||||
"""Return the value of a setting and cache it in self.__dict__."""
|
||||
if (_wrapped := self._wrapped) is empty:
|
||||
self._setup(name)
|
||||
_wrapped = self._wrapped
|
||||
val = getattr(_wrapped, name)
|
||||
|
||||
# Special case some settings which require further modification.
|
||||
# This is done here for performance reasons so the modified value is cached.
|
||||
if name in {"MEDIA_URL", "STATIC_URL"} and val is not None:
|
||||
val = self._add_script_prefix(val)
|
||||
elif name == "SECRET_KEY" and not val:
|
||||
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
|
||||
|
||||
self.__dict__[name] = val
|
||||
return val
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
"""
|
||||
Set the value of setting. Clear all cached values if _wrapped changes
|
||||
(@override_settings does this) or clear single values when set.
|
||||
"""
|
||||
if name == "_wrapped":
|
||||
self.__dict__.clear()
|
||||
else:
|
||||
self.__dict__.pop(name, None)
|
||||
super().__setattr__(name, value)
|
||||
|
||||
def __delattr__(self, name):
|
||||
"""Delete a setting and clear it from cache if needed."""
|
||||
super().__delattr__(name)
|
||||
self.__dict__.pop(name, None)
|
||||
|
||||
def configure(self, default_settings=global_settings, **options):
|
||||
"""
|
||||
Called to manually configure the settings. The 'default_settings'
|
||||
parameter sets where to retrieve any unspecified values from (its
|
||||
argument must support attribute access (__getattr__)).
|
||||
"""
|
||||
if self._wrapped is not empty:
|
||||
raise RuntimeError("Settings already configured.")
|
||||
if self._wrapped != None:
|
||||
raise RuntimeError('Settings already configured.')
|
||||
holder = UserSettingsHolder(default_settings)
|
||||
for name, value in options.items():
|
||||
if not name.isupper():
|
||||
raise TypeError("Setting %r must be uppercase." % name)
|
||||
setattr(holder, name, value)
|
||||
self._wrapped = holder
|
||||
|
||||
@staticmethod
|
||||
def _add_script_prefix(value):
|
||||
"""
|
||||
Add SCRIPT_NAME prefix to relative paths.
|
||||
|
||||
Useful when the app is being served at a subpath and manually prefixing
|
||||
subpath to STATIC_URL and MEDIA_URL in settings is inconvenient.
|
||||
"""
|
||||
# Don't apply prefix to absolute paths and URLs.
|
||||
if value.startswith(("http://", "https://", "/")):
|
||||
return value
|
||||
from django.urls import get_script_prefix
|
||||
|
||||
return "%s%s" % (get_script_prefix(), value)
|
||||
|
||||
@property
|
||||
def configured(self):
|
||||
"""Return True if the settings have already been configured."""
|
||||
return self._wrapped is not empty
|
||||
|
||||
@property
|
||||
def USE_L10N(self):
|
||||
stack = traceback.extract_stack()
|
||||
# Show a warning if the setting is used outside of Django.
|
||||
# Stack index: -1 this line, -2 the LazyObject __getattribute__(),
|
||||
# -3 the caller.
|
||||
filename, _, _, _ = stack[-3]
|
||||
if not filename.startswith(os.path.dirname(django.__file__)):
|
||||
warnings.warn(
|
||||
USE_L10N_DEPRECATED_MSG,
|
||||
RemovedInDjango50Warning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return self.__getattr__("USE_L10N")
|
||||
|
||||
# RemovedInDjango50Warning.
|
||||
@property
|
||||
def _USE_L10N_INTERNAL(self):
|
||||
# Special hook to avoid checking a traceback in internal use on hot
|
||||
# paths.
|
||||
return self.__getattr__("USE_L10N")
|
||||
"""
|
||||
Returns True if the settings have already been configured.
|
||||
"""
|
||||
return bool(self._wrapped)
|
||||
configured = property(configured)
|
||||
|
||||
|
||||
class Settings:
|
||||
class BaseSettings(object):
|
||||
"""
|
||||
Common logic for settings whether set by a module or by the user.
|
||||
"""
|
||||
def __setattr__(self, name, value):
|
||||
if name in ("MEDIA_URL", "STATIC_URL") and value and not value.endswith('/'):
|
||||
warnings.warn('If set, %s must end with a slash' % name,
|
||||
PendingDeprecationWarning)
|
||||
elif name == "ALLOWED_INCLUDE_ROOTS" and isinstance(value, basestring):
|
||||
raise ValueError("The ALLOWED_INCLUDE_ROOTS setting must be set "
|
||||
"to a tuple, not a string.")
|
||||
object.__setattr__(self, name, value)
|
||||
|
||||
|
||||
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.isupper():
|
||||
if setting == setting.upper():
|
||||
setattr(self, setting, getattr(global_settings, setting))
|
||||
|
||||
# store the settings module in case someone later cares
|
||||
self.SETTINGS_MODULE = settings_module
|
||||
|
||||
mod = importlib.import_module(self.SETTINGS_MODULE)
|
||||
try:
|
||||
mod = importlib.import_module(self.SETTINGS_MODULE)
|
||||
except ImportError, e:
|
||||
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
|
||||
|
||||
# Settings that should be converted into tuples if they're mistakenly entered
|
||||
# as strings.
|
||||
tuple_settings = ("INSTALLED_APPS", "TEMPLATE_DIRS")
|
||||
|
||||
tuple_settings = (
|
||||
"ALLOWED_HOSTS",
|
||||
"INSTALLED_APPS",
|
||||
"TEMPLATE_DIRS",
|
||||
"LOCALE_PATHS",
|
||||
"SECRET_KEY_FALLBACKS",
|
||||
)
|
||||
self._explicit_settings = set()
|
||||
for setting in dir(mod):
|
||||
if setting.isupper():
|
||||
if setting == setting.upper():
|
||||
setting_value = getattr(mod, setting)
|
||||
|
||||
if setting in tuple_settings and not isinstance(
|
||||
setting_value, (list, tuple)
|
||||
):
|
||||
raise ImproperlyConfigured(
|
||||
"The %s setting must be a list or a tuple." % setting
|
||||
)
|
||||
if setting in tuple_settings and type(setting_value) == str:
|
||||
setting_value = (setting_value,) # In case the user forgot the comma.
|
||||
setattr(self, setting, setting_value)
|
||||
self._explicit_settings.add(setting)
|
||||
|
||||
if self.USE_TZ is False and not self.is_overridden("USE_TZ"):
|
||||
warnings.warn(
|
||||
"The default value of USE_TZ will change from False to True "
|
||||
"in Django 5.0. Set USE_TZ to False in your project settings "
|
||||
"if you want to keep the current default behavior.",
|
||||
category=RemovedInDjango50Warning,
|
||||
)
|
||||
# Expand entries in INSTALLED_APPS like "django.contrib.*" to a list
|
||||
# of all those apps.
|
||||
new_installed_apps = []
|
||||
for app in self.INSTALLED_APPS:
|
||||
if app.endswith('.*'):
|
||||
app_mod = importlib.import_module(app[:-2])
|
||||
appdir = os.path.dirname(app_mod.__file__)
|
||||
app_subdirs = os.listdir(appdir)
|
||||
app_subdirs.sort()
|
||||
name_pattern = re.compile(r'[a-zA-Z]\w*')
|
||||
for d in app_subdirs:
|
||||
if name_pattern.match(d) and os.path.isdir(os.path.join(appdir, d)):
|
||||
new_installed_apps.append('%s.%s' % (app[:-2], d))
|
||||
else:
|
||||
new_installed_apps.append(app)
|
||||
self.INSTALLED_APPS = new_installed_apps
|
||||
|
||||
if self.is_overridden("USE_DEPRECATED_PYTZ"):
|
||||
warnings.warn(USE_DEPRECATED_PYTZ_DEPRECATED_MSG, RemovedInDjango50Warning)
|
||||
|
||||
if self.is_overridden("CSRF_COOKIE_MASKED"):
|
||||
warnings.warn(CSRF_COOKIE_MASKED_DEPRECATED_MSG, RemovedInDjango50Warning)
|
||||
|
||||
if hasattr(time, "tzset") and self.TIME_ZONE:
|
||||
if hasattr(time, 'tzset') and self.TIME_ZONE:
|
||||
# When we can, attempt to validate the timezone. If we can't find
|
||||
# this file, no check happens and it's harmless.
|
||||
zoneinfo_root = Path("/usr/share/zoneinfo")
|
||||
zone_info_file = zoneinfo_root.joinpath(*self.TIME_ZONE.split("/"))
|
||||
if zoneinfo_root.exists() and not zone_info_file.exists():
|
||||
zoneinfo_root = '/usr/share/zoneinfo'
|
||||
if (os.path.exists(zoneinfo_root) and not
|
||||
os.path.exists(os.path.join(zoneinfo_root, *(self.TIME_ZONE.split('/'))))):
|
||||
raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
|
||||
# Move the time zone info into os.environ. See ticket #2315 for why
|
||||
# we don't do this unconditionally (breaks Windows).
|
||||
os.environ["TZ"] = self.TIME_ZONE
|
||||
os.environ['TZ'] = self.TIME_ZONE
|
||||
time.tzset()
|
||||
|
||||
if self.is_overridden("USE_L10N"):
|
||||
warnings.warn(USE_L10N_DEPRECATED_MSG, RemovedInDjango50Warning)
|
||||
# Settings are configured, so we can set up the logger if required
|
||||
if self.LOGGING_CONFIG:
|
||||
# First find the logging configuration function ...
|
||||
logging_config_path, logging_config_func_name = self.LOGGING_CONFIG.rsplit('.', 1)
|
||||
logging_config_module = importlib.import_module(logging_config_path)
|
||||
logging_config_func = getattr(logging_config_module, logging_config_func_name)
|
||||
|
||||
def is_overridden(self, setting):
|
||||
return setting in self._explicit_settings
|
||||
|
||||
def __repr__(self):
|
||||
return '<%(cls)s "%(settings_module)s">' % {
|
||||
"cls": self.__class__.__name__,
|
||||
"settings_module": self.SETTINGS_MODULE,
|
||||
}
|
||||
# ... then invoke it with the logging settings
|
||||
logging_config_func(self.LOGGING)
|
||||
|
||||
|
||||
class UserSettingsHolder:
|
||||
"""Holder for user configured settings."""
|
||||
|
||||
class UserSettingsHolder(BaseSettings):
|
||||
"""
|
||||
Holder for user configured settings.
|
||||
"""
|
||||
# SETTINGS_MODULE doesn't make much sense in the manually configured
|
||||
# (standalone) case.
|
||||
SETTINGS_MODULE = None
|
||||
|
@ -261,48 +155,16 @@ class UserSettingsHolder:
|
|||
Requests for configuration variables not in this class are satisfied
|
||||
from the module specified in default_settings (if possible).
|
||||
"""
|
||||
self.__dict__["_deleted"] = set()
|
||||
self.default_settings = default_settings
|
||||
|
||||
def __getattr__(self, name):
|
||||
if not name.isupper() or name in self._deleted:
|
||||
raise AttributeError
|
||||
return getattr(self.default_settings, name)
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
self._deleted.discard(name)
|
||||
if name == "USE_L10N":
|
||||
warnings.warn(USE_L10N_DEPRECATED_MSG, RemovedInDjango50Warning)
|
||||
if name == "CSRF_COOKIE_MASKED":
|
||||
warnings.warn(CSRF_COOKIE_MASKED_DEPRECATED_MSG, RemovedInDjango50Warning)
|
||||
super().__setattr__(name, value)
|
||||
if name == "USE_DEPRECATED_PYTZ":
|
||||
warnings.warn(USE_DEPRECATED_PYTZ_DEPRECATED_MSG, RemovedInDjango50Warning)
|
||||
|
||||
def __delattr__(self, name):
|
||||
self._deleted.add(name)
|
||||
if hasattr(self, name):
|
||||
super().__delattr__(name)
|
||||
|
||||
def __dir__(self):
|
||||
return sorted(
|
||||
s
|
||||
for s in [*self.__dict__, *dir(self.default_settings)]
|
||||
if s not in self._deleted
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
def __repr__(self):
|
||||
return "<%(cls)s>" % {
|
||||
"cls": self.__class__.__name__,
|
||||
}
|
||||
return self.__dict__.keys() + dir(self.default_settings)
|
||||
|
||||
# For Python < 2.6:
|
||||
__members__ = property(lambda self: self.__dir__())
|
||||
|
||||
settings = LazySettings()
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
|
@ -1,6 +0,0 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class {{ camel_case_app_name }}Config(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = '{{ app_name }}'
|
|
@ -0,0 +1,16 @@
|
|||
"""
|
||||
This file demonstrates writing tests using the unittest module. These will pass
|
||||
when you run "manage.py test".
|
||||
|
||||
Replace this with more appropriate tests for your application.
|
||||
"""
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class SimpleTest(TestCase):
|
||||
def test_basic_addition(self):
|
||||
"""
|
||||
Tests that 1 + 1 always equals 2.
|
||||
"""
|
||||
self.assertEqual(1 + 1, 2)
|
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
|
@ -1,3 +0,0 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
File diff suppressed because it is too large
Load Diff
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
|
@ -1,21 +1,23 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "j F، Y"
|
||||
TIME_FORMAT = "g:i A"
|
||||
# DATETIME_FORMAT =
|
||||
YEAR_MONTH_FORMAT = "F Y"
|
||||
MONTH_DAY_FORMAT = "j F"
|
||||
SHORT_DATE_FORMAT = "d/m/Y"
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'j F، Y'
|
||||
TIME_FORMAT = 'g:i:s A'
|
||||
# DATETIME_FORMAT =
|
||||
YEAR_MONTH_FORMAT = 'F Y'
|
||||
MONTH_DAY_FORMAT = 'j F'
|
||||
SHORT_DATE_FORMAT = 'd/m/Y'
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
# DATE_INPUT_FORMATS =
|
||||
# TIME_INPUT_FORMATS =
|
||||
# DATETIME_INPUT_FORMATS =
|
||||
DECIMAL_SEPARATOR = ","
|
||||
THOUSAND_SEPARATOR = "."
|
||||
# NUMBER_GROUPING =
|
||||
# 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 =
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,29 +0,0 @@
|
|||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "j F Y"
|
||||
TIME_FORMAT = "H:i"
|
||||
DATETIME_FORMAT = "j F Y H:i"
|
||||
YEAR_MONTH_FORMAT = "F Y"
|
||||
MONTH_DAY_FORMAT = "j F"
|
||||
SHORT_DATE_FORMAT = "j F Y"
|
||||
SHORT_DATETIME_FORMAT = "j F Y H:i"
|
||||
FIRST_DAY_OF_WEEK = 0 # Sunday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = [
|
||||
"%Y/%m/%d", # '2006/10/25'
|
||||
]
|
||||
TIME_INPUT_FORMATS = [
|
||||
"%H:%M", # '14:30
|
||||
"%H:%M:%S", # '14:30:59'
|
||||
]
|
||||
DATETIME_INPUT_FORMATS = [
|
||||
"%Y/%m/%d %H:%M", # '2006/10/25 14:30'
|
||||
"%Y/%m/%d %H:%M:%S", # '2006/10/25 14:30:59'
|
||||
]
|
||||
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
|
@ -1,30 +0,0 @@
|
|||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "j E Y"
|
||||
TIME_FORMAT = "G:i"
|
||||
DATETIME_FORMAT = "j E Y, G:i"
|
||||
YEAR_MONTH_FORMAT = "F Y"
|
||||
MONTH_DAY_FORMAT = "j F"
|
||||
SHORT_DATE_FORMAT = "d.m.Y"
|
||||
SHORT_DATETIME_FORMAT = "d.m.Y H:i"
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = [
|
||||
"%d.%m.%Y", # '25.10.2006'
|
||||
"%d.%m.%y", # '25.10.06'
|
||||
]
|
||||
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 %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'
|
||||
]
|
||||
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
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,21 +1,23 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "d F Y"
|
||||
TIME_FORMAT = "H:i"
|
||||
# DATETIME_FORMAT =
|
||||
# YEAR_MONTH_FORMAT =
|
||||
MONTH_DAY_FORMAT = "j F"
|
||||
SHORT_DATE_FORMAT = "d.m.Y"
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'd F Y'
|
||||
TIME_FORMAT = 'H:i:s'
|
||||
# DATETIME_FORMAT =
|
||||
# YEAR_MONTH_FORMAT =
|
||||
MONTH_DAY_FORMAT = 'j F'
|
||||
SHORT_DATE_FORMAT = 'd.m.Y'
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
# DATE_INPUT_FORMATS =
|
||||
# TIME_INPUT_FORMATS =
|
||||
# DATETIME_INPUT_FORMATS =
|
||||
DECIMAL_SEPARATOR = ","
|
||||
THOUSAND_SEPARATOR = " " # Non-breaking space
|
||||
# NUMBER_GROUPING =
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
# DATE_INPUT_FORMATS =
|
||||
# TIME_INPUT_FORMATS =
|
||||
# DATETIME_INPUT_FORMATS =
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = u' ' # Non-breaking space
|
||||
# NUMBER_GROUPING =
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,32 +1,23 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "j F, Y"
|
||||
TIME_FORMAT = "g:i A"
|
||||
# DATETIME_FORMAT =
|
||||
YEAR_MONTH_FORMAT = "F Y"
|
||||
MONTH_DAY_FORMAT = "j F"
|
||||
SHORT_DATE_FORMAT = "j M, Y"
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
FIRST_DAY_OF_WEEK = 6 # Saturday
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'j F, Y'
|
||||
TIME_FORMAT = 'g:i:s A'
|
||||
# DATETIME_FORMAT =
|
||||
YEAR_MONTH_FORMAT = 'F Y'
|
||||
MONTH_DAY_FORMAT = 'j F'
|
||||
SHORT_DATE_FORMAT = 'j M, Y'
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = [
|
||||
"%d/%m/%Y", # 25/10/2016
|
||||
"%d/%m/%y", # 25/10/16
|
||||
"%d-%m-%Y", # 25-10-2016
|
||||
"%d-%m-%y", # 25-10-16
|
||||
]
|
||||
TIME_INPUT_FORMATS = [
|
||||
"%H:%M:%S", # 14:30:59
|
||||
"%H:%M", # 14:30
|
||||
]
|
||||
DATETIME_INPUT_FORMATS = [
|
||||
"%d/%m/%Y %H:%M:%S", # 25/10/2006 14:30:59
|
||||
"%d/%m/%Y %H:%M", # 25/10/2006 14:30
|
||||
]
|
||||
DECIMAL_SEPARATOR = "."
|
||||
THOUSAND_SEPARATOR = ","
|
||||
# NUMBER_GROUPING =
|
||||
# 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 =
|
||||
|
|
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
|
@ -1,21 +1,23 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "j. N Y."
|
||||
TIME_FORMAT = "G:i"
|
||||
DATETIME_FORMAT = "j. N. Y. G:i T"
|
||||
YEAR_MONTH_FORMAT = "F Y."
|
||||
MONTH_DAY_FORMAT = "j. F"
|
||||
SHORT_DATE_FORMAT = "Y M j"
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'j. N Y.'
|
||||
TIME_FORMAT = 'G:i'
|
||||
DATETIME_FORMAT = 'j. N. Y. G:i T'
|
||||
YEAR_MONTH_FORMAT = 'F Y.'
|
||||
MONTH_DAY_FORMAT = 'j. F'
|
||||
SHORT_DATE_FORMAT = 'Y M j'
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
# DATE_INPUT_FORMATS =
|
||||
# TIME_INPUT_FORMATS =
|
||||
# DATETIME_INPUT_FORMATS =
|
||||
DECIMAL_SEPARATOR = ","
|
||||
THOUSAND_SEPARATOR = "."
|
||||
# NUMBER_GROUPING =
|
||||
# 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 =
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,30 +1,35 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = r"j E \d\e Y"
|
||||
TIME_FORMAT = "G:i"
|
||||
DATETIME_FORMAT = r"j E \d\e Y \a \l\e\s G:i"
|
||||
YEAR_MONTH_FORMAT = r"F \d\e\l Y"
|
||||
MONTH_DAY_FORMAT = r"j E"
|
||||
SHORT_DATE_FORMAT = "d/m/Y"
|
||||
SHORT_DATETIME_FORMAT = "d/m/Y G:i"
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = r'j \de F \de Y'
|
||||
TIME_FORMAT = 'G:i:s'
|
||||
DATETIME_FORMAT = r'j \de F \de Y \a \le\s G:i'
|
||||
YEAR_MONTH_FORMAT = r'F \de\l Y'
|
||||
MONTH_DAY_FORMAT = r'j \de F'
|
||||
SHORT_DATE_FORMAT = 'd/m/Y'
|
||||
SHORT_DATETIME_FORMAT = 'd/m/Y G:i'
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = [
|
||||
"%d/%m/%Y", # '31/12/2009'
|
||||
"%d/%m/%y", # '31/12/09'
|
||||
]
|
||||
DATETIME_INPUT_FORMATS = [
|
||||
"%d/%m/%Y %H:%M:%S",
|
||||
"%d/%m/%Y %H:%M:%S.%f",
|
||||
"%d/%m/%Y %H:%M",
|
||||
"%d/%m/%y %H:%M:%S",
|
||||
"%d/%m/%y %H:%M:%S.%f",
|
||||
"%d/%m/%y %H:%M",
|
||||
]
|
||||
DECIMAL_SEPARATOR = ","
|
||||
THOUSAND_SEPARATOR = "."
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = (
|
||||
# '31/12/2009', '31/12/09'
|
||||
'%d/%m/%Y', '%d/%m/%y'
|
||||
)
|
||||
TIME_INPUT_FORMATS = (
|
||||
# '14:30:59', '14:30'
|
||||
'%H:%M:%S', '%H:%M'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d/%m/%Y %H:%M:%S',
|
||||
'%d/%m/%Y %H:%M',
|
||||
'%d/%m/%y %H:%M:%S',
|
||||
'%d/%m/%y %H:%M',
|
||||
)
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = '.'
|
||||
NUMBER_GROUPING = 3
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "j F Y"
|
||||
TIME_FORMAT = "G:i"
|
||||
DATETIME_FORMAT = "j F Y، کاتژمێر G:i"
|
||||
YEAR_MONTH_FORMAT = "F Y"
|
||||
MONTH_DAY_FORMAT = "j F"
|
||||
SHORT_DATE_FORMAT = "Y/n/j"
|
||||
SHORT_DATETIME_FORMAT = "Y/n/j، G:i"
|
||||
FIRST_DAY_OF_WEEK = 6
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
# DATE_INPUT_FORMATS =
|
||||
# TIME_INPUT_FORMATS =
|
||||
# DATETIME_INPUT_FORMATS =
|
||||
DECIMAL_SEPARATOR = "."
|
||||
THOUSAND_SEPARATOR = ","
|
||||
# NUMBER_GROUPING =
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,43 +1,37 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "j. E Y"
|
||||
TIME_FORMAT = "G:i"
|
||||
DATETIME_FORMAT = "j. E Y G:i"
|
||||
YEAR_MONTH_FORMAT = "F Y"
|
||||
MONTH_DAY_FORMAT = "j. F"
|
||||
SHORT_DATE_FORMAT = "d.m.Y"
|
||||
SHORT_DATETIME_FORMAT = "d.m.Y G:i"
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'j. E Y'
|
||||
TIME_FORMAT = 'G:i:s'
|
||||
DATETIME_FORMAT = 'j. E Y G:i:s'
|
||||
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
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = [
|
||||
"%d.%m.%Y", # '05.01.2006'
|
||||
"%d.%m.%y", # '05.01.06'
|
||||
"%d. %m. %Y", # '5. 1. 2006'
|
||||
"%d. %m. %y", # '5. 1. 06'
|
||||
# "%d. %B %Y", # '25. October 2006'
|
||||
# "%d. %b. %Y", # '25. Oct. 2006'
|
||||
]
|
||||
# Kept ISO formats as one is in first position
|
||||
TIME_INPUT_FORMATS = [
|
||||
"%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", # '05.01.2006 04.30'
|
||||
"%d.%m.%Y %H:%M", # '05.01.2006 04:30'
|
||||
"%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", # '05. 01. 2006 04.30'
|
||||
"%d. %m. %Y %H:%M", # '05. 01. 2006 04:30'
|
||||
"%Y-%m-%d %H.%M", # '2006-01-05 04.30'
|
||||
]
|
||||
DECIMAL_SEPARATOR = ","
|
||||
THOUSAND_SEPARATOR = "\xa0" # non-breaking space
|
||||
# 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'
|
||||
'%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'
|
||||
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
|
||||
)
|
||||
TIME_INPUT_FORMATS = (
|
||||
'%H:%M:%S', # '14:30:59'
|
||||
'%H:%M', # '14:30'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
|
||||
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
|
||||
'%d.%m.%Y', # '25.10.2006'
|
||||
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
|
||||
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
|
||||
'%Y-%m-%d', # '2006-10-25'
|
||||
)
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = ' '
|
||||
NUMBER_GROUPING = 3
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,33 +1,23 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
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'
|
||||
# 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 =
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = [
|
||||
"%d/%m/%Y", # '25/10/2006'
|
||||
"%d/%m/%y", # '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'
|
||||
"%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 %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'
|
||||
]
|
||||
DECIMAL_SEPARATOR = "."
|
||||
THOUSAND_SEPARATOR = ","
|
||||
NUMBER_GROUPING = 3
|
||||
# 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 =
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,26 +1,31 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "j. F Y"
|
||||
TIME_FORMAT = "H:i"
|
||||
DATETIME_FORMAT = "j. F Y H:i"
|
||||
YEAR_MONTH_FORMAT = "F Y"
|
||||
MONTH_DAY_FORMAT = "j. F"
|
||||
SHORT_DATE_FORMAT = "d.m.Y"
|
||||
SHORT_DATETIME_FORMAT = "d.m.Y H:i"
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'j. F Y'
|
||||
TIME_FORMAT = 'H:i'
|
||||
DATETIME_FORMAT = 'j. F Y H:i'
|
||||
YEAR_MONTH_FORMAT = 'F Y'
|
||||
MONTH_DAY_FORMAT = 'j. F'
|
||||
SHORT_DATE_FORMAT = 'd.m.Y'
|
||||
SHORT_DATETIME_FORMAT = 'd.m.Y H:i'
|
||||
FIRST_DAY_OF_WEEK = 1
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = [
|
||||
"%d.%m.%Y", # '25.10.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'
|
||||
]
|
||||
DECIMAL_SEPARATOR = ","
|
||||
THOUSAND_SEPARATOR = "."
|
||||
# see http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = (
|
||||
'%d.%m.%Y', # '25.10.2006'
|
||||
)
|
||||
TIME_INPUT_FORMATS = (
|
||||
'%H:%M:%S', # '14:30:59'
|
||||
'%H:%M', # '14:30'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
|
||||
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
|
||||
)
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = '.'
|
||||
NUMBER_GROUPING = 3
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,29 +1,37 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "j. F Y"
|
||||
TIME_FORMAT = "H:i"
|
||||
DATETIME_FORMAT = "j. F Y H:i"
|
||||
YEAR_MONTH_FORMAT = "F Y"
|
||||
MONTH_DAY_FORMAT = "j. F"
|
||||
SHORT_DATE_FORMAT = "d.m.Y"
|
||||
SHORT_DATETIME_FORMAT = "d.m.Y H:i"
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'j. F Y'
|
||||
TIME_FORMAT = 'H:i:s'
|
||||
DATETIME_FORMAT = 'j. F Y H:i:s'
|
||||
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
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = [
|
||||
"%d.%m.%Y", # '25.10.2006'
|
||||
"%d.%m.%y", # '25.10.06'
|
||||
# "%d. %B %Y", # '25. October 2006'
|
||||
# "%d. %b. %Y", # '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'
|
||||
]
|
||||
DECIMAL_SEPARATOR = ","
|
||||
THOUSAND_SEPARATOR = "."
|
||||
# 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'
|
||||
'%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'
|
||||
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
|
||||
)
|
||||
TIME_INPUT_FORMATS = (
|
||||
'%H:%M:%S', # '14:30:59'
|
||||
'%H:%M', # '14:30'
|
||||
)
|
||||
DATETIME_INPUT_FORMATS = (
|
||||
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
|
||||
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
|
||||
'%d.%m.%Y', # '25.10.2006'
|
||||
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
|
||||
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
|
||||
'%Y-%m-%d', # '2006-10-25'
|
||||
)
|
||||
DECIMAL_SEPARATOR = ','
|
||||
THOUSAND_SEPARATOR = '.'
|
||||
NUMBER_GROUPING = 3
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = "j. F Y"
|
||||
TIME_FORMAT = "H:i"
|
||||
DATETIME_FORMAT = "j. F Y H:i"
|
||||
YEAR_MONTH_FORMAT = "F Y"
|
||||
MONTH_DAY_FORMAT = "j. F"
|
||||
SHORT_DATE_FORMAT = "d.m.Y"
|
||||
SHORT_DATETIME_FORMAT = "d.m.Y H:i"
|
||||
FIRST_DAY_OF_WEEK = 1 # Monday
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = [
|
||||
"%d.%m.%Y", # '25.10.2006'
|
||||
"%d.%m.%y", # '25.10.06'
|
||||
# "%d. %B %Y", # '25. October 2006'
|
||||
# "%d. %b. %Y", # '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'
|
||||
]
|
||||
|
||||
# these are the separators for non-monetary numbers. For monetary numbers,
|
||||
# the DECIMAL_SEPARATOR is a . (decimal point) and the THOUSAND_SEPARATOR is a
|
||||
# ' (single quote).
|
||||
# For details, please refer to the documentation and the following link:
|
||||
# https://www.bk.admin.ch/bk/de/home/dokumentation/sprachen/hilfsmittel-textredaktion/schreibweisungen.html
|
||||
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
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -1,34 +1,23 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
# This file is distributed under the same license as the Django package.
|
||||
#
|
||||
|
||||
# The *_FORMAT strings use the Django date format syntax,
|
||||
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
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 = "d/m/Y P"
|
||||
FIRST_DAY_OF_WEEK = 0 # Sunday
|
||||
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||
DATE_FORMAT = 'd E Y'
|
||||
TIME_FORMAT = 'g:i:s A'
|
||||
# DATETIME_FORMAT =
|
||||
YEAR_MONTH_FORMAT = 'F Y'
|
||||
MONTH_DAY_FORMAT = 'j F'
|
||||
SHORT_DATE_FORMAT = 'd M Y'
|
||||
# SHORT_DATETIME_FORMAT =
|
||||
# FIRST_DAY_OF_WEEK =
|
||||
|
||||
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
|
||||
# see https://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
||||
DATE_INPUT_FORMATS = [
|
||||
"%d/%m/%Y", # '25/10/2006'
|
||||
"%d/%m/%y", # '25/10/06'
|
||||
"%Y-%m-%d", # '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 %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'
|
||||
"%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'
|
||||
]
|
||||
DECIMAL_SEPARATOR = ","
|
||||
THOUSAND_SEPARATOR = "."
|
||||
NUMBER_GROUPING = 3
|
||||
# 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 =
|
||||
|
|
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue