How do I Share code between apps with django?
# ./commons/util.py def test(): return "White Mustang II" # ./api/views.py from django.http import HttpResponse from commons.util import test def test(request): return HttpResponse(test())
White Mustang II
Create a new app (python manage.py startapp commons) to use as shared code project. Reference to it by using 'from commons.util import ...' from your other apps
03 Jun 2019
Author: Loek van den Ouweland
Would you recommend this example to your colleagues?