-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Functioning test for checking viable python versions * Remove Python 3.8 support
- Loading branch information
Showing
6 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,13 +1,31 @@ | ||
import django | ||
import os | ||
from django.core.management.color import no_style | ||
from django.conf import settings as django_settings | ||
from django_extensions.management import shells | ||
|
||
|
||
from .shell_plus import Plus | ||
|
||
|
||
def activate(settings: str) -> Plus: | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings) | ||
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true" | ||
django.setup() | ||
if settings == "test_harness": | ||
# Used for testing | ||
# NOTE: This is bad code smell, we'll improve on it | ||
# when we have a better idea of what we're doing | ||
django_settings.configure( | ||
INSTALLED_APPS=[ | ||
"django.contrib.admin", | ||
"django.contrib.auth", | ||
"django.contrib.contenttypes", | ||
"django.contrib.sessions", | ||
"django.contrib.messages", | ||
"django.contrib.staticfiles", | ||
] | ||
) | ||
else: | ||
# Used for standard operations | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings) | ||
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true" | ||
django.setup() | ||
return Plus(shells.import_objects({"quiet_load": True}, no_style())) |
This file contains 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 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