| | 193 | .. note:: |
|---|
| | 194 | Since `patterns()` is a function call, it accepts a maximum of 255 |
|---|
| | 195 | arguments (URL patterns, in this case). This is a limit for all Python |
|---|
| | 196 | function calls. This will rarely be problem in practice, since you'll |
|---|
| | 197 | typically structure your URL patterns modularly by using `include()` |
|---|
| | 198 | sections. However, on the off-chance you do hit the 255-argument limit, |
|---|
| | 199 | realise that `patterns()` returns a Python list, so you can split up the |
|---|
| | 200 | construction of the list. |
|---|
| | 201 | |
|---|
| | 202 | :: |
|---|
| | 203 | |
|---|
| | 204 | urlpatterns = patterns('', |
|---|
| | 205 | ... |
|---|
| | 206 | ) |
|---|
| | 207 | urlpatterns += patterns('', |
|---|
| | 208 | ... |
|---|
| | 209 | ) |
|---|
| | 210 | |
|---|
| | 211 | Python lists have unlimited size, so there's no limit to how many URL |
|---|
| | 212 | patterns you can construct; merely that you may only create 254 at a time |
|---|
| | 213 | (the 255-th argument is the initial prefix argument). |
|---|
| | 214 | |
|---|