Getting a Django Website Online, Part 1
Originally Published: Nov. 13, 2022, 11:31 p.m. Last updated: Nov. 13, 2022, 11:31 p.m.
Tags: programming
I'm putting this series together from the perspective of a programmer. I'll be focusing on the motivation and tech stack that were relevant to me while putting this website together, but some of the information here will be generalizeable beyond those restrictions.
Why do we want to put a website online
Showing off | A website can be a good way to display your programming skills at a quick glance to prospective clients or employers. It was with this goal in mind that I put this website online; this way I would have both the raw code I wrote on GitHub and a functional, demonstrateable version of it. However, there are additional reasons to put your code online in this format.
Making a tool available | Creating a frontend interface for a backend tool can let you expose it for use as a SaaS offering. It can now be accessed and used from anywhere, by anyone given permission. My Data Generator code (under Projects) was made with this use in mind. Here's a common scenario: You put together a Python script to perform a task that's common in your workspace. News of your script spreads to your team, other devs, and you share the script with them. These devs then spread the script to people outside the team or to non-devs and some of these people want to use the tool but don't have the technical background to do so, or they are sharing an old version of the script with bugs in it. Putting the tool online sidesteps many of these issues because 1) There's no setup involved, just a website GUI and 2) Any updates you makes, they're then able to apply with minimum effort. Finally, even if you have no plans to share the tool, putting in a GUI this way means that if you stop using it for a while (vacation, other tasks to do, the thing it's used for only happens every now and then, etc) you don't need to re-learn your own method of installing or using it. Whenever I need some linear data for whatever reason, I just visit my own Data Generator and grab it. It's come in handy in 4 jobs and counting.
Reaching others the way you want to | Websites are publically accessible. You can use your own site as a substitute for social media pages, expressing greater creative control and freedom than is avaible through common social media. You can put together journal entries, like I plan to do through this blog. You can create a family newsletter. You can let your friends know about cool things they've missed out on. You can make a webgame to all play together. The sky's the limit! All of this can be done with the colors you want, the pictures you want, the order and layout you want, no ads, no data tracking, no account logins, etc. Or you can plaster it with ads and make your family suffer. Whatever you're up for.
Prerequisites
Tools and accounts | Here's the list of what I'm currently making use of to get this website online. I'll be covering each of these in more detail further in. If you're working or comfortable with other equivalents, adapt or apply what you know to the topic as needed.
- Language - Python
- Web framework - Django
- Web host - Digital Ocean
- Domain Registrar - Namecheap
- ASGI Server - uvicorn
- Webserver - NGINX
Up next
In the next post I'll get started going through each of the tools above.