Django
Development updates for the DBSSIN library
by Lee Napthine, 28 February 2025
Over the last year, we’ve been adapting DBSSIN (Database-Spreadsheet-Ingestion) to better fit current projects, and it’s come with its share of development challenges. The ARCsoft team has been pushing the library forward, cleaning up the mapping system, and handling some unique security and access issues.
Advanced querying with Django
by Archie To, 24 February 2025
One of the most powerful features that come with Django is the ORM
(object-relational mapping). It allows you to easily fetch data from the
database by writing intuitive Python code. However, if you don’t know (maybe
read a different article if you do), there is more to
Django’s ORM than the simple objects.get
and objects.filter
. This article
aims to take your ability to use the Django’s ORM to the next level.
Creating Custom Modules for the ARCsoft Library
by Lee Napthine, 9 December 2024
At ARCsoft we have begun building a repository of custom Helpers libraries that will be included in future projects. First on the docket was looking at several giant UI test code blocks in Django. These often span dozens of modules and thousands of lines of code. Quite common throughout was the use of repetitive and non-descriptive JsonResponse
calls. Let’s walk through how we compartmentalized these calls into a more cohesive set of custom JsonResponse
classes and how we added them to our repository of custom methods that we will use here at ARCsoft. Along the way we will document the setup of the Helpers repository and the essential inclusions to a project for the package to be able to be used, imported, and published.
Django Cheatsheet
by Nick Wurzer, 26 October 2023
Below will be a list of specific Django features with a short description of how they are used.
Ingestion Made Easy!
by Priya Srinivasan, 11 August 2023
ZooDB already possessed an ingestion script, capable of efficiently processing hundreds of rows of zooarchaeological bone data. This script was traditionally executed from the command line by the developer. However, to enhance the user experience and streamline the ingestion process, we created a user-facing feature to allow the researchers to upload and process their data via the web application. In this article, I describe the crucial parts of this feature and how it was developed.
Displaying Dynamic Data with a Django View Function
by Priya Srinivasan, 31 May 2023
Django is a powerful Python web framework and it provides a straightforward way to display dynamic data in web applications. It has a template system for displaying content on the web. Templates can be combined with view functions to display data dynamically. This article will describe how to use a Django view function to retrieve and display dynamic data. Step 1: Define a View Function Initially, we need to create a view function as follows, that can handle the request and return the response containing the dynamic data.
Writing unit tests for a Django web application
by Priya Srinivasan, 30 April 2023
As websites expand, manual testing becomes more challenging. Interactions between components can lead to errors in other areas, and more changes are needed to ensure everything continues to function correctly. To address these issues, automated tests can be used to run every time changes are made, ensuring reliable and consistent testing. This blogpost demonstrates how to automate unit testing of your website using Django’s test framework.
Strapper real-time deployment log
by Archie To, 18 April 2023
This real-time deployment log feature was implemented by following a tutorial on Django Channels. All of the code below can be found in the Strapper GitLab repository Setup Install daphne and channels: $ pip install -U daphne channels["daphne"] In app_starter/app_starter/settings.py: INSTALLED_APPS = [ "daphne", ..., ] ASGI_APPLICATION = "app_starter.asgi.application" Configure ASGI app Since wsgi doesn’t support long-lived connections, we will have to serve our app as an asgi app. In app_starter/app_starter/asgi.
Django development tips
by Archie To, 31 March 2023
This article contains tips that I wish I knew when starting out with Django. Following these tips will help your development process with Django a lot faster and make your code way cleaner. This article assumes you already have basic Django knowledge. (Django’s full documentation can be found here.) Note: All the code examples below assume there is no bug within each code, all dependencies for each code have been set up and each code runs correctly.
Researcher Contact Database
by Archie To, 28 February 2023
Introduction - Existing Problem RCS team member works with researchers and faculty members on multiple projects everyday. Each of these projects involve different people (inside and outside of the university), are at different stages and require different actions. It has become extremely difficult for RCS team members to keep track of these information as the number of projects that they work on rises. Therefore, there needs to be a solution.