-
Notifications
You must be signed in to change notification settings - Fork 17
Add app configurations for all apps #1624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mwvolo
wants to merge
5
commits into
main
Choose a base branch
from
update-app-structure
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
""" | ||
Accounts app for OpenStax CMS. | ||
""" | ||
|
||
default_app_config = 'accounts.apps.AccountsConfig' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
App configuration for the accounts app. | ||
""" | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class AccountsConfig(AppConfig): | ||
""" | ||
App configuration for the accounts app. | ||
""" | ||
name = 'accounts' | ||
verbose_name = 'Accounts' | ||
|
||
def ready(self): | ||
""" | ||
Perform initialization when the app is ready. | ||
Import signal handlers here to avoid circular imports. | ||
""" | ||
# Import signal handlers | ||
# import accounts.signals |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
""" | ||
API app for OpenStax CMS. | ||
""" | ||
|
||
default_app_config = 'api.apps.ApiConfig' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
App configuration for the api app. | ||
""" | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class ApiConfig(AppConfig): | ||
""" | ||
App configuration for the api app. | ||
""" | ||
name = 'api' | ||
verbose_name = 'API' | ||
|
||
def ready(self): | ||
""" | ||
Perform initialization when the app is ready. | ||
Import signal handlers here to avoid circular imports. | ||
""" | ||
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
""" | ||
Books app for OpenStax CMS. | ||
""" | ||
|
||
default_app_config = 'books.apps.BooksConfig' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
App configuration for the books app. | ||
""" | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class BooksConfig(AppConfig): | ||
""" | ||
App configuration for the books app. | ||
""" | ||
name = 'books' | ||
verbose_name = 'Books' | ||
|
||
def ready(self): | ||
""" | ||
Perform initialization when the app is ready. | ||
Import signal handlers here to avoid circular imports. | ||
""" | ||
# Import signal handlers if they exist | ||
# import books.signals |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
""" | ||
Donations app for OpenStax CMS. | ||
""" | ||
|
||
default_app_config = 'donations.apps.DonationsConfig' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
""" | ||
App configuration for the donations app. | ||
""" | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class DonationsConfig(AppConfig): | ||
""" | ||
App configuration for the donations app. | ||
""" | ||
name = 'donations' | ||
verbose_name = 'Donations' | ||
|
||
def ready(self): | ||
""" | ||
Perform initialization when the app is ready. | ||
Import signal handlers here to avoid circular imports. | ||
""" | ||
# Import signal handlers if they exist | ||
# import donations.signals |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
""" | ||
Errata app for OpenStax CMS. | ||
""" | ||
|
||
default_app_config = 'errata.apps.ErrataConfig' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" | ||
App configuration for the errata app. | ||
""" | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class ErrataConfig(AppConfig): | ||
""" | ||
App configuration for the errata app. | ||
""" | ||
name = 'errata' | ||
verbose_name = 'Errata' | ||
|
||
def ready(self): | ||
""" | ||
Perform initialization when the app is ready. | ||
Import signal handlers here to avoid circular imports. | ||
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
#default_app_config = 'global_settings.apps.GlobalSettingsConfig' | ||
""" | ||
Global Settings app for OpenStax CMS. | ||
""" | ||
|
||
default_app_config = 'global_settings.apps.GlobalSettingsConfig' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
""" | ||
Mail app for OpenStax CMS. | ||
""" | ||
|
||
default_app_config = 'mail.apps.MailConfig' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
App configuration for the mail app. | ||
""" | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class MailConfig(AppConfig): | ||
""" | ||
App configuration for the mail app. | ||
""" | ||
name = 'mail' | ||
verbose_name = 'Mail' | ||
|
||
def ready(self): | ||
""" | ||
Perform initialization when the app is ready. | ||
Import signal handlers here to avoid circular imports. | ||
""" | ||
# Import signal handlers if they exist | ||
# import mail.signals |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
""" | ||
News app for OpenStax CMS. | ||
""" | ||
|
||
default_app_config = 'news.apps.NewsConfig' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
App configuration for the news app. | ||
""" | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class NewsConfig(AppConfig): | ||
""" | ||
App configuration for the news app. | ||
""" | ||
name = 'news' | ||
verbose_name = 'News' | ||
|
||
def ready(self): | ||
""" | ||
Perform initialization when the app is ready. | ||
Import signal handlers here to avoid circular imports. | ||
""" | ||
# Import signal handlers if they exist | ||
# import news.signals |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
""" | ||
OpenStax CMS Settings | ||
|
||
This module imports the appropriate settings based on the environment. | ||
""" | ||
|
||
import os | ||
|
||
# Determine the environment | ||
ENVIRONMENT = os.getenv('ENVIRONMENT', 'local') | ||
|
||
# Import the base settings | ||
from .base import * | ||
|
||
# Import environment-specific settings | ||
if ENVIRONMENT == 'prod': | ||
from .prod import * | ||
elif ENVIRONMENT == 'test': | ||
from .test import * | ||
elif ENVIRONMENT == 'docker': | ||
from .docker import * | ||
else: | ||
# Local development | ||
try: | ||
from .local import * | ||
except ImportError: | ||
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Settings components for OpenStax CMS. | ||
|
||
This package contains modular settings components that can be imported | ||
and combined to create the final settings for different environments. | ||
""" | ||
|
||
from . import core | ||
from . import apps | ||
from . import database | ||
from . import storage | ||
from . import security | ||
from . import logging | ||
from . import api | ||
from . import accounts | ||
from . import cron | ||
from . import i18n | ||
from . import sentry | ||
from . import wagtail | ||
from . import caching |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" | ||
OpenStax Accounts settings for OpenStax CMS. | ||
|
||
This module contains settings related to OpenStax Accounts integration. | ||
""" | ||
|
||
import os | ||
|
||
# Base URL for accounts | ||
BASE_URL = os.getenv('BASE_URL', 'https://openstax.org') | ||
|
||
# OpenStax Accounts settings | ||
ACCOUNTS_URL = os.getenv('ACCOUNTS_DOMAIN', f'{BASE_URL}/accounts') | ||
AUTHORIZATION_URL = os.getenv('ACCOUNTS_AUTHORIZATION_URL', f'{ACCOUNTS_URL}/oauth/authorize') | ||
ACCESS_TOKEN_URL = os.getenv('ACCOUNTS_ACCESS_TOKEN_URL', f'{ACCOUNTS_URL}/oauth/token') | ||
USER_QUERY = os.getenv('ACCOUNTS_USER_QUERY', f'{ACCOUNTS_URL}/api/user?') | ||
USERS_QUERY = os.getenv('ACCOUNTS_USERS_QUERY', f'{ACCOUNTS_URL}/api/users?') | ||
|
||
# Social auth settings | ||
SOCIAL_AUTH_OPENSTAX_KEY = os.getenv('SOCIAL_AUTH_OPENSTAX_KEY') | ||
SOCIAL_AUTH_OPENSTAX_SECRET = os.getenv('SOCIAL_AUTH_OPENSTAX_SECRET') | ||
SOCIAL_AUTH_LOGIN_REDIRECT_URL = os.getenv('SOCIAL_AUTH_LOGIN_REDIRECT_URL', BASE_URL) | ||
SOCIAL_AUTH_SANITIZE_REDIRECTS = os.getenv('SOCIAL_AUTH_SANITIZE_REDIRECTS') == 'True' | ||
|
||
# SSO settings | ||
SSO_COOKIE_NAME = os.getenv('SSO_COOKIE_NAME', 'oxa') | ||
SIGNATURE_PUBLIC_KEY = os.getenv('SSO_SIGNATURE_PUBLIC_KEY', """ | ||
-----BEGIN PUBLIC KEY----- | ||
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjvO/E8lO+ZJ7JMglbJyiF5/Ae | ||
IIS2NKbIAMLBMPVBQY7mSqo6j/yxdVNKZCzYAMDWc/VvEfXQQJ2ipIUuDvO+SOwz | ||
MewQ70hC71hC4s3dmOSLnixDJlnsVpcnKPEFXloObk/fcpK2Vw27e+yY+kIFmV2X | ||
zrvTnmm9UJERp6tVTQIDAQAB | ||
-----END PUBLIC KEY----- | ||
""") | ||
ENCRYPTION_PRIVATE_KEY = os.getenv('SSO_ENCRYPTION_PRIVATE_KEY', "c6d9b8683fddce8f2a39ac0565cf18ee") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
REST Framework settings for OpenStax CMS. | ||
|
||
This module contains settings for Django REST Framework. | ||
""" | ||
|
||
# Django Rest Framework settings | ||
REST_FRAMEWORK = { | ||
'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',), | ||
'DEFAULT_AUTHENTICATION_CLASSES': ( | ||
'rest_framework.authentication.TokenAuthentication', | ||
), | ||
'DEFAULT_PERMISSION_CLASSES': ( | ||
'rest_framework.permissions.AllowAny', | ||
), | ||
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.URLPathVersioning', | ||
'DEFAULT_VERSION': 'v1', | ||
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', | ||
'PAGE_SIZE': 100 | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] If the commented-out signal import is not needed, consider removing it to reduce clutter, or add a note explaining its anticipated future use.
Copilot uses AI. Check for mistakes.