Python Virtual Environment

Python Virtual Environment

We’ve been looking at a whole lot of Python programming and have tested out lots of Python packages. In order to do this, of course, we need Python installed on the computer we are working on. As we know, Python comes with a fantastic package manager called PIP. PIP makes it super easy to download and install any of the fantastic libraries available in Python. Here is the catch.…

How To Sign Up And Log In Users With Django

How To Sign Up And Log In Users With Django

Django has some tools built in that you can use to set up the ability for users to log in and log out of a web application. In this tutorial, we’ll see how to set that functionality up. First, we’ll set up the url patterns and routes that we need, then we’ll configure the needed view functions. In the view functions, we’ll make use of two really cool classes the Django offers.…

Slug Based Routing In Django

Slug Based Routing In Django

Our Post model has a slug field that we had set up earlier. Now we want to configure slug based routing in Django. To design URLs for an app, we learned how to use the Python module URLconf or URL configuration. The URLconfg uses Python code to map between URL path expressions and Python functions that are defined in views. Some routing paths are static, and some are dynamic.…

Django Static Files And Images

Django Static Files And Images

Now we are going to add some style to our posts application that we have been building. Django follows conventions for locating static files and images, just like it has conventions for most things. In Django, you can have static files shared across an entire project or on a per-application basis. In this tutorial, we will be setting up a static directory inside of our given application.…

Models In Django

Models In Django

Now that we know about routing in Django and how URLs map to views and view functions that send back Html templates to the user, we can now learn about Models in Django. Models introduce the concept of using dynamic data from a database to power the front end of the website that the user sees and interacts with. For example in our small blog application, we want to store a collection of posts in the database.…

Django App vs Project

Django App vs Project

Everything in Django is centered around the idea of apps. Apps in Django are the self-contained directories that hold files that all work together to provide specific functionality for your Project. A Django project may consist of a single app, or many apps to provide its service. In fact, there is a site dedicated to providing developers all kinds of reusable apps, tools, and more for your Django projects.…

Django HTML Pages

Django HTML Pages

In this tutorial, we are going to explore how to render HTML with Django using Templates. Django is written in Python and is different than how things work in say PHP for example. In PHP we can mix PHP with HTML to output web pages. Django and Python work a little differently. In Django, we use the Django Template Language or DTL templates to output dynamic data generated by Python and Django into HTML pages.…