Managing Static Files for Your Django Application

Django’s Default Static File Manager In every web application, static files such as css, Javascript and images, give the website a unique look-and-feel and make it stand out of the crowd. For any user, a beautiful, professional looking website is way more attractive than an rough, unpolished one. In a Django application, we manage the […]

Read More

Writing Tests for Your Django Application’s Views

Testing a Django Application’s View In our previous article, we learned how to write automated tests for our Django application, which involves writing a simple test to verify the behaviour of the model method m.Post.recent_posts() and fixing the bug where the method recent_posts() returns future posts. In this article, we are going to learn how […]

Read More

Writing Automated Tests for Your First Django Application

Tests, Tests and More Tests As a software programmer, you often hear others talking about tests being one of the most important components of any project. A software project often succeeds when there’s proper test coverage. While it often fails when there’s little or none. You might be wondering: what are tests anyway? Why is […]

Read More

Writing Views to Upload Posts for Your First Python Django Application

In the previous article, we wrote an index view to show a list of posts that are created less than two days ago and a detail view to show the detailed content of a post. In this article, we’re going to write a view that allows the user to upload a post and improve our […]

Read More

Introductory Tutorial of Python’s SQLAlchemy

Python’s SQLAlchemy and Object-Relational Mapping A common task when programming any web service is the construction of a solid database backend. In the past, programmers would write raw SQL statements, pass them to the database engine and parse the returned results as a normal array of records. Nowadays, programmers can write Object-relational mapping (ORM) programs […]

Read More

Writing Simple Views for Your First Python Django Application

In the previous article Activate Admin Application for Your Python Django Website, we learned how to activate the built-in Admin Application from Django in your website. In this article, we are going to write simple views for your website. What is a view? In Django, a view is an endpoint that can be accessed by […]

Read More

Advanced SQLite Usage in Python

Following the SQLite3 series, this post is about some advanced topics when we are working with the SQLite3 module. If you missed the first part, you can find it here. Using SQLite’s date and datetime Types Sometimes we need to insert and retrieve some date and datetime types in our SQLite3 database. When you execute […]

Read More

Python for Android: Using Webviews (SL4A)

Webviews make it easy to use web technologies to build graphical user interfaces for native applications. Many people already know some webcraft, and it’s easy to pick up and well worth knowing, so there’s a broad appeal in being able to use these technologies for native apps. This also allows developers to tap into the […]

Read More

Recursive File and Directory Manipulation in Python (Part 3)

In Part 2 of this series we expanded our file-searching script to be able to search for multiple file extensions under a tree, and to write the results (all paths to files of matching extensions found) to a log file. Now that we’ve come to the final part of the series, we’ll add more functionality […]

Read More

Activate Admin Application for Your Python Django Website

In the previous article , we learned how to write two models Post and Comment for your Django application myblog. In this article, we are going to learn how to activate Django’s automatic admin site that provides a convenient interface for users or administrators of your website myblog to create, read, update and delete (CRUD) […]

Read More