Эх сурвалжийг харах

HUE-8317 [core] App SDK should generate views in the proper format

Roohi 7 жил өмнө
parent
commit
bf2556e51f

+ 2 - 1
desktop/core/src/desktop/app_template/src/app_name/urls.py

@@ -16,7 +16,8 @@
 # limitations under the License.
 
 from django.conf.urls import url
+from ${app_name} import views
 
 urlpatterns = [
-  url(r'^$', ${app_name}.views.index),
+  url(r'^$', views.index),
 ]

+ 3 - 0
desktop/core/src/desktop/management/commands/create_desktop_app.py

@@ -32,6 +32,9 @@ class Command(BaseCommand):
   args = "[appname]"
   label = _('application name')
 
+  def add_arguments(self, parser):
+    parser.add_argument('args', nargs='*')
+
   def handle(self, *args, **options):
     if len(args) > 2 or len(args) == 0:
       raise CommandError(_("Expected arguments: app_name [app_dir]"))