Skip to content
loading...

re: Django + webpack + Vue.js: setting up a new project that’s easy to develop and deploy (part 1) VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Yep, adding something like that solved the problem :) gist.github.com/vmihalachi/7bceb1a...

Hey Vlad,

yes, that's exactly the solution. In my case I ended up creating a context_processor called env, like this:

from django.conf import settings

def env(request):
    return {'env': settings.ENVIRONMENT}

That allows me to check agains the environment instead of DEBUG in my templates, ie:

{% if env == 'production' %}
  {% render_bundle 'manifest' %}
  {% render_bundle 'vendor' %}
{% endif %}
{% render_bundle 'app' %}

I'll treat this and a few more issue in the second part :)

code of conduct - report abuse