diff --git a/lua/django/utils.lua b/lua/django/utils.lua index 916a01d..c5acac7 100644 --- a/lua/django/utils.lua +++ b/lua/django/utils.lua @@ -103,6 +103,14 @@ local function file_exists(name) end end +local function create_form_file(dir) + local file = io.open(helpers.add_trailing_slash(dir) .. "forms.py", "w") + if file ~= nil then + file:write("from django import forms") + io.close(file) + end +end + local function create_template_static_dirs(name, dir) execute_command(os.execute, "mkdir -p " .. dir .. "/static/" .. name .. "/css") execute_command(os.execute, "mkdir -p " .. dir .. "/static/" .. name .. "/img") @@ -135,6 +143,7 @@ local function perform_create_app(value) end execute_command(os.execute, "./manage.py startapp " .. appname .. " " .. value) if check_app(value) == true then + create_form_file(value) create_template_static_dirs(value, value) execute_command( os.execute,