Webflow to Django: Template Preparation Guide
Guide to integrate Webflow designs into Django projects, including exporting, organizing, and scripting for seamless template preparation

Lover of coding, software development/engineering, indie hackers podcast/community, start-ups, music, guitar, technology, fitness, running, biking, learning new things, travel, the beach, and hiking/mountains.
As a kid I had too many interests. I grew up playing soccer from an early age and played through college! Sports and being a part of a team was always part of my DNA. Not only did I value sports and competition but I loved music, art, drawing, animation, film, computers, math, and learning.
Once I hit college, the decision to choose my life path was paralyzing, and ultimately led me down many different paths. I explored economics, finance, psychology, philosophy, statistics, communications, and marketing. I graduated with a finance degree and thought the data science, statistics, and the trends and patterns would be a fun career, however my first entry level job in the industry discouraged me to continue in the industry and to explore other paths.
I always had an itch to build and start something on my own or with family. Growing up I started a lawn mowing business, shoveling business, lemonade stands, and small Wordpress websites. I loved the creativity of coming up with ideas on how to help people and make money at the same time.
I realized I loved technology, and seeing what could be created and started with technology really urged me to start down the path of learning how to code. My brother and I had an idea for a college social network (similar to Facebook), geared solely towards education and only for students at your college. We wanted to give students the ability to meet people on campus, finding work, organize course material, share notes and materials, find extracurricular activities, sell textbooks and furniture. I took it upon myself to learn how to build something like that. Basically taking an idea and making it happen. I learned about software development, coding languages, web frameworks, startups, marketing all on my own.
I took online free courses, watched videos and tutorials about Django, Python, Javascript, HTML, and databases. I absolutely loved everything about the process. Seeing my work come to life and seeing people use what I created. It satisfied everything that I enjoyed growing up. The creativity, the design, artwork, coming up with a business, learning new things at my own pace, however I learned best, and working with my brother. I did all this while working full-time at a financial institution during my nights and weekends.
We finally launched StudentGrounds, however after a year and 200 user signups later it slowly died down. This experience of taking an idea and learning everything needed to make it a reality basically propelled my interest in learning how to code and do that full time. I learned all about computer science, taking a certificate course at night at a local university. I started another project idea on the side for an event management application for my father's youth soccer tournament, and started applying to every technology company I could think of. I ultimately got my first software engineer job at a small start up in Boston as an apprentice/intern and learned on the job before getting my first full-time software engineer position at a large Boston e-commerce company. My goal there was to learn as much as I could from season professionals, and learning how the corporate world works in terms of software development.
My ultimate goal is to create something on my own doing something I love, as well as enjoy life, and give back to others through education.
Right now I am a full-time Software Engineer with 6 years in the marketing tech space, trying to finish a SaaS boilerplate so that I can spin up any web application for any idea at the click of a button, which will then set me up for my next idea, IdeaVerify, an automated way to verify/validate you're SaaS application idea before actually starting to code and wasting many hours and years developing something that no one would use.
This blog is about my journey navigating the software engineering world, without a CS degree, building in public, keeping record of what I learned, sharing my learnings and at the same time giving back to others, teaching them how to code and giving helpful hints and insights. I am also using this blog to showcase other sides of me such as art, music, writing, creative endeavors, opinions, tutorials, travel, things I recently learned and anything else that interests me. Hope you enjoy!
I love Webflow for designing UI, and I love Django for developing REST API’s. I wanted to try combining the two.
I have a project in Django where I give the user the ability to create their own SaaS landing page based off a set of template choices (all designed in Webflow).
In order to design your landing page in Webflow and then export and bring into Django you need to first hit the export code button in Webflow like so:
- First hit button in the top right corner as shown below:

2. Then hit prepare zip and download the files as shown below:

3. Now you have all of your files from you landing page on your local machine.
4. Next, copy the folder into a location inside your Django project. I made a directory called webflow-templates and placed the files and folders (index.html, css, js, images) into another folder called landingpage_option1
5. Make sure this folder landingpage_option1 is referenced in the scripts below.
6. On my local machine I then pip install beautifulsoup4
7. This is used in the scripts to parse the html files.
8. I then created a scripts folder that contains 2 python scripts which are below.
9. Run move_exported_dirs_files.py
#!/usr/bin/env python3.8.3
import os
import shutil
# moving html files into templates
target_dir = "../templates/landingpage_option1/"
source_dir = "../webflow-templates/landingpage_option1"
print("Source: " + source_dir)
files = os.listdir(source_dir)
print("Files in source directory: " + source_dir)
files_html = [i for i in files if i.endswith(".html")]
os.makedirs(os.path.dirname(target_dir), exist_ok=True)
for file in files_html:
print("Moving: " + os.path.join(source_dir, file))
print("To: " + os.path.join(source_dir, file))
shutil.copy(os.path.join(source_dir, file), target_dir)
# moving css, images, js folders
target_dir = "../static_files/landingpage_option1/"
source_dir = "../webflow-templates/landingpage_option1"
sub_dirs = ["css", "images", "js"]
list_dirs = os.listdir(source_dir)
for sub_dir in list_dirs:
if sub_dir in sub_dirs:
dir_to_copy = os.path.join(source_dir, sub_dir)
target_sub_dir = os.path.dirname(target_dir + sub_dir + "/")
shutil.copytree(dir_to_copy, target_sub_dir)
10. This will take the files from webflow-templates/landingepage_option1 and move the index.html into your Django templates folder (make sure this is created if not already) templates/landingepage_option1 folder inside Django
11. It then also moves all sub folders (css, js, images) into your static_files folder (or where ever you house your static files) into a folder called static_files/landingpage_option1
12. Run find_and_replace.py
#!/usr/bin/env python3
# add django static tags to index.html file
from bs4 import BeautifulSoup as bs
# append load static
with open("../templates/landingpage_option1/index.html", "r+") as file:
html = file.read()
file.seek(0, 0)
file.write("{% load static %}\n" + html)
# replace all href links
with open("../templates/landingpage_option1/index.html") as in_file:
html = in_file.read()
soup = bs(html, "html.parser")
for link in soup.findAll("link"):
beg = "{% static 'landingpage_option3/"
end = "' %}"
link["href"] = beg + link["href"] + end
# {% static 'css/normalize.css' %}
with open("../templates/landingpage_option1/index.html", "w") as out_file:
out_file.write(str(soup))
# # replace all src in img tags
with open("../templates/landingpage_option1/index.html") as in_file:
html = in_file.read()
soup = bs(html, "html.parser")
for img in soup.findAll("img"):
beg = "{% static 'landingpage_option3/"
end = "' %}"
img["src"] = beg + img["src"] + end
# {% static 'css/normalize.css' %}
with open("../templates/landingpage_option1/index.html", "w") as out_file:
out_file.write(str(soup))
# # replace all src in script tags from webflow
with open("../templates/landingpage_option1/index.html") as in_file:
html = in_file.read()
soup = bs(html, "html.parser")
script = soup.find("script", src="js/webflow.js")
beg = "{% static 'landingpage_option1/"
end = "' %}"
script["src"] = beg + script["src"] + end
with open("../templates/landingpage_option1/index.html", "w") as out_file:
out_file.write(str(soup))
13. This script will replace all your referenced static folders and files with the Django template static tags. This will add {% load static %} to the top of your index.html file in the templates folder as well as add static tags to all your <link href ’s as well as your <script src=”{% static ‘landingpage_option1/js/webflow.js’ %}” type=”text/javascript”></script>
14. You should be ready to go to see your new template rendering if you have a view in Django pointing to the template. Something like this views.py
from django.shortcuts import render
def index(request):
return render(request, "landingpage_option1/index.html", context)






