mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-22 09:36:52 +03:00
use_pycharm variable, post_gen_project hook, {{ cookiecutter.repo_name }}/static marked as webResources
This commit is contained in:
parent
572de69658
commit
da6ba57f05
|
@ -15,6 +15,7 @@
|
|||
"use_sentry": "n",
|
||||
"use_newrelic": "n",
|
||||
"use_opbeat": "n",
|
||||
"use_pycharm": "n",
|
||||
"windows": "n",
|
||||
"use_python2": "n",
|
||||
"open_source_license": ["MIT", "BSD", "Not open source"]
|
||||
|
|
|
@ -3,7 +3,8 @@ Does the following:
|
|||
|
||||
1. Generates and saves random secret key
|
||||
2. Removes the taskapp if celery isn't going to be used
|
||||
3. Copy files from /docs/ to {{ cookiecutter.repo_name }}/docs/
|
||||
3. Removes the .idea directory if PyCharm isn't going to be used
|
||||
4. Copy files from /docs/ to {{ cookiecutter.repo_name }}/docs/
|
||||
|
||||
TODO: this might have to be moved to a pre_gen_hook
|
||||
|
||||
|
@ -100,6 +101,13 @@ def remove_task_app(project_directory):
|
|||
)
|
||||
shutil.rmtree(task_app_location)
|
||||
|
||||
|
||||
def remove_pycharm_dir(project_directory):
|
||||
"""Removes the .idea directory if PyCharm isn't going to be used"""
|
||||
idea_dir_location = os.path.join(PROJECT_DIRECTORY, '.idea/')
|
||||
shutil.rmtree(idea_dir_location)
|
||||
|
||||
|
||||
# IN PROGRESS
|
||||
# def copy_doc_files(project_directory):
|
||||
# cookiecutters_dir = DEFAULT_CONFIG['cookiecutters_dir']
|
||||
|
@ -125,5 +133,9 @@ make_secret_key(PROJECT_DIRECTORY)
|
|||
if '{{ cookiecutter.use_celery }}'.lower() == 'n':
|
||||
remove_task_app(PROJECT_DIRECTORY)
|
||||
|
||||
# 3. Copy files from /docs/ to {{ cookiecutter.repo_name }}/docs/
|
||||
# 3. Removes the .idea directory if PyCharm isn't going to be used
|
||||
if '{{ cookiecutter.use_pycharm }}'.lower() != 'y':
|
||||
remove_pycharm_dir(PROJECT_DIRECTORY)
|
||||
|
||||
# 4. Copy files from /docs/ to {{ cookiecutter.repo_name }}/docs/
|
||||
# copy_doc_files(PROJECT_DIRECTORY)
|
||||
|
|
2
{{cookiecutter.repo_name}}/.gitignore
vendored
2
{{cookiecutter.repo_name}}/.gitignore
vendored
|
@ -37,8 +37,10 @@ htmlcov
|
|||
*.mo
|
||||
*.pot
|
||||
|
||||
{% if cookiecutter.use_pycharm == 'y' %}
|
||||
# Pycharm
|
||||
.idea
|
||||
{% endif %}
|
||||
|
||||
# Vim
|
||||
|
||||
|
|
14
{{cookiecutter.repo_name}}/.idea/webResources.xml
Normal file
14
{{cookiecutter.repo_name}}/.idea/webResources.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="WebResourcesPaths">
|
||||
<contentEntries>
|
||||
<entry url="file://$PROJECT_DIR$">
|
||||
<entryData>
|
||||
<resourceRoots>
|
||||
<path value="file://$PROJECT_DIR$/{{ cookiecutter.repo_name }}/static" />
|
||||
</resourceRoots>
|
||||
</entryData>
|
||||
</entry>
|
||||
</contentEntries>
|
||||
</component>
|
||||
</project>
|
Loading…
Reference in New Issue
Block a user