Skip to main content

Posts

Showing posts from July, 2018

Diary

First day as a TA at Coding Dojo Worked up through the automated testing portion of the Django official tutorial Didn't have time to do any algorithms -- learned about a path-finding problem (2D array represents connections between nodes -- determine whether there is a path from A to B for arbitrary A and B) e.g. for nodes A, B, and C [ [0, 1, 0] , [0 , 0, 1], [0, 0, 0] ] First entry says A is connected to B, second that B is connected to C -- so there's a path from A to C. The connection relationship is not robust.  A can be connected to B without B being connected to A.  It must however in some sense give rise to another relationship that is at least transitive.  If A and B are connected, and B and C are connected, then I can get from A to C.  This does not mean, however, that I can get back from C to A. Initial thought was do something with recursion.  Too complicated.  And what if you have loops?  Now it seems you just need a way to trans...

How To Get More Out Of Tutorials

We all follow tutorials.  Coming up with an idea for a new app, including the scaffolding and the specific functionality, is hard.  Struggling through something on your own can be valuable and helps you internalize it, but you also risk "reinventing the wheel" if you fail to take advantage of the resources and experience available from those who have "done it before."  Tutorials help you work through an ambitious project step by step and "learn while doing."   But blindly copying someone else's code without knowing why you are doing what you are doing can severely limit your learning.  Use the following steps to get the best of both worlds -- a dedicated teacher who will guide you every step of the way through the app you want to make AND a system that will hold you responsible for what you learn and help you to internalize it so that you can generalize specific steps for future pet projects (or work assignments). 1. Pause The Tutorial Pause t...

Starting A New Project In Django

Purpose What follows are streamlined notes following Django's web app tutorial . Project Assuming that you have Python and Django installed and, if needed, are running the appropriate environment, you begin a project by navigating to the desired project directory and running the command django-admin startproject <project name here>  This creates a directory for your project with the basic file structure. App A Django app encapsulates some site function (e.g. registration). To create a Django app, run the following command in the directory where you want to implement it: python manage.py startapp <app name here> As of Django 2, it appears that the app is automatically registered with the setup (settings.py), saving time. Errata.   Above I stated that an app does not need to be "installed" in Django 2.  This is not correct.  To install an app (necessary for using app models), add <app name>.apps.<app name>Config (e.g. Example...