Skip to content

Commit 4d68441

Browse files
committed
add operationalerror django code example
1 parent 6f4d523 commit 4d68441

File tree

6 files changed

+365
-1
lines changed

6 files changed

+365
-1
lines changed

content/pages/03-data/20-d3-js.markdown

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ from scratch.
9999
not only have to learn the tool itself but all the concepts and
100100
web browser technologies that it is built upon.
101101

102+
* This
103+
[visualization of d3.js modules and resources](https://wattenberger.com/blog/d3)
104+
is a wonderful map for understanding how various parts of the library
105+
and the ecosystem fit together. The visual provides a useful map for where
106+
to concentrate your learning depending on what type of visualization you
107+
are working to build.
108+
102109
* [D3.js in Action, Second Edition](https://blog.usejournal.com/d3-js-in-action-second-edition-8cf7ffa2a116)
103110
is partially an announcement for the authors book but also contains
104111
good context for who uses D3 and why its usage continues to grow.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
title: django.apps.config AppConfig Example Code
2+
category: page
3+
slug: django-apps-config-appconfig-examples
4+
sortorder: 50067
5+
toc: False
6+
sidebartitle: django.apps.config AppConfig
7+
meta: Python code examples for the AppConfig class that is part of Django's django.apps.config package.
8+
9+
10+
[AppConfig](https://github.com/django/django/blob/master/django/apps/config.py)
11+
([documentation](https://docs.djangoproject.com/en/2.2/ref/applications/#django.apps.AppConfig))
12+
represents an app for a [Django](/django.html) project, including
13+
metadata such as name, label and path.
14+
15+
16+
## Example 1 from AuditLog
17+
[Auditlog](https://github.com/jjkester/django-auditlog)
18+
([project documentation](https://django-auditlog.readthedocs.io/en/latest/))
19+
is a [Django](/django.html) app that logs changes to Python objects,
20+
similar to the Django admin's logs but with more details and
21+
output formats. Auditlog's source code is provided as open source under the
22+
[MIT license](https://github.com/jjkester/django-auditlog/blob/master/LICENSE).
23+
24+
[**AuditLog / src/auditlog_tests / apps.py**](https://github.com/jjkester/django-auditlog/blob/master/src/auditlog_tests/apps.py)
25+
26+
```python
27+
~~from django.apps import AppConfig
28+
29+
30+
~~class AuditlogTestConfig(AppConfig):
31+
~~ name = 'auditlog_tests'
32+
```
33+
34+
35+
## Example 2 from dccnsys
36+
[dccnsys](https://github.com/dccnconf/dccnsys) is a conference registration
37+
system built with [Django](/django.html). The code is open source under the
38+
[MIT license](https://github.com/dccnconf/dccnsys/blob/master/LICENSE).
39+
40+
[**dccnsys / wwwdccn/registration / apps.py**](https://github.com/dccnconf/dccnsys/blob/master/wwwdccn/registration/apps.py)
41+
42+
```python
43+
~~from django.apps import AppConfig
44+
45+
46+
~~class RegistrationConfig(AppConfig):
47+
~~ name = 'registration'
48+
```
49+
50+
51+
## Example 3 from django-allauth
52+
[django-allauth](https://github.com/pennersr/django-allauth)
53+
([project website](https://www.intenct.nl/projects/django-allauth/)) is a
54+
[Django](/django.html) library for easily adding local and social authentication
55+
flows to Django projects. It is open source under the
56+
[MIT License](https://github.com/pennersr/django-allauth/blob/master/LICENSE).
57+
58+
59+
[**django-allauth / allauth/socialaccount / apps.py**](https://github.com/pennersr/django-allauth/blob/master/allauth/socialaccount/apps.py)
60+
61+
```python
62+
~~from django.apps import AppConfig
63+
64+
from allauth.compat import ugettext_lazy as _
65+
66+
67+
~~class SocialAccountConfig(AppConfig):
68+
~~ name = 'allauth.socialaccount'
69+
~~ verbose_name = _('Social Accounts')
70+
```
71+
72+
73+
## Example 4 from gadget-board
74+
[gadget-board](https://github.com/mik4el/gadget-board) is a
75+
[Django](/django.html),
76+
[Django REST Framework (DRF)](/django-rest-framework-drf.html) and
77+
[Angular](/angular.html) web application that is open source under the
78+
[Apache2 license](https://github.com/mik4el/gadget-board/blob/master/LICENSE).
79+
80+
[**gadget-board / web/authentication / apps.py**](https://github.com/mik4el/gadget-board/blob/master/web/authentication/apps.py)
81+
82+
```python
83+
~~from django.apps import AppConfig
84+
85+
86+
~~class AuthenticationConfig(AppConfig):
87+
~~ name = 'authentication'
88+
```
89+

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ output formats. Auditlog's source code is provided as open source under the
3535

3636
Example code found in the AuditLog project:
3737

38+
* [django.apps.config AppConfig](/django-apps-config-appconfig-examples.html)
3839
* [django.contrib.admin.filters SimpleListFilter](/django-contrib-admin-filters-simplelistfilter-examples.html)
3940
* [django.db.models DateTimeField](/django-db-models-datetimefield-examples.html)
4041
* [django.utils.html format_html](/django-utils-html-format-html-examples.html)
@@ -47,6 +48,7 @@ system built with [Django](/django.html). The code is open source under the
4748

4849
dccnsys is shown on the following code example pages:
4950

51+
* [django.apps.config AppConfig](/django-apps-config-appconfig-examples.html)
5052
* [django.contrib.auth get_user_model](/django-contrib-auth-get-user-model-examples.html)
5153
* [django.contrib.auth.decorators login_required](/django-contrib-auth-decorators-login-required-examples.html)
5254
* [django.urls.path](/django-urls-path-examples.html)
@@ -61,6 +63,7 @@ flows to Django projects. It is open source under the
6163

6264
Code used for examples from the django-allauth project:
6365

66+
* [django.apps.config AppConfig](/django-apps-config-appconfig-examples.html)
6467
* [django.conf.urls.url](/django-conf-urls-url-examples.html)
6568
* [django.forms](/django-forms-examples.html)
6669

@@ -82,6 +85,22 @@ Code from django-angular is shown on:
8285
* [django.urls.exceptions NoReverseMatch](/django-urls-exceptions-noreversematch-examples.html)
8386

8487

88+
### django-axes
89+
[django-axes](https://github.com/jazzband/django-axes/)
90+
([project documentation](https://django-axes.readthedocs.io/en/latest/)
91+
and
92+
[PyPI package information](https://pypi.org/project/django-axes/)
93+
is a code library for [Django](/django.html) projects to track failed
94+
login attempts against a web application. The goal of the project is
95+
to make it easier for you to stop people and scripts from hacking your
96+
Django-powered website.
97+
98+
The code for django-axes is
99+
[open source under the MIT liense](https://github.com/jazzband/django-axes/blob/master/LICENSE)
100+
and maintained by the group of developers known as
101+
[Jazzband](https://jazzband.co/).
102+
103+
85104
### django-cors-headers
86105
[django-cors-headers](https://github.com/ottoyiu/django-cors-headers) is
87106
an
@@ -256,6 +275,21 @@ Further code examples from django-oscar:
256275
* [django.contrib.auth.decorators login_required](/django-contrib-auth-decorators-login-required-examples.html)
257276

258277

278+
### django-pipeline
279+
[django-pipeline](https://github.com/jazzband/django-pipeline)
280+
([project documentation](https://django-pipeline.readthedocs.io/en/latest/)
281+
and
282+
[PyPI package information](https://pypi.org/project/django-pipeline/))
283+
is a code library for handling and compressing
284+
[static content assets](/static-content.html) when handling requests in
285+
[Django](/django.html) web applications.
286+
287+
The django-pipeline project is open sourced under the
288+
[MIT License](https://github.com/jazzband/django-pipeline/blob/master/LICENSE.txt)
289+
and it is maintained by the developer community group
290+
[Jazzband](https://jazzband.co/).
291+
292+
259293
### django-push-notifications
260294
[django-push-notifications](https://github.com/jazzband/django-push-notifications)
261295
is a [Django](/django.html) app for storing and interacting with
@@ -324,6 +358,7 @@ following pages:
324358

325359
Additional example code found within gadget-board:
326360

361+
* [django.apps.config AppConfig](/django-apps-config-appconfig-examples.html)
327362
* [django.conf.urls url](/django-conf-urls-url-examples.html)
328363
* [django.contrib admin](/django-contrib-admin-examples.html)
329364
* [django.contrib.auth.hashers make_password](/django-contrib-auth-hashers-make-password-examples.html)

0 commit comments

Comments
 (0)