Building My First Django Website
In this post, I will share my two-month journey of creating this website, from start to finish. This website represents the culmination of my journey into web development and showcases my ability to build and deploy an application using key technologies like Python, the Django framework, PostgreSQL, Docker, and AWS. Building the necessary skills and confidence took me a couple of years before I even considered this project and I'll share how I went from little programming experience to creating this website. When I decided to learn how to program, I searched through many resources and settled on going through CS50. For me, CS50 was the best starting place because it was challenging, free and had a structured timeframe. The lectures were engaging and covered computer science topics at a high level. David Malan made the lectures memorable through the use of props and his ability to make concepts easy to understand. Although I enjoyed the lectures, the homework assignments were I got the most out of the course. I needed to research how to make the program do what I needed it to do and found how to find sources of information to solve problems. Keeping with the course's weekly pace created a deadline for me to keep on track, even though it took me two weeks beyond what the course had planned. For those reasons, I always recommend using CS50 as a first source for learning to program. After taking the CS50 course, I still considered myself a newbie and searched for more resources to learn from. I found reading many of the books from O'Reilly and No Starch Press while doing the exercises in the books very helpful in improving my skill. Additionally, I took more classes offered by HarvardX on Python and Web development. At this point, I was comfortable using Python for any small problem I had and decided to start on learning JavaScript. I spent around six to nine months working only with JavaScript getting familiar with the most popular language for web development. Even though the same programming ideas can be applied to every language, it was a learning curve to be able to solve the same problems in Python with JavaScript. The stand out thing that I learned from JavaScript was Object.prototype is at the top of the inheritance chain that other objects inherit from. This enabled me to have a better understanding of object oriented programming and how to use it. When I thought I had a beginners grasp of JavaScript, I went back to using Python which was more natural for me. During this time I joined a cybersecurity bootcamp and focused less on programming and more about general security concerns with regard to computers. I started to learn about networking, operating systems, system administrator tasks in addition to web related security concerns. Even though we created a secure static website in Azure, I knew I wanted to create more in-depth website for my personal use. After the bootcamp wrapped up and I finished studying for and passing the CompTIA Security+ exam, I started on creating a personal website for myself. Since Python was the language I was the most comfortable with, I decided to use the Django framework to build out my website. Knowing a little about it from the HarvardX classes I went to the Django website for more information. Even though the tutorial there is helpful, I was not quite ready to start coding my website. Searching for more information on how to use Django, I found Mozilla MDN had a whole tutorial on the subject and this was one of the best sources that I found to get started on the website. Similar to the tutorial on the Django website, the Mozilla tutorial has you build out a web application while learning the ins and outs of the framework. I found that they went into considerable more detail and had somewhat challenging exercises at the end of each section. After completing the tutorial, the final project was to create a blog website, which I now had the confidence and knowledge to do. Toward the end of completing the main functions I wanted the blog to have I ran into a problem with setting up a comment section for the blog post. During my search for a solution, I started to read Django 5 by Example, which gave me an idea to solve the issue I was having with comments. Not only did I find a solution for the issue I was having, the book illustrated how to incorporate other technologies with a Django application. I look forward using this book for future refence when I want to add other features. As I got closer to finishing my blog, I was curious on how other people designed similar applications and checked out one of the best resources I found while learning Python, Corey Schaffer on youtube. After watching him build up a similar application I noticed that his site looked more appealing, so I decided to work on styling my blog. I noticed that he used Bootstrap, which that it didn't take too much time to make the site look nice so I began using it as well. I knew that I needed to have test for the application, and to get an idea on how to implement tests, I watched Ssali Jonathan on youtube. With the application finished I moved my attention to deploying it into the cloud. Since this is a fun personal blog, I did not want to spend to much getting it online. I looked over many different providers that offered cheap or free options and even considered self hosting for a short time. I decided to use AWS because I wanted to have some hands on experience with them and they offer a free tier for a year. I decided to use Amazon's RDS for my Postgres database and put the rest in Docker containers in an EC2 instance. I had some experience using Docker previously, but throughout deploying this application I learned a tremendous amount about Docker. I had gone through the tutorials produced by Docker, but what really helped me was using the resources on TestDriven.io. I learned a lot about creating a Dockerfile and YAML files for deploying the application both locally and to the cloud. Additionally, they provided help with using Docker for Nginx and Let's Encrypt for the web application. Through many trials and errors deploying my application to AWS I learned a lot about Docker. Now that I had a RDS instance for my Postgres database and an EC2 instance for the application and had them connected, I just needed to set up email for account verification. I decided to use SES with amazon and just needed to verify that I owned the domain and I was up and running with emails. Once that was complete I made sure it is working properly and shifted my attention to writing blog post. Even though I have not yet worked on websites professionally, this project gave me a deeper understanding into what goes into bringing a website to life. Not only did I see how to create a website with the Django framework, but I also gained experience deploying the website with AWS. I thought I had a good understanding of Docker going into this project, but I learned so much about using Docker when I deployed this website. Additionally, I gained insight into what is available for deploying applications to the web. I look forward to making improvements to this website and continuing to write post. **Resources:** - **Amazon Web Services (AWS).** A widely used cloud computing platform. In your post, you specifically mentioned using: - **Amazon EC2 (Elastic Compute Cloud):** For hosting your application in Docker containers. - **Amazon RDS (Relational Database Service):** For your PostgreSQL database. - **Amazon SES (Simple Email Service):** For handling email functionality like account verification. - **Corey Schafer (YouTube Channel).** A valuable resource for tutorials on Python, web development, and related technologies. You can find his channel by searching "Corey Schafer" on YouTube. - **CS50: Introduction to Computer Science.** This refers to the introductory computer science course offered by Harvard University, often accessed through platforms like edX or the official Harvard website. - **Django 5 by Example by Antonio Melé.** A book providing practical examples for building web applications using the Django 5 framework. - **Django Project.** The official website for the Django web framework, providing documentation, downloads, and community information. Available at [https://www.djangoproject.com/](https://www.djangoproject.com/). - **Docker.** The official platform for building, shipping, and running applications in containers. You can find more information at [https://www.docker.com/](https://www.docker.com/). - **Let's Encrypt.** A non-profit certificate authority that provides free TLS certificates, enabling HTTPS for secure websites. Learn more at [https://letsencrypt.org/](https://letsencrypt.org/). - **Mozilla Developer Network (MDN).** A comprehensive online resource offering documentation, tutorials, and articles on web technologies, including extensive documentation for Django. You can find it at [https://developer.mozilla.org/en-US/](https://developer.mozilla.org/en-US/). - **Nginx.** A popular open-source web server used for hosting websites and applications. You can find more information at [https://nginx.org/](https://nginx.org/). - **No Starch Press.** Another publisher known for its accessible and engaging technical books, often covering programming and cybersecurity. - **O'Reilly Media.** A publisher of numerous technical books covering a wide range of IT topics. - **Ssali Jonathan (YouTube Channel).** A YouTube channel that you found helpful for understanding testing in web applications. You can find his channel by searching "Ssali Jonathan" on YouTube. - **TestDriven.io.** A website offering comprehensive tutorials and resources on Python, Django, Docker, and deployment strategies.