|
1 |
| -"""Django settings for webapp project. |
| 1 | +""" |
| 2 | +Django settings for positron project. |
2 | 3 |
|
3 |
| -Generated by 'django-admin startproject' using Django 4.1.1. |
| 4 | +Generated by "django-admin startproject" using Django 5.1.5. |
4 | 5 |
|
5 |
| -For more information on this file, see: |
6 |
| -- https://docs.djangoproject.com/en/4.1/topics/settings/ |
| 6 | +For more information on this file, see |
| 7 | +https://docs.djangoproject.com/en/5.1/topics/settings/ |
7 | 8 |
|
8 |
| -For the full list of settings and their values, see: |
9 |
| -- https://docs.djangoproject.com/en/4.1/ref/settings/ |
| 9 | +For the full list of settings and their values, see |
| 10 | +https://docs.djangoproject.com/en/5.1/ref/settings/ |
10 | 11 | """
|
11 | 12 |
|
12 | 13 | from pathlib import Path
|
13 | 14 |
|
14 |
| -# Build paths inside the project like this: BASE_DIR / 'subdir'. |
15 |
| -BASE_DIR = Path(__file__).resolve().parent.parent |
16 |
| - |
| 15 | +from toga import App as TogaApp |
17 | 16 |
|
18 |
| -# Quick-start development settings - unsuitable for production |
19 |
| -# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ |
| 17 | +BASE_PATH = Path(__file__).parent / "resources" |
20 | 18 |
|
21 |
| -# SECURITY WARNING: keep the secret key used in production secret! |
22 |
| -SECRET_KEY = "django-insecure-mcl=_9h9=1h)*%pbt8%*!n724ik0@v25b-=s0*v0bazgrnepyl" |
23 |
| - |
24 |
| -# SECURITY WARNING: don't run with debug turned on in production! |
| 19 | +# A Positron app is only ever serving to itself, so a lot of the usual advice about |
| 20 | +# Django best practices in production don't apply. The secret key doesn't need to be |
| 21 | +# *that* secret; and running in debug mode (with staticfiles) is fine. |
| 22 | +SECRET_KEY = "django-insecure-%vgal2@#0@feqe3jz@1d+f95c*@)2f9n^v9@#%&po5+ct7plwz" |
25 | 23 | DEBUG = True
|
26 | 24 |
|
27 | 25 | ALLOWED_HOSTS = []
|
|
48 | 46 | "django.middleware.clickjacking.XFrameOptionsMiddleware",
|
49 | 47 | ]
|
50 | 48 |
|
51 |
| -ROOT_URLCONF = "webapp.urls" |
| 49 | +ROOT_URLCONF = "positron.urls" |
52 | 50 |
|
53 | 51 | TEMPLATES = [
|
54 | 52 | {
|
|
66 | 64 | },
|
67 | 65 | ]
|
68 | 66 |
|
69 |
| -WSGI_APPLICATION = "webapp.wsgi.application" |
| 67 | +WSGI_APPLICATION = "positron.wsgi.application" |
70 | 68 |
|
71 | 69 |
|
72 | 70 | # Database
|
73 |
| -# https://docs.djangoproject.com/en/4.1/ref/settings/#databases |
| 71 | +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases |
74 | 72 |
|
75 | 73 | DATABASES = {
|
76 | 74 | "default": {
|
77 | 75 | "ENGINE": "django.db.backends.sqlite3",
|
78 |
| - "NAME": BASE_DIR / "db.sqlite3", |
| 76 | + "NAME": (TogaApp.app.paths.data if TogaApp.app else BASE_PATH) / "db.sqlite3", |
79 | 77 | }
|
80 | 78 | }
|
81 | 79 |
|
82 |
| - |
83 | 80 | # Password validation
|
84 |
| -# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators |
| 81 | +# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators |
85 | 82 |
|
86 | 83 | AUTH_PASSWORD_VALIDATORS = [
|
87 | 84 | {
|
88 |
| - "NAME": ( |
89 |
| - "django.contrib.auth.password_validation." |
90 |
| - "UserAttributeSimilarityValidator" |
91 |
| - ), |
| 85 | + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", # noqa: E501 |
92 | 86 | },
|
93 | 87 | {
|
94 | 88 | "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
|
103 | 97 |
|
104 | 98 |
|
105 | 99 | # Internationalization
|
106 |
| -# https://docs.djangoproject.com/en/4.1/topics/i18n/ |
| 100 | +# https://docs.djangoproject.com/en/5.1/topics/i18n/ |
107 | 101 |
|
108 | 102 | LANGUAGE_CODE = "en-us"
|
109 | 103 |
|
|
115 | 109 |
|
116 | 110 |
|
117 | 111 | # Static files (CSS, JavaScript, Images)
|
118 |
| -# https://docs.djangoproject.com/en/4.1/howto/static-files/ |
| 112 | +# https://docs.djangoproject.com/en/5.1/howto/static-files/ |
119 | 113 |
|
120 | 114 | STATIC_URL = "static/"
|
| 115 | +STATIC_ROOT = BASE_PATH / "static" |
121 | 116 |
|
122 | 117 | # Default primary key field type
|
123 |
| -# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field |
| 118 | +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field |
124 | 119 |
|
125 | 120 | DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
0 commit comments