Skip to content
Snippets Groups Projects
Commit c49258af authored by plup's avatar plup
Browse files

feature: added runserver command for djangoldp

parent 7833dd07
No related branches found
No related tags found
No related merge requests found
...@@ -88,3 +88,18 @@ def configure(): ...@@ -88,3 +88,18 @@ def configure():
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
click.echo(f'Configuration error: {e}') click.echo(f'Configuration error: {e}')
@main.command()
def runserver():
"""Run the Django embeded webserver."""
try:
# shortcut to the djangoldp.management command
path = str(Path.cwd() / 'manage.py')
cmd = [sys.executable, path, 'runserver', '0.0.0.0:8000']
subprocess.run(cmd).check_returncode()
except subprocess.CalledProcessError as e:
click.echo(f'Execution error: {e}')
...@@ -6,7 +6,7 @@ from django.core.exceptions import ValidationError ...@@ -6,7 +6,7 @@ from django.core.exceptions import ValidationError
class Command(BaseCommand): class Command(BaseCommand):
help = 'Install server dependencies' help = 'Initialize the DjangoLDP backend'
def handle(self, *args, **options): def handle(self, *args, **options):
......
...@@ -5,6 +5,3 @@ dependencies: ...@@ -5,6 +5,3 @@ dependencies:
ldppackages: ldppackages:
- djangoldp_account - djangoldp_account
- oidc_provider - oidc_provider
server:
site_url: 'https://localhost:8000'
# Using the client # Using the client
Setup the project:
``` ```
# docker run --rm -v $PWD:/code -w /code -it python:3.6 bash # docker run --rm -v $PWD:/code -w /code -p 127.0.0.1:8000:8000 -it python:3.6 bash
# pip install . # pip install .
# cd /tmp/ # cd /tmp/
# djangoldp start myproject # djangoldp startproject myproject
# cd myproject # cd myproject
# djangoldp install # djangoldp install
# djangoldp configure # djangoldp configure
``` ```
Play with the installation: Play with it:
``` ```
# python manage.py runserver # djangoldp runserver
``` ```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment