def populate(env="local"): for app in discover_apps('edjango', only_names=True): # Check if we have the populate: populate_file = 'edjango/{}/management/commands/{}_populate.py'.format(app,app) if os.path.isfile(populate_file): print 'Poulate found for {} and executing...'.format(app) run("python manage.py {}_populate".format(app)) else: print 'No poulate found for {}... ({})'.format(app,populate_file)
Including another URLconf 1. Add an import: from blog import urls as blog_urls 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^admin/', include(admin.site.urls)), ] # Apps urls auto-discovery from edjango.common.utils import discover_apps import os for app in discover_apps('edjango', only_names=True): # Check if we have the urls: urls_file = 'edjango/{}/urls.py'.format(app,app) if os.path.isfile(urls_file): urlpatterns.append(url(r'^', include('edjango.{}.urls'.format(app))))