How to pass extra arguments to startapp command in bash?

152 Views Asked by At

I want to pass values to template_context and the docs says: Any option passed to the startapp command (among the command’s supported options)

What I understand is, that any extra argument that I pass, it will be set to the context dictionary. But I'm receiving the same error (django-admin startapp: error: unrecognized arguments: --options=ok)

django-admin startapp name_app --template="./templates" --options="ok"

I also tried with - and without it

django-admin startapp name_app --template="./templates" -a_value="ok"

and

django-admin startapp name_app --template="./templates" some_value="ok"

How am I supposed to add the extra arguments? I know must be something easy, but I'm stuck for too much time now, and I couldn't find an example that uses it.

I'm using Django version 4.0.1

1

There are 1 best solutions below

1
soField On

I do not think you can pass something to template context within command

according to docs only template as I understand

https://docs.djangoproject.com/en/4.0/ref/django-admin/#cmdoption-startapp-template