Love Python AND Web Development? Try this!

CS467 – Blog #3

Image by Michael Schwarzenberger from Pixabay

You don’t live as long as I have without a healthy fear of snakes, Bobby.

Creed Bratton

Meet Django

Django is a full-stack web framework that makes it quick and easy to create highly extensible web applications. Django is a framework written in Python that allows developers to make fast, scalable, and secure websites. Django comes pre-loaded with modern security features that help prevent SQL injection, clickjacking, cross-site scripting and others. Since Django is an open-source project, security patches are continuously being released and vulnerabilities are often found quickly.

Django is one of the most popular Pythonic web frameworks around. (Flask is the other most popular Pythonic web framework. Perhaps another blog post will discuss the differences and when to choose one over the other…)

A lot of popular websites use the Django Framework or part of the Django framework.

Popular Sites that use Django

  • Instagram (ever heard of it?)
  • Spotify
  • YouTube
  • The Washington Post, The Guardian, and The New York Post
  • BitBucket (like GitHub)
  • DropBox
  • Mozilla
  • Pinterest

Source: djangostars.com

Structure of a Django Project (Model-View-Template)

Django utilizes a Model-View-Template structure which standardizes the way that a Django project is structured. This helps keep project files nice and organized as well as makes the logic of how Django works compartmentalized. The MVT structure is based on the Model-View-Controller (MVC) structure found in C#/.NET web applications as well as AngularJS and ReactJS libraries.

The Model (Think Database)

The Model is a Python class that is used to set up the structure of a single table in a database. With the models.py file within each Django application directory, you can structure the table any way you want. But instead of creating tables in SQL, you use Python and have Django’s Object-Relational Mapping layer do the heavy lifting.

The View (Think Backend)

Views contain the “business logic” which handles how data is created, stored, and changed. In other words, it handles the backend logic that takes data from the database and sends it to the frontend for the user to view/mess around with.

For example, the views.py file for each Django application directory handles the CRUD. That is, Create, Read, Update, and Delete operations on the data. The logic for handling the CRUD is housed within the views.py files.

Also, the views.py files handle rendering the templates and passing data into the templates for the user to view.

The Template (Think Frontend)

Templates are HTML files that contain the code that the user sees and interacts with. All of the forms, images, text are housed within the template files.

Django utilizes the Jinja2 templating engine which allows data from the views.py file to be passed into the frontend HTML pages. For instance, if you had a list of Employee names stored in a database and wanted to display them all in a table format, you would have an HTML template that contains a for loop requesting data from the views.py file which in turn requests the data from the models.py which in turn gets that data from the data base.

Like I mentioned, the Jinja2 templating engine allows for Pythonic for loops and conditionals to be inserted into HTML files bridging the gap between the front and back end.

Image of Jamie Foxx from the Motion Picture Django Unchained from Columbia Pictures

Tutorials

Corey Schafer makes a wonderful Django tutorial where he will guide you through making a full-fledge Blog website!

Here is Django’s own tutorial and documentation which is not as fun to go through as a video tutorial, but provides great insight on how Django works and where to go for help if something isn’t working quite right.

Give the tutorials a shot to learn how to use Django! If you run into any issues, leave a comment below.

Need a Way to Track Your Job Applications? Use This!

CS467 – Blog #2

Introducing….. Job Tracker!!!! (Name yet to be determined)

Yes, you read it correctly. A web application that helps you track all of your pending job applications and helps you get hired is currently under development!

As this project is my capstone project (and my teammates’ capstone project), we will be designing and developing a fully-fledged Job Tracker website where you can create an account, enter your jobs/internships that you are interested in applying to, track your skills to see which skills/tools you are listing the most in your applications, and you can keep track of your contacts for some next-level networking.

Tracking Jobs

I used to use a spreadsheet to keep track of all of the applications I had submitted. But this was a huge time-waster as I spent more time formatting the spreadsheet than searching for jobs!

The idea behind our website is that you can simply add a job/internship opportunity and keep track of which jobs require which skills and you can see how frequently those skills are noted within your applications.

Let’s say you found a cool job at an electric car company that rhymes with “Pesla”… You can create this job in your job tracker and perhaps mark it as, “application not started”. Based on “Pesla’s” job description, you can enter in the skills that are related to that job. If you are keeping track of multiple job opportunities, there will be (maybe) a dashboard showing you how frequently your skills are mentioned which can be an indication that you may need to brush up on certain skills over others.

When will this be released???

Drum roll please….

Image by Jill Wellington from Pixabay

This website will be released in December of 2021!

Where can I find it???

No idea. Check back in December for a link to the website.

How YOU can help???

Image by PublicDomainPictures from Pixabay

Leave comments below on what features you’d like to see in this website. Who knows… maybe we will decide to implement it and your input will be made into a feature!

Or Better Yet….

Help choose the name of the website! Leave a comment below with name suggestions. They’re just suggestions… and not a public poll. Those are definitely trollable…

If you are wondering who I am and why you should or shouldn’t care… click here.