Commit Graph

63 Commits

Author SHA1 Message Date
Yecine Megdiche
380ac8e79d
Remove old-style super calls (#8226) 2021-12-06 15:32:33 +00:00
Adam Johnson
410575dace
Replace all url() calls with path() or re_path() (#7512)
* url() is deprecated in Django 3.1

* update given feedbacks on url() is deprecated in Django 3.1

* Fix test_urlpatterns.py to continue testing mixed re_path() and path()

* Fix one missed reference

Co-authored-by: sanjusci <sanju.sci9@gmail.com>
2020-09-08 15:32:27 +01:00
Luke Plant
f0dbf0a264 Update docs to use lists instead of tuples (#6797) 2019-07-12 18:15:36 -07:00
johnthagen
7749e4e3be Make code snippet Python 3 compatible (#6377) 2019-01-04 18:00:38 -08:00
Ryan P Kilby
99ca078ebb Add "Community" section to docs, minor cleanup (#5993)
* Add 'Community' tab to navigation, move articles

* Drop DRF 2.x announcements and the docs note

* Drop embedded tutorial/guide/topics links

* Conver mixture of tabs/spaces => spaces

* Fix topics/community links
2018-07-06 11:28:18 +02:00
Chris Shyi
fc2143207b Update tutorial to Django 2.0 routing syntax (#5963) (#5964)
Update tutorial to Django 2.0 routing syntax
2018-05-08 09:06:14 +01:00
Kent Kawashima
d82b332a09 Changes ternary conditionals to be PEP308 compliant (#5827) 2018-02-14 14:06:09 +00:00
guntanis
88c75ba808
Fixed "typo" in example.
Fixing code "typo" in example.
In the original file, line 145 reads:
        url(r'^api-auth/', include('rest_framework.urls'),
It's missing the closing parenthesis.
2017-12-28 02:01:01 -08:00
José Padilla
743fc247eb Update tutorial (#5622)
* Use createsuperuser email and username flags

* Only remove db.sqlite3

* Remove global permission class

This interferes with Core API schema endpoint

* Add default pagination class

* Specify changes made in snippets/urls.py

* Auth urls were already set in tutorial/urls.py

* Specify changes made in snippets/urls.py

* Use the suggested admin username from quickstart

* Move global pagination setting away from quickstart section
2017-11-27 11:34:17 +01:00
Jon Dufresne
ff556a91fd Remove references to unsupported Django versions in docs and code (#5602)
Per the trove classifiers, DRF only supports Django versions 1.10+. Can
drop documentation, code comments, and workarounds for older Django
versions.
2017-11-20 09:35:54 +01:00
sol HYUN
eb8c658f33 ID must start from 1 again
At the beginning of tutorial4, The database had been removed
2017-03-16 06:34:30 +09:00
Mads Jensen
8ac524915c added on_delete=models.CASCADE to models.ForeignKey in the documentation (#4614) 2016-10-22 16:37:23 +01:00
Tom Christie
3f6004c5a9 Use pk for URL conf and views. (#4592) 2016-10-20 09:42:40 +01:00
Tom Christie
0dec36eb41 Version 3.5 (#4525)
* Start test case

* Added 'requests' test client

* Address typos

* Graceful fallback if requests is not installed.

* Add cookie support

* Tests for auth and CSRF

* Py3 compat

* py3 compat

* py3 compat

* Add get_requests_client

* Added SchemaGenerator.should_include_link

* add settings for html cutoff on related fields

* Router doesn't work if prefix is blank, though project urls.py handles prefix

* Fix Django 1.10 to-many deprecation

* Add django.core.urlresolvers compatibility

* Update django-filter & django-guardian

* Check for empty router prefix; adjust URL accordingly

It's easiest to fix this issue after we have made the regex.  To try
to fix it before would require doing something different for List vs
Detail, which means we'd have to know which type of url we're
constructing before acting accordingly.

* Fix misc django deprecations

* Use TOC extension instead of header

* Fix deprecations for py3k

* Add py3k compatibility to is_simple_callable

* Add is_simple_callable tests

* Drop python 3.2 support (EOL, Dropped by Django)

* schema_renderers= should *set* the renderers, not append to them.

* API client (#4424)

* Fix release notes

* Add note about 'User account is disabled.' vs 'Unable to log in'

* Clean up schema generation (#4527)

* Handle multiple methods on custom action (#4529)

* RequestsClient, CoreAPIClient

* exclude_from_schema

* Added 'get_schema_view()' shortcut

* Added schema descriptions

* Better descriptions for schemas

* Add type annotation to schema generation

* Coerce schema 'pk' in path to actual field name

* Deprecations move into assertion errors

* Use get_schema_view in tests

* Updte CoreJSON media type

* Handle schema structure correctly when path prefixs exist. Closes #4401

* Add PendingDeprecation to Router schema generation.

* Added SCHEMA_COERCE_PATH_PK and SCHEMA_COERCE_METHOD_NAMES

* Renamed and documented 'get_schema_fields' interface.
2016-10-10 13:03:46 +01:00
Kenneth Schnall
ff5cfe3e84 Replace "class based views" occurrences with "class-based views" (#4251) 2016-07-08 08:38:50 +01:00
Christian Berendt
ff4d7c7e07 Use 'password123' as password for new users in the tutorial
Trying to create a new user on Django 1.9.x with the password 'password'
will fail with the error message 'This password is too common.'. Because
of that it is necessary to change the used password from 'password' to
'password123'.
2016-02-04 07:26:15 +01:00
knbk
e203967e09 Add app_name to rest_framework.urls.
This allows users in Django 1.9+ to include the authentication urls
without specifying the namespace, as in:

    urlpatterns = [
        ...
        url(r'^auth/', include('rest_framework.urls'))
    ]
2015-12-08 02:25:00 +01:00
Travis Swientek
8ccf5bcc0b Tweaked a few issues in the tutorial documentation. 2015-01-09 11:36:21 -08:00
Brent O'Connor
4f33cfe1a0 With httpie 0.8.0 the HTTP method has to come after the auth argument. 2014-12-17 14:38:01 -06:00
Tom Christie
302ec59a5c Merge pull request #2165 from phalt/httpie-examples
Use httpie for tutorials
2014-12-08 15:51:19 +00:00
Xavier Ordoquy
e4820d611b Fix the new Django default db name
PrimaryKeyRelatedField now needs a queryset argument.
urls now don't use urlpatterns.
2014-12-06 10:58:17 +01:00
phalt
34b5db62e5 Use httpie for tutorials 2014-12-01 13:39:53 +00:00
Gil Gonçalves
790a651893 Fixed database update instructions 2014-11-24 08:51:08 +00:00
Tom Christie
a58cfe167d Update tutorial for 3.0 2014-10-09 09:38:03 +01:00
Collin Anderson
da385c9c1f remove patterns and strings from urls #1898 2014-09-23 17:10:02 -04:00
sshquack
867e441ec0 Strip trailing spaces in tutorial 2014-08-15 20:45:28 -06:00
sshquack
14867705e9 Specify file names using standard format
+ Explicitly specify module names in the standard format similar to all
the other tutorials
+ Remove the extra quote around module name
2014-08-15 20:41:21 -06:00
Sylvain Bellemare
9e3ba939e1 Removed superfluous "./"s 2014-05-05 20:28:00 +02:00
DanSears
abb240648c clarified which urls.py to edit 2014-02-28 08:40:45 -08:00
Tom Christie
d8a95b4b6d Back out permissions example change in favor of easier to follow example 2013-12-23 09:12:34 +00:00
amatellanes
2846ddb5d2 Simplified some examples in tutorial 2013-12-23 09:06:03 +01:00
amatellanes
74f1cf6355 Revert "Simplified some examples in tutorial"
This reverts commit d6806340e5.
2013-12-23 08:56:34 +01:00
amatellanes
d6806340e5 Simplified some examples in tutorial 2013-12-23 08:50:46 +01:00
Tom Christie
075b8c1037 Add User import. Refs #599 2013-11-18 09:29:09 +00:00
Rikki
bf60848952 Using the filenames where relevant
Sometimes it's hard to tell which file the code is intended to go in. Now it spells it out.
2013-10-16 03:21:43 +01:00
dpetzel
864497eebb Be sure to import UserSerializer 2013-10-05 23:16:58 -04:00
Stephan Groß
7a570e16e9 Fix md formatting and typos 2013-05-28 17:13:12 +02:00
Pascal Borreli
8f35ac4f93 Fixed typos 2013-05-28 15:09:23 +01:00
Daniel Hepper
70b8e5b759 Fixed typos in tutorial 2013-05-07 19:16:03 +02:00
Tom Christie
b70c9cc107 Merge master 2013-05-05 18:12:35 +01:00
Victor Shih
8cabae22c5 Example and spelling fixes. Change "browseable" to "browsable" for consistency. 2013-05-01 21:26:40 -07:00
Tom Christie
b94da2468c Various clean up and lots of docs 2013-04-24 22:40:24 +01:00
Sitong Peng
dab158e1fd Tiny typo 2013-03-25 09:27:12 -07:00
Danilo Bargen
70db398595 Renamed UserInstance to UserDetail in docs 2013-02-25 21:31:12 +01:00
Tom Christie
4599cd97cb Fix curl response.
Didn't map to the correct stage of the tutorial.
2013-02-23 22:13:06 +00:00
Tom Christie
ea7d73f57e Spelling. 2013-02-23 22:07:33 +00:00
Tom Christie
4a80dff1ef Autenticating with curl example. 2013-02-23 21:52:46 +00:00
Tom Christie
55fdac4176 Use many=True for serializers. 2013-02-12 08:58:28 +00:00
Tom Christie
09b01887f2 New style object-level permission checks 2013-02-12 08:58:28 +00:00
Guglielmo
25f2d3b561 Update docs/tutorial/4-authentication-and-permissions.md
HTMLFormatter is in pygments.formatters.html
2013-01-25 18:16:14 +01:00