Skip to content

Commit fdcc68c

Browse files
💚 Isort and black the demo app
1 parent 1ac0530 commit fdcc68c

File tree

5 files changed

+94
-82
lines changed

5 files changed

+94
-82
lines changed

demo/demo/settings.py

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,72 +15,70 @@
1515
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1616
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1717

18-
SECRET_KEY = 'such-secret-much-hiding-wow'
18+
SECRET_KEY = "such-secret-much-hiding-wow"
1919

2020
# SECURITY WARNING: don't run with debug turned on in production!
2121
DEBUG = True
2222

23-
ALLOWED_HOSTS = ['*']
23+
ALLOWED_HOSTS = ["*"]
2424

2525

2626
# Application definition
2727

2828
INSTALLED_APPS = [
29-
'django.contrib.admin',
30-
'django.contrib.auth',
31-
'django.contrib.contenttypes',
32-
'django.contrib.sessions',
33-
'django.contrib.messages',
34-
'django.contrib.staticfiles',
35-
36-
'import_export',
37-
'timeline_logger',
38-
39-
'demo_app.apps.DemoAppConfig',
29+
"django.contrib.admin",
30+
"django.contrib.auth",
31+
"django.contrib.contenttypes",
32+
"django.contrib.sessions",
33+
"django.contrib.messages",
34+
"django.contrib.staticfiles",
35+
"import_export",
36+
"timeline_logger",
37+
"demo_app.apps.DemoAppConfig",
4038
]
4139

4240
MIDDLEWARE = [
43-
'django.middleware.security.SecurityMiddleware',
44-
'django.contrib.sessions.middleware.SessionMiddleware',
45-
'django.middleware.common.CommonMiddleware',
46-
'django.middleware.csrf.CsrfViewMiddleware',
47-
'django.contrib.auth.middleware.AuthenticationMiddleware',
48-
'django.contrib.messages.middleware.MessageMiddleware',
49-
'django.middleware.clickjacking.XFrameOptionsMiddleware',
41+
"django.middleware.security.SecurityMiddleware",
42+
"django.contrib.sessions.middleware.SessionMiddleware",
43+
"django.middleware.common.CommonMiddleware",
44+
"django.middleware.csrf.CsrfViewMiddleware",
45+
"django.contrib.auth.middleware.AuthenticationMiddleware",
46+
"django.contrib.messages.middleware.MessageMiddleware",
47+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
5048
]
5149

52-
ROOT_URLCONF = 'demo.urls'
50+
ROOT_URLCONF = "demo.urls"
5351

5452
TEMPLATES = [
5553
{
56-
'BACKEND': 'django.template.backends.django.DjangoTemplates',
57-
'DIRS': [],
58-
'APP_DIRS': True,
59-
'OPTIONS': {
60-
'context_processors': [
61-
'django.template.context_processors.debug',
62-
'django.template.context_processors.request',
63-
'django.contrib.auth.context_processors.auth',
64-
'django.contrib.messages.context_processors.messages',
54+
"BACKEND": "django.template.backends.django.DjangoTemplates",
55+
"DIRS": [],
56+
"APP_DIRS": True,
57+
"OPTIONS": {
58+
"context_processors": [
59+
"django.template.context_processors.debug",
60+
"django.template.context_processors.request",
61+
"django.contrib.auth.context_processors.auth",
62+
"django.contrib.messages.context_processors.messages",
6563
],
6664
},
6765
},
6866
]
6967

70-
WSGI_APPLICATION = 'demo.wsgi.application'
68+
WSGI_APPLICATION = "demo.wsgi.application"
7169

7270

7371
# Database
7472
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
7573

7674
DATABASES = {
77-
'default': {
78-
'ENGINE': 'django.db.backends.postgresql',
79-
'NAME': os.getenv('PGDATABASE', 'timeline_logger'),
80-
'USER': os.getenv('PGUSER', 'postgres'),
81-
'PASSWORD': os.getenv('PGPASSWORD', ''),
82-
'HOST': os.getenv('PGHOST', ''),
83-
'PORT': os.getenv('PGPORT', 5432),
75+
"default": {
76+
"ENGINE": "django.db.backends.postgresql",
77+
"NAME": os.getenv("PGDATABASE", "timeline_logger"),
78+
"USER": os.getenv("PGUSER", "postgres"),
79+
"PASSWORD": os.getenv("PGPASSWORD", ""),
80+
"HOST": os.getenv("PGHOST", ""),
81+
"PORT": os.getenv("PGPORT", 5432),
8482
}
8583
}
8684

@@ -90,26 +88,26 @@
9088

9189
AUTH_PASSWORD_VALIDATORS = [
9290
{
93-
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
91+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
9492
},
9593
{
96-
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
94+
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
9795
},
9896
{
99-
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
97+
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
10098
},
10199
{
102-
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
100+
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
103101
},
104102
]
105103

106104

107105
# Internationalization
108106
# https://docs.djangoproject.com/en/1.11/topics/i18n/
109107

110-
LANGUAGE_CODE = 'en-us'
108+
LANGUAGE_CODE = "en-us"
111109

112-
TIME_ZONE = 'UTC'
110+
TIME_ZONE = "UTC"
113111

114112
USE_I18N = True
115113

@@ -121,4 +119,4 @@
121119
# Static files (CSS, JavaScript, Images)
122120
# https://docs.djangoproject.com/en/1.11/howto/static-files/
123121

124-
STATIC_URL = '/static/'
122+
STATIC_URL = "/static/"

demo/demo/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
from django.contrib import admin
1818

1919
urlpatterns = [
20-
url(r'^admin/', admin.site.urls),
20+
url(r"^admin/", admin.site.urls),
2121
]

demo/demo_app/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
from import_export.admin import ExportMixin
44
from import_export.formats import base_formats
55
from import_export_xml.formats import XML
6-
from timeline_logger.models import TimelineLog
6+
77
from timeline_logger.admin import TimelineLogAdmin
8+
from timeline_logger.models import TimelineLog
89
from timeline_logger.resources import TimelineLogResource
910

1011
admin.site.unregister(TimelineLog)

demo/demo_app/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class DemoAppConfig(AppConfig):
5-
name = 'demo_app'
5+
name = "demo_app"

docs/conf.py

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# sys.path.insert(0, os.path.abspath('.'))
2323
from pkg_resources import get_distribution
2424

25-
FULL_VERSION = get_distribution('django-timeline-logger').version
25+
FULL_VERSION = get_distribution("django-timeline-logger").version
2626

2727
# -- General configuration ------------------------------------------------
2828

@@ -36,25 +36,25 @@
3636
extensions = []
3737

3838
# Add any paths that contain templates here, relative to this directory.
39-
templates_path = ['_templates']
39+
templates_path = ["_templates"]
4040

4141
# The suffix(es) of source filenames.
4242
# You can specify multiple suffix as a list of string:
4343
#
4444
# source_suffix = ['.rst', '.md']
45-
source_suffix = '.rst'
45+
source_suffix = ".rst"
4646

4747
# The encoding of source files.
4848
#
4949
# source_encoding = 'utf-8-sig'
5050

5151
# The master toctree document.
52-
master_doc = 'index'
52+
master_doc = "index"
5353

5454
# General information about the project.
55-
project = 'Django Timeline Logger'
56-
copyright = '2016-2018, Maykin Media'
57-
author = 'Maykin Media'
55+
project = "Django Timeline Logger"
56+
copyright = "2016-2018, Maykin Media"
57+
author = "Maykin Media"
5858

5959
# The version info for the project you're documenting, acts as replacement for
6060
# |version| and |release|, also used in various other places throughout the
@@ -84,7 +84,7 @@
8484
# List of patterns, relative to source directory, that match files and
8585
# directories to ignore when looking for source files.
8686
# This patterns also effect to html_static_path and html_extra_path
87-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
87+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
8888

8989
# The reST default role (used for this markup: `text`) to use for all
9090
# documents.
@@ -106,7 +106,7 @@
106106
# show_authors = False
107107

108108
# The name of the Pygments (syntax highlighting) style to use.
109-
pygments_style = 'sphinx'
109+
pygments_style = "sphinx"
110110

111111
# A list of ignored prefixes for module index sorting.
112112
# modindex_common_prefix = []
@@ -123,7 +123,7 @@
123123
# The theme to use for HTML and HTML Help pages. See the documentation for
124124
# a list of builtin themes.
125125
#
126-
html_theme = 'sphinx_rtd_theme'
126+
html_theme = "sphinx_rtd_theme"
127127

128128
# Theme options are theme-specific and customize the look and feel of a theme
129129
# further. For a list of options available for each theme, see the
@@ -237,34 +237,36 @@
237237
# html_search_scorer = 'scorer.js'
238238

239239
# Output file base name for HTML help builder.
240-
htmlhelp_basename = 'DjangoTimelineLoggerdoc'
240+
htmlhelp_basename = "DjangoTimelineLoggerdoc"
241241

242242
# -- Options for LaTeX output ---------------------------------------------
243243

244244
latex_elements = {
245-
# The paper size ('letterpaper' or 'a4paper').
246-
#
247-
# 'papersize': 'letterpaper',
248-
249-
# The font size ('10pt', '11pt' or '12pt').
250-
#
251-
# 'pointsize': '10pt',
252-
253-
# Additional stuff for the LaTeX preamble.
254-
#
255-
# 'preamble': '',
256-
257-
# Latex figure (float) alignment
258-
#
259-
# 'figure_align': 'htbp',
245+
# The paper size ('letterpaper' or 'a4paper').
246+
#
247+
# 'papersize': 'letterpaper',
248+
# The font size ('10pt', '11pt' or '12pt').
249+
#
250+
# 'pointsize': '10pt',
251+
# Additional stuff for the LaTeX preamble.
252+
#
253+
# 'preamble': '',
254+
# Latex figure (float) alignment
255+
#
256+
# 'figure_align': 'htbp',
260257
}
261258

262259
# Grouping the document tree into LaTeX files. List of tuples
263260
# (source start file, target name, title,
264261
# author, documentclass [howto, manual, or own class]).
265262
latex_documents = [
266-
(master_doc, 'DjangoTimelineLogger.tex', 'Django Timeline Logger Documentation',
267-
'Maykin Media', 'manual'),
263+
(
264+
master_doc,
265+
"DjangoTimelineLogger.tex",
266+
"Django Timeline Logger Documentation",
267+
"Maykin Media",
268+
"manual",
269+
),
268270
]
269271

270272
# The name of an image file (relative to this directory) to place at the top of
@@ -299,8 +301,13 @@
299301
# One entry per manual page. List of tuples
300302
# (source start file, name, description, authors, manual section).
301303
man_pages = [
302-
(master_doc, 'djangotimelinelogger', 'Django Timeline Logger Documentation',
303-
[author], 1)
304+
(
305+
master_doc,
306+
"djangotimelinelogger",
307+
"Django Timeline Logger Documentation",
308+
[author],
309+
1,
310+
)
304311
]
305312

306313
# If true, show URL addresses after external links.
@@ -314,9 +321,15 @@
314321
# (source start file, target name, title, author,
315322
# dir menu entry, description, category)
316323
texinfo_documents = [
317-
(master_doc, 'DjangoTimelineLogger', 'Django Timeline Logger Documentation',
318-
author, 'DjangoTimelineLogger', 'One line description of project.',
319-
'Miscellaneous'),
324+
(
325+
master_doc,
326+
"DjangoTimelineLogger",
327+
"Django Timeline Logger Documentation",
328+
author,
329+
"DjangoTimelineLogger",
330+
"One line description of project.",
331+
"Miscellaneous",
332+
),
320333
]
321334

322335
# Documents to append as an appendix to all manuals.
@@ -336,5 +349,5 @@
336349
# texinfo_no_detailmenu = False
337350

338351
linkcheck_ignore = [
339-
r'^http://localhost:\d+.*',
352+
r"^http://localhost:\d+.*",
340353
]

0 commit comments

Comments
 (0)