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

2
  • What Django version are you using? Commented Jan 25, 2022 at 17:50
  • >>> django.__version__ === '4.0.1' Commented Jan 25, 2022 at 17:51

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Did you find the part that says: Any option passed to the startapp command (among the command’s supported options)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.