diff --git a/Pipfile b/Pipfile index 5325444..3afedd3 100644 --- a/Pipfile +++ b/Pipfile @@ -14,6 +14,7 @@ pandoc = "*" pylint-django = "*" setuptools = "*" django-nose = "*" +invoke = "*" [packages] django = "*" @@ -30,3 +31,7 @@ showmigrations = "django_lostplaces/manage.py showmigrations" makemigrations = "django_lostplaces/manage.py makemigrations --no-input" migrate = "django_lostplaces/manage.py migrate" build = "django_lostplaces/setup.py bdist_wheel --universal" +createsuperuser = "django_lostplaces/manage.py createsuperuser --noinput --username admin --email admin@example.org" +createsuperuser_prompt = "django_lostplaces/manage.py createsuperuser" +quickstart = "invoke quickstart" +security = "pipenv check" \ No newline at end of file diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..149c14f --- /dev/null +++ b/tasks.py @@ -0,0 +1,21 @@ +from invoke import task + +@task +def quickstart(c): + commands = [ + 'pipenv run migrate', + 'pipenv run createsuperuser', + 'pipenv run server' + ] + c.run(' && '.join(commands)) + +@task +def live(c): + commands = [ + 'pipenv check', + 'pipenv run test', + 'pipenv run migrate', + 'pipenv run createsuperuser_prompt' + 'pipenv run server' + ] + c.run(' && '.join(commands)) \ No newline at end of file