0

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 Answers1

0

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

soField
  • 2,536
  • 9
  • 36
  • 44
  • Did you find the part that says: `Any option passed to the startapp command (among the command’s supported options)` –  Jan 26 '22 at 09:00