mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-22 01:26:57 +03:00
Fix issue with Heroku + Django Compressor
This commit is contained in:
parent
6f76309759
commit
68116dcdea
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -211,7 +211,6 @@ tags
|
|||
### VirtualEnv template
|
||||
# Virtualenv
|
||||
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
|
||||
[Bb]in
|
||||
[Ii]nclude
|
||||
[Ll]ib
|
||||
[Ll]ib64
|
||||
|
|
|
@ -75,6 +75,11 @@ def remove_heroku_files():
|
|||
# don't remove the file if we are using travisci but not using heroku
|
||||
continue
|
||||
os.remove(file_name)
|
||||
remove_heroku_build_hooks()
|
||||
|
||||
|
||||
def remove_heroku_build_hooks():
|
||||
shutil.rmtree("bin")
|
||||
|
||||
|
||||
def remove_gulp_files():
|
||||
|
@ -346,6 +351,8 @@ def main():
|
|||
|
||||
if "{{ cookiecutter.use_heroku }}".lower() == "n":
|
||||
remove_heroku_files()
|
||||
elif "{{ cookiecutter.use_compressor }}".lower() == "n":
|
||||
remove_heroku_build_hooks()
|
||||
|
||||
if (
|
||||
"{{ cookiecutter.use_docker }}".lower() == "n"
|
||||
|
|
1
{{cookiecutter.project_slug}}/.gitignore
vendored
1
{{cookiecutter.project_slug}}/.gitignore
vendored
|
@ -325,7 +325,6 @@ tags
|
|||
|
||||
### VirtualEnv template
|
||||
# Virtualenv
|
||||
[Bb]in
|
||||
[Ii]nclude
|
||||
[Ll]ib
|
||||
[Ll]ib64
|
||||
|
|
22
{{cookiecutter.project_slug}}/bin/post_compile
Normal file
22
{{cookiecutter.project_slug}}/bin/post_compile
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
compress_enabled() {
|
||||
python << END
|
||||
import sys
|
||||
|
||||
from environ import Env
|
||||
|
||||
env = Env(COMPRESS_ENABLED=(bool, True))
|
||||
if env('COMPRESS_ENABLED'):
|
||||
sys.exit(0)
|
||||
else:
|
||||
sys.exit(1)
|
||||
|
||||
END
|
||||
}
|
||||
|
||||
if compress_enabled
|
||||
then
|
||||
python manage.py compress
|
||||
fi
|
||||
python manage.py collectstatic --noinput
|
Loading…
Reference in New Issue
Block a user