I want to create a docx file using django. I have already installed python-docx on my laptop, I used this command pip install python-docx and I even created a .docx file on my desktop but I do not how to use this on my django project. First of all, do I need modify settings.py from my project in order to import python-docx to django? by the way I want to create these files when someone visit my urls app I have an app called 'planeaciones' and these are my main files:
views.py
from django.http import HttpResponse
from django.shortcuts import render
def index(request):
return render(request, 'planeaciones/index.html')
urls.py
from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
]
index template
{% extends 'base.html' %}
{% block title %}Planeaciones{% endblock %}
{% block content %}
<h3 class="text-center">Mis planeaciones</h3>
<p></p>
{% if user.is_superuser %}
<p>Hola Administrador</p>
{% endif %}
{% endblock %}