DEV Community

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

 
ariera profile image
Alejandro Riera

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 :)

Thread Thread
 
vmihalachi profile image
Vlad Mihalachi

Thanks man, you are great!