update: create form file

This commit is contained in:
Lucas F. 2024-12-17 10:32:20 -03:00
parent 5931cb012f
commit f1c75ed9c5

View file

@ -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,