Skip to content

Commit e8dfe28

Browse files
committed
update django example page to include the list of topics by function and class
1 parent 4d8f776 commit e8dfe28

File tree

7 files changed

+112
-123
lines changed

7 files changed

+112
-123
lines changed

content/pages/examples/django/django-example-projects-code.markdown

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,16 @@ sidebartitle: Django Example Code
77
meta: Python example projects and code that show how to use the Django web application framework.
88

99

10-
[Django](/django.html) is a Python [web framework](/web-frameworks.html).
11-
12-
<a href="http://www.djangoproject.com/" style="border: none;"><img src="/img/logos/django.png" width="100%" alt="Official Django logo. Trademark Django Software Foundation." class="shot" style="margin-top:20px"></a>
13-
14-
Part of Django's widespread adoption comes from its broad ecosystem of
15-
open source code libraries and example projects.
16-
17-
It's good to familiarize yourself with the following projects to
18-
learn what is available to you beyond the extensive
19-
"[batteries-included](https://www.quora.com/Why-does-Django-tout-itself-as-a-batteries-included-web-framework-when-you-have-to-manually-write-regexes-to-do-URL-routing)"
20-
code base.
21-
22-
These projects, ordered alphabetically, are also helpful as example
23-
code for how to build your own applications.
10+
## Example Projects with Great Example Code
11+
The following active projects use the [Django](/django.html) framework in
12+
various ways that can show you how to build your own applications.
2413

2514

2615
### dccnsys
2716
[dccnsys](https://github.com/dccnconf/dccnsys) is a conference registration
2817
system built with [Django](/django.html). The code is open source under the
2918
[MIT license](https://github.com/dccnconf/dccnsys/blob/master/LICENSE).
3019

31-
dccnsys is shown on the following code example pages:
32-
33-
* [django.apps.config AppConfig](/django-apps-config-appconfig-examples.html)
34-
* [django.contrib.auth get_user_model](/django-contrib-auth-get-user-model-examples.html)
35-
* [django.contrib.auth.decorators login_required](/django-contrib-auth-decorators-login-required-examples.html)
36-
* [django.db.models DateField](/django-db-models-datefield-examples.html)
37-
* [django.db.models IntegerField](/django-db-models-integerfield-examples.html)
38-
* [django.http HttpResponseForbidden](/django-http-httpresponseforbidden-examples.html)
39-
* [django.urls.path](/django-urls-path-examples.html)
40-
4120

4221
### dmd-interpreter
4322
[dmd-interpreter](https://github.com/mitchalexbailey/dmd-interpreter)
@@ -58,11 +37,6 @@ whereas the detail view would have a different serializer.
5837
The project is open source under the
5938
[MIT license](https://github.com/gregschmit/drf-action-serializer/blob/master/LICENSE).
6039

61-
There are code examples from the drf-action-serializer project on the
62-
following pages:
63-
64-
* [django.urls.path](/django-urls-path-examples.html)
65-
6640

6741
### Gadget Board
6842
[gadget-board](https://github.com/mik4el/gadget-board) is a
@@ -71,13 +45,6 @@ following pages:
7145
[Angular](/angular.html) web application that is open source under the
7246
[Apache2 license](https://github.com/mik4el/gadget-board/blob/master/LICENSE).
7347

74-
Additional example code found within gadget-board:
75-
76-
* [django.apps.config AppConfig](/django-apps-config-appconfig-examples.html)
77-
* [django.conf.urls url](/django-conf-urls-url-examples.html)
78-
* [django.contrib admin](/django-contrib-admin-examples.html)
79-
* [django.contrib.auth.hashers make_password](/django-contrib-auth-hashers-make-password-examples.html)
80-
8148

8249
### Graphite-Web
8350
[Graphite](https://github.com/graphite-project/graphite-web)
@@ -116,7 +83,3 @@ This web application makes it easier for people to register as organ donors.
11683
You can see the application live at
11784
[https://register.organize.org/](https://register.organize.org/).
11885

119-
Useful example code from register can be found on:
120-
121-
* [django.conf.urls url](/django-conf-urls-url-examples.html)
122-
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<div class="row">
2+
<div class="c12">
3+
<h3 style="margin-top:24px;line-height:28px"><a href="/django.html">Django</a>:
4+
<a href="/django-extensions-plug-ins-related-libraries.html">Extensions, Plug-ins and Related Libraries</a> &amp;
5+
<a href="/django-code-examples.html">Example Projects and Code</a>
6+
</h3>
7+
<h4 class="bp"><a href="/django-apps-config-appconfig-examples.html">django.apps.config AppConfig</a></h4>
8+
<h4 class="bp">django.conf
9+
<a href="/django-conf-settings-examples.html">settings</a>,
10+
<a href="/django-conf-urls-url-examples.html">urls.url</a>
11+
</h4>
12+
<h4 class="bp"><a href="/django-contrib-admin-examples.html">django.contrib.admin</a>
13+
<a href="/django-contrib-admin-filters-simplelistfilter-examples.html">filters.SimpleListFilter</a>,
14+
<a href="/django-contrib-admin-sites-register-examples.html">sites.register</a>,
15+
<a href="/django-contrib-auth-get-user-model-examples.html">auth.get_user_model</a>,
16+
<a href="/django-contrib-auth-decorators-login-required-examples.html">auth.decorators login_required</a>,
17+
<a href="/django-contrib-auth-hashers-make-password-examples.html">auth.hashers.make_password</a>
18+
</h4>
19+
<h4 class="bp">django.core
20+
<a href="/django-core-mail-send-mail-examples.html">mail.send_mail</a>,
21+
<a href="/django-core-mail-messages-emailmessage-examples.html">mail.messages EmailMessage</a>,
22+
<a href="/django-core-management-base-basecommand-examples.html">management.base BaseCommand</a>
23+
</h4>
24+
<h4 class="bp"><a href="/django-db-operationalerror-examples.html">django.db OperationalError</a></h4>
25+
<h4 class="bp">django.db.models
26+
<a href="/django-db-models-autofield-examples.html">AutoField</a>,
27+
<a href="/django-db-models-booleanfield-examples.html">BooleanField</a>,
28+
<a href="/django-db-models-charfield-examples.html">CharField</a>,
29+
<a href="/django-db-models-datefield-examples.html">DateField</a>,
30+
<a href="/django-db-models-datetimefield-examples.html">DateTimeField</a>,
31+
<a href="/django-db-models-filefield-examples.html">FileField</a>,
32+
<a href="/django-db-models-foreignkey-examples.html">ForeignKey</a>,
33+
<a href="/django-db-models-genericipaddressfield-examples.html">GenericIPAddressField</a>,
34+
<a href="/django-db-models-imagefield-examples.html">ImageField</a>,
35+
<a href="/django-db-models-integerfield-examples.html">IntegerField</a>,
36+
<a href="/django-db-models-model-examples.html">Model</a>,
37+
<a href="/django-db-models-positiveintegerfield-examples.html">PositiveIntegerField</a>,
38+
<a href="/django-db-models-positivesmallintegerfield-examples.html">PositiveSmallIntegerField</a>,
39+
<a href="/django-db-models-signal-examples.html">signal</a>,
40+
<a href="/django-db-models-slugfield-examples.html">SlugField</a>,
41+
<a href="/django-db-models-smallintegerfield-examples.html">SmallIntegerField</a>,
42+
<a href="/django-db-models-textfield-examples.html">TextField</a>
43+
</h4>
44+
<h4 class="bp"><a href="/django-dispatch-dispatcher-signal-examples.html">django.dispatch.dispatcher Signal</a></h4>
45+
<h4 class="bp"><a href="/django-forms-examples.html">django.forms</a>
46+
<a href="/django-forms-booleanfield-examples.html">BooleanField</a>,
47+
<a href="/django-forms-charfield-examples.html">CharField</a>,
48+
<a href="/django-forms-choicefield-examples.html">ChoiceField</a>,
49+
<span class="sn">TypedChoiceField</span>,
50+
<span class="sn">DateField</span>,
51+
<span class="sn">DateTimeField</span>,
52+
<span class="sn">DecimalField</span>,
53+
<span class="sn">DurationField</span>,
54+
<a href="/django-forms-emailfield-examples.html">EmailField</a>,
55+
<a href="/django-forms-integerfield-examples.html">IntegerField</a>
56+
</h4>
57+
<h4 class="bp">django.http
58+
<a href="/django-http-httpresponse-examples.html">HttpResponse</a>,
59+
<a href="/django-http-httpresponsebadrequest-examples.html">HttpResponseBadRequest</a>,
60+
<a href="/django-http-httpresponseforbidden-examples.html">HttpResponseForbidden</a>,
61+
<a href="/django-http-httpresponsenotmodified-examples.html">HttpResponseNotModified</a>,
62+
<a href="/django-http-http404-examples.html">Http404</a>,
63+
<a href="/django-http-httpresponsepermanentredirect-examples.html">HttpResponsePermanentRedirect</a>,
64+
<a href="/django-http-httpresponseredirect-examples.html">HttpResponseRedirect</a>
65+
</h4>
66+
<h4 class="bp">django.urls
67+
<a href="/django-urls-path-examples.html">path</a>,
68+
<a href="/django-urls-reverse-lazy-examples.html">reverse_lazy</a>
69+
</h4>
70+
<h4 class="bp">django.urls.exceptions
71+
<a href="/django-urls-exceptions-noreversematch-examples.html">NoReverseMatch</a>,
72+
<a href="/django-urls-exceptions-resolver404-examples.html">Resolver404</a>
73+
</h4>
74+
<h4 class="bp"><a href="/django-utils-html-format-html-examples.html">django.utils.html format_html</a></h4>
75+
<h4 class="bp">django.template.response
76+
<a href="/django-template-response-simpletemplateresponse-examples.html">SimpleTemplateResponse</a>,
77+
<a href="/django-template-response-templateresponse-examples.html">TemplateResponse</a>
78+
</h4>
79+
<h4 class="bp"><a href="/django-utils-timezone-examples.html">django.utils.timezone</a></h4>
80+
</div>
81+
</div>

theme/templates/css/base.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

theme/templates/css/toc.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<a href="/django.html">Django</a> is a Python <a href="/web-frameworks.html">web framework.</a>
2+
3+
<a href="http://www.djangoproject.com/" style="border: none;"><img src="/img/logos/django.png" width="100%" alt="Official Django logo. Trademark Django Software Foundation." class="shot" style="margin:20px 0 20px 0"></a>
4+
5+
<p>Part of Django's widespread adoption comes from its broad ecosystem of
6+
open source code libraries and example projects.
7+
</p>
8+
9+
<p>It is a good idea to familiarize yourself with the following projects to
10+
learn what is available to you beyond the extensive
11+
"<a href="https://www.quora.com/Why-does-Django-tout-itself-as-a-batteries-included-web-framework-when-you-have-to-manually-write-regexes-to-do-URL-routing">batteries-included</a>"
12+
code base.</p>
13+
14+
<p>These projects, ordered alphabetically, are also helpful as example
15+
code for how to build your own applications.</p>
16+
17+
18+
<h2 id="django-by-class-function">Code Examples Sorted by Django Class and Function</h2>
19+
<p>Specific examples are shown on the following individual pages,
20+
organized by classes and functions provided by Django, that are frequently
21+
used when building your own web applications.</p>

theme/templates/page.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ <h1>{{ page.title }}</h1>
4747
</div>
4848
</div>
4949
{% else %}
50+
{% if page.slug == "django-code-examples" %}
51+
{% include "examples-extensions-descriptions/django.html" %}
52+
{% include "code-examples/django.html" %}
53+
{% endif %}
5054
{{ page.content }}
5155
{% endif %}
5256
{% if page.sortorder[0:2] == "50" %}

theme/templates/table-of-contents.html

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -44,87 +44,7 @@ <h4 class="bp"><a href="https://testdriven.io/courses/aws-flask-react/?utm_sourc
4444
</div>
4545

4646
<h2>Example Python Projects and Code</h2>
47-
<div class="row">
48-
<div class="c12">
49-
<h3 style="margin-top:24px;line-height:28px"><a href="/django.html">Django</a>:
50-
<a href="/django-extensions-plug-ins-related-libraries.html">Extensions, Plug-ins and Related Libraries</a> &amp;
51-
<a href="/django-code-examples.html">Example Projects and Code</a>
52-
</h3>
53-
<h4 class="bp"><a href="/django-apps-config-appconfig-examples.html">django.apps.config AppConfig</a></h4>
54-
<h4 class="bp">django.conf
55-
<a href="/django-conf-settings-examples.html">settings</a>,
56-
<a href="/django-conf-urls-url-examples.html">urls.url</a>
57-
</h4>
58-
<h4 class="bp"><a href="/django-contrib-admin-examples.html">django.contrib.admin</a>
59-
<a href="/django-contrib-admin-filters-simplelistfilter-examples.html">filters.SimpleListFilter</a>,
60-
<a href="/django-contrib-admin-sites-register-examples.html">sites.register</a>,
61-
<a href="/django-contrib-auth-get-user-model-examples.html">auth.get_user_model</a>,
62-
<a href="/django-contrib-auth-decorators-login-required-examples.html">auth.decorators login_required</a>,
63-
<a href="/django-contrib-auth-hashers-make-password-examples.html">auth.hashers.make_password</a>
64-
</h4>
65-
<h4 class="bp">django.core
66-
<a href="/django-core-mail-send-mail-examples.html">mail.send_mail</a>,
67-
<a href="/django-core-mail-messages-emailmessage-examples.html">mail.messages EmailMessage</a>,
68-
<a href="/django-core-management-base-basecommand-examples.html">management.base BaseCommand</a>
69-
</h4>
70-
<h4 class="bp"><a href="/django-db-operationalerror-examples.html">django.db OperationalError</a></h4>
71-
<h4 class="bp">django.db.models
72-
<a href="/django-db-models-autofield-examples.html">AutoField</a>,
73-
<a href="/django-db-models-booleanfield-examples.html">BooleanField</a>,
74-
<a href="/django-db-models-charfield-examples.html">CharField</a>,
75-
<a href="/django-db-models-datefield-examples.html">DateField</a>,
76-
<a href="/django-db-models-datetimefield-examples.html">DateTimeField</a>,
77-
<a href="/django-db-models-filefield-examples.html">FileField</a>,
78-
<a href="/django-db-models-foreignkey-examples.html">ForeignKey</a>,
79-
<a href="/django-db-models-genericipaddressfield-examples.html">GenericIPAddressField</a>,
80-
<a href="/django-db-models-imagefield-examples.html">ImageField</a>,
81-
<a href="/django-db-models-integerfield-examples.html">IntegerField</a>,
82-
<a href="/django-db-models-model-examples.html">Model</a>,
83-
<a href="/django-db-models-positiveintegerfield-examples.html">PositiveIntegerField</a>,
84-
<a href="/django-db-models-positivesmallintegerfield-examples.html">PositiveSmallIntegerField</a>,
85-
<a href="/django-db-models-signal-examples.html">signal</a>,
86-
<a href="/django-db-models-slugfield-examples.html">SlugField</a>,
87-
<a href="/django-db-models-smallintegerfield-examples.html">SmallIntegerField</a>,
88-
<a href="/django-db-models-textfield-examples.html">TextField</a>
89-
</h4>
90-
<h4 class="bp"><a href="/django-dispatch-dispatcher-signal-examples.html">django.dispatch.dispatcher Signal</a></h4>
91-
<h4 class="bp"><a href="/django-forms-examples.html">django.forms</a>
92-
<a href="/django-forms-booleanfield-examples.html">BooleanField</a>,
93-
<a href="/django-forms-charfield-examples.html">CharField</a>,
94-
<a href="/django-forms-choicefield-examples.html">ChoiceField</a>,
95-
<span class="sn">TypedChoiceField</span>,
96-
<span class="sn">DateField</span>,
97-
<span class="sn">DateTimeField</span>,
98-
<span class="sn">DecimalField</span>,
99-
<span class="sn">DurationField</span>,
100-
<a href="/django-forms-emailfield-examples.html">EmailField</a>,
101-
<a href="/django-forms-integerfield-examples.html">IntegerField</a>
102-
</h4>
103-
<h4 class="bp">django.http
104-
<a href="/django-http-httpresponse-examples.html">HttpResponse</a>,
105-
<a href="/django-http-httpresponsebadrequest-examples.html">HttpResponseBadRequest</a>,
106-
<a href="/django-http-httpresponseforbidden-examples.html">HttpResponseForbidden</a>,
107-
<a href="/django-http-httpresponsenotmodified-examples.html">HttpResponseNotModified</a>,
108-
<a href="/django-http-http404-examples.html">Http404</a>,
109-
<a href="/django-http-httpresponsepermanentredirect-examples.html">HttpResponsePermanentRedirect</a>,
110-
<a href="/django-http-httpresponseredirect-examples.html">HttpResponseRedirect</a>
111-
</h4>
112-
<h4 class="bp">django.urls
113-
<a href="/django-urls-path-examples.html">path</a>,
114-
<a href="/django-urls-reverse-lazy-examples.html">reverse_lazy</a>
115-
</h4>
116-
<h4 class="bp">django.urls.exceptions
117-
<a href="/django-urls-exceptions-noreversematch-examples.html">NoReverseMatch</a>,
118-
<a href="/django-urls-exceptions-resolver404-examples.html">Resolver404</a>
119-
</h4>
120-
<h4 class="bp"><a href="/django-utils-html-format-html-examples.html">django.utils.html format_html</a></h4>
121-
<h4 class="bp">django.template.response
122-
<a href="/django-template-response-simpletemplateresponse-examples.html">SimpleTemplateResponse</a>,
123-
<a href="/django-template-response-templateresponse-examples.html">TemplateResponse</a>
124-
</h4>
125-
<h4 class="bp"><a href="/django-utils-timezone-examples.html">django.utils.timezone</a></h4>
126-
</div>
127-
</div>
47+
{% include "code-examples/django.html" %}
12848

12949
<div class="row">
13050
<div class="c12">

0 commit comments

Comments
 (0)