Browse Source

update: create form file

master
Lucas 1 month ago
parent
commit
f1c75ed9c5
  1. 9
      lua/django/utils.lua

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

Loading…
Cancel
Save