Skip to content

Commit

Permalink
Add karaage script
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmay committed Oct 28, 2023
1 parent f2d0a5e commit ced1edc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

in {
packages = {
karaage = mkPoetryApplication {
karaage = p2n.mkPoetryApplication {
projectDir = self;
overrides = p2n.overrides.withDefaults (final: prev: {
#nh3 = prev.nh3.override { preferWheel = true; };
Expand Down
7 changes: 7 additions & 0 deletions karaage/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import os
import sys
from django.core.management import execute_from_command_line

def manage():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'karaage.conf.settings')
execute_from_command_line(sys.argv)
19 changes: 1 addition & 18 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,5 @@

if __name__ == "__main__":
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'karaage.conf.settings')

try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
execute_from_command_line = None
try:
import django # pylint:disable=unused-import
except ImportError:
django = None
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 120

[tool.poetry.scripts]
karaage = "karaage.cli:manage"

0 comments on commit ced1edc

Please sign in to comment.