Sunday, November 26, 2017

Run manage.py test app_name command from view

 What I would like to do is to execute the tests.py by clicking a certain button.  I am trying to run the tests.py via views.py, but it gives me a 400 Bad Request error. Is there any other solution?
Your help would be very much appreciated.
Here's a snippet of the code:
from django.core.management import call_command
def start(request):
call_command('test appname')

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c5eb9d74-d290-4f6c-9c2b-82d184f0945e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment