diff --git a/djangoldp/management/commands/install.py b/djangoldp/management/commands/install.py new file mode 100644 index 0000000000000000000000000000000000000000..3c2b475bc93beacbc0249de564dd08b9596c163e --- /dev/null +++ b/djangoldp/management/commands/install.py @@ -0,0 +1,22 @@ +import subprocess +import sys +from django.core.management.base import BaseCommand, CommandError + +class Command(BaseCommand): + + help = 'Install server dependencies' + + def handle(self, *args, **options): + + try: + # load dependencies from the configuration + from django.conf import settings + cmd = [sys.executable, "-m", "pip", "install"] + cmd.extend(settings.DEPENDENCIES) + subprocess.run(cmd).check_returncode() + + self.stdout.write(self.style.SUCCESS('Installation done!')) + + except subprocess.CalledProcessError as e: + self.stderr.write(self.style.ERROR(f'Error with: {e}')) + diff --git a/djangoldp/templates/production/packages.yml b/djangoldp/templates/production/config.yml similarity index 100% rename from djangoldp/templates/production/packages.yml rename to djangoldp/templates/production/config.yml diff --git a/djangoldp/templates/production/project_name/__init__.py-tpl b/djangoldp/templates/production/server/__init__.py-tpl similarity index 100% rename from djangoldp/templates/production/project_name/__init__.py-tpl rename to djangoldp/templates/production/server/__init__.py-tpl diff --git a/djangoldp/templates/production/project_name/settings.py-tpl b/djangoldp/templates/production/server/settings.py-tpl similarity index 100% rename from djangoldp/templates/production/project_name/settings.py-tpl rename to djangoldp/templates/production/server/settings.py-tpl diff --git a/djangoldp/templates/production/project_name/urls.py-tpl b/djangoldp/templates/production/server/urls.py-tpl similarity index 100% rename from djangoldp/templates/production/project_name/urls.py-tpl rename to djangoldp/templates/production/server/urls.py-tpl diff --git a/djangoldp/templates/production/project_name/wsgi.py-tpl b/djangoldp/templates/production/server/wsgi.py-tpl similarity index 100% rename from djangoldp/templates/production/project_name/wsgi.py-tpl rename to djangoldp/templates/production/server/wsgi.py-tpl