Skip to content

Commit 03a03ea

Browse files
committed
react and translation false code fix
1 parent 12f520f commit 03a03ea

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

hooks/post_gen_project.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def make_secret_key(project_directory):
3939
{% if cookiecutter.use_translation != 'True' -%}
4040
# Remove the empty directory if we don't want to use rosetta
4141
shutil.rmtree(PROJECT_DIR + '/src/core/management/')
42+
shutil.rmtree(PROJECT_DIR + '/src/core/templates/admin/')
43+
shutil.rmtree(PROJECT_DIR + '/src/core/templates/rosetta/')
4244
{%- endif %}
4345

4446
{% if cookiecutter.use_react != 'True' -%}

{{cookiecutter.repo_name}}/.secret

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
DJANGO_SECRET_KEY={SECRET_KEY}
22
DB_PASSWORD={{cookiecutter.db_password}}
3-
ALLOWED_HOSTS=
3+
ALLOWED_HOSTS={% if cookiecutter.use_translation == 'True' %}
44
YANDEX_TRANSLATE_KEY=
5+
{%- endif %}
56
EMAIL_HOST_USER={{cookiecutter.email_host_user}}
67
EMAIL_HOST_PASSWORD={{cookiecutter.email_host_password}}
78
STATIC_ROOT=/data/static/

{{cookiecutter.repo_name}}/src/core/templates/home.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ <h1 class="cover-heading">{% trans "It worked!" %}</h1>
4141
</div>
4242
</div>
4343
</div>{% endraw %}{% endif %}
44-
<script src="{% if cookiecutter.use_translation == 'True' %}{% raw %}/{{LANGUAGE_CODE}}{% endraw %}{% endif %}{% raw %}/jsi18n/"></script>
45-
{% compress js %}
46-
{% endraw %}
47-
{% if cookiecutter.use_react == 'True' -%}{% raw %}<script src="{% static "react/app.js" %}"></script>{% endraw %}{% endif -%}{% raw %}
44+
<script src="{% if cookiecutter.use_translation == 'True' %}{% raw %}/{{LANGUAGE_CODE}}{% endraw %}{% endif %}/jsi18n/"></script>
45+
{% if cookiecutter.use_react == 'True' -%}{% raw %}
46+
{% compress js %}
47+
<script src="{% static "react/app.js" %}"></script>
4848
{% endcompress %}
49+
{% endraw %}{% endif -%}
4950
</body>
5051
</html>
51-
{% endraw %}

0 commit comments

Comments
 (0)