Un modèle pour démarrer un nouveau projet Django.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
960 B

import os
import shutil
ASSETS_FILES = (
'.browserslistrc',
'.eslintrc.json',
'.stylelintrc.json',
'package.json',
'webpack.config.js',
)
ASSETS_DIRS = (
'assets',
'styleguide',
)
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(ROOT_DIR, path))
for path in ASSETS_DIRS:
shutil.rmtree(os.path.join(ROOT_DIR, path))
def remove_home_page():
"""Remove home view and template."""
os.remove(os.path.join(PROJECT_DIR, 'core/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()
Map all the world