fix(base): supprime la page home avec Wagtail
Parent
4286f5794d
révision
ab413b7340
|
@ -14,16 +14,26 @@ ASSETS_DIRS = (
|
|||
'styleguide',
|
||||
)
|
||||
|
||||
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
|
||||
ROOT_DIR = os.path.realpath(os.path.curdir)
|
||||
PROJECT_DIR = os.path.join(ROOT_DIR, '{{ cookiecutter.project_slug }}')
|
||||
|
||||
|
||||
def remove_assets_files():
|
||||
"""Remove assets related files and directories."""
|
||||
for path in ASSETS_FILES:
|
||||
os.remove(os.path.join(PROJECT_DIRECTORY, path))
|
||||
os.remove(os.path.join(ROOT_DIR, path))
|
||||
for path in ASSETS_DIRS:
|
||||
shutil.rmtree(os.path.join(PROJECT_DIRECTORY, path))
|
||||
shutil.rmtree(os.path.join(ROOT_DIR, path))
|
||||
|
||||
|
||||
def remove_home_page():
|
||||
"""Remove home view and template."""
|
||||
os.remove(os.path.join(PROJECT_DIR, 'base/urls.py'))
|
||||
os.remove(os.path.join(PROJECT_DIR, 'templates/pages/home.html'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if '{{ cookiecutter.use_assets }}'.lower() != 'y':
|
||||
remove_assets_files()
|
||||
if '{{ cookiecutter.use_wagtail }}'.lower() == 'y':
|
||||
remove_home_page()
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket