Setting up the vue file

Vue may not correctly work with the same template tags as django, i.e {{ }}. So we will modify this.

At vueapp/src/main.js:

import { createApp } from 'vue'
import App from './App.vue'


In vueapp/src/App.vue:

    Here is some data if vue is working. Start. {{ dummydata }} Stop.

export default {
  name: "App",
  components: {
  delimiters: ['[[',']]'],
  data() {
    return {
      dummydata: "My New Dummy Data. Vue is working!",

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;

My main project (gettingstarted/

from django.urls import path, include, re_path
from django.contrib import admin
import shorten.views
urlpatterns = [   
    path('api/', include('api.urls')),
    path('', include('shorten.urls')),
    re_path(r'^(?P<url>.*)/$', include('shorten.urls')),

In the app’s (shorten/

from django.urls import path, include, re_path
from django.conf import settings
from . import views
from django.conf.urls.static import static
from django.contrib import admin

urlpatterns = [
    path('', views.main, name="main"),
    path('<path:shortlink>', views.catchlink),
] + static(
    settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

from django.http.request import HttpRequest
from django.http.response import HttpResponse
from django.shortcuts import render, redirect
from rest_framework import generics
from rest_framework.permissions import IsAuthenticated 
from rest_framework.authentication import TokenAuthentication
from .models import ShortLink
from api.serializers import ShortLinkSerializer

def main(request):
    return render(
        request, 'shorten/landing.html', {

At shorten/templates/shorten/landing.html:

  <div class="col-lg-3 col-md-6 col-sm-12 text-center">
    <div class="card tasks_report">
      <div class="header">
        <h2>Short Links<small>All your created links</small></h2>
      <div class="body">
        <ul id="app" class="inbox-widget list-unstyled clearfix">
          <li class="inbox-inner">            

After making changes in vue code, we need to run:

yarn build