0

I was wondering that if its possible to run custom django commands like startapp sampleapp from admin dashboard. I have a app registered in my project and i created the management and commands folder in that app and run want to know that how i pro-grammatically create the another app by going into django dashboard and in specific app. Something like trigger functionality like on button, when button click it execute the command which create the another djangoapp.

Your suggestions are appreciated.

Bilal Ahmed
  • 119
  • 1
  • 11
  • 2
    Possible duplicate of https://stackoverflow.com/questions/12246665/django-how-to-call-management-custom-command-execution-from-admin-interface – alter123 Nov 28 '19 at 09:10
  • Can you provide me any further guideline on about how to run python manage.py startapp sampleapp from custom commands. This article is useful but i am beginner so i need some more instructions on this. – Bilal Ahmed Nov 28 '19 at 09:31
  • Please provide relevant code for your admin and your management command. – alter123 Nov 28 '19 at 09:35
  • Guess you can ovverride one of the admin templates: https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#overriding-admin-templates But the second part that is about creating a django app dynamically is a tricky one. One of the issues would be that you need to add the new app in the django.settings INSTALLED_APPS. But Django does not recommend to alter settings in runtime: https://docs.djangoproject.com/en/2.2/topics/settings/#altering-settings-at-runtime – gagamil Nov 28 '19 at 12:51

0 Answers0