For 2023 (and 2024 ...) - we are now fully retired from IT training. We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.
Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!
I am also active in many other area and still look after a lot of web sites - you can find an index ((here)) |
Well House Consultants
You are on the site of
Well House Consultants
who provide
Open Source Training Courses
and business
hotel accommodation. You are welcome to browse and use
our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
|
Python module Y306
The Django web framework
Exercises, examples and other material relating to training module Y306. This topic is presented on public course %dj%
Background Django is a web framework. It's code which is written in python which lets you
create, customise and maintain web sites, where the data is (usually) stored in a
database, and the look and feel of the pages is (usually) held in a template. By
keeping the appearance of the web site separate from the underlying information it
presents, you can look after each of the elements independently. Furthermore,
Django uses "DRY" (don't repeat yourself) principles so that a single amendment to
your data, or to your template, allows the change to propogate through all effected
pages without any requirement for repeated (bulk?) editing.
Articles and tips on this subject | updated | 4095 | Django - first steps - Updated What is Django / What is a Web Framework?
Many web applications have the same elements - a look and feel (the view, logic that works with the data, usually in a database (the model), something to handle incoming URLs and run the appropriate piece of logic (a router) and bespoke glue in the middle that ... | 2013-05-25 (longest) | 4013 | Web Frameworks - nested templates There are times when an inversion of long-accepted logic makes sense. I've been working in a many-floored office block in Salford this week, with a bank of lifts to travel between floors. Rather than press a button for your floor once you're in the lift, you press a button in the lift lobby when you ... | 2013-02-23 | 3919 | What is a web framework? When you write web applications, there are many features you'll need which mirror features other people have needed too. Now - there's nothing to stop you writing your own code (maybe in Ruby, Python or Perl) including these features ... but wouldn't it be better to use the feature set that someone ... | 2012-11-17 | 3705 | Django Training Courses - UK We run regular public Python courses - for newcomers to programming (Learning to Program in Python) and for delegates with prior programming in another language (our Python Programming course). If you're going to be using Python within the Django web framework, we can extend the course to cover that ... | 2012-04-28 | 3698 | How to stop forms on other sites submitting to your scripts From time to time, many of us web site authors and maintainers put a form on our site which submits data to another site. It might be something as simple as a Google seach box or a webmail login page.
If you're developing a page / form which you do not want to be filled in remotely in this way, you ... | 2012-04-21 | 3640 | Sessions (Shopping Carts) in Django - the Python Web Framework What are sessions?
When you're running a web application, you need to be able to enter data page by page on your way through, and have that data retained - on a shopping site, for example, you need to be able to add things into your basket page by page and have them stay there until you check out. ... | 2012-03-10 (longer) | 3639 | Demonstration of a form using Django Our previous Django demonstrations have shown the setting up of the Django environment and data: [here]
Adding your own views and templating them: [here]
Separating the HTML from the Controller: [here]
Nesting Templates: [here]
and defining database table relationships: [here]
Let's now add a form definition ... | 2012-03-10 | 3634 | Defining database relations in your Django model Each database table maps to a class in Django - and the beauty if that be the way you define the tables will work equally well with SQLite, MySQL, and other supported databases (you just have a database configuration block to set when you install your Django project).
Here is my models.py file from ... | 2012-03-10 | 3633 | Nesting Templates in Django Django's templates are HTML files into which your controller will fill web page content. This is done by means of an extra tagging language, which includes two groups of constructs:
a) construct starting with {{ and ending with }}, which are filled in with the value held in a field in the Context object.
Example: ... | 2012-03-10 | 3624 | Why do we need a Model, View, Controller architecture? In the very early days of the web, it was a source of data - with files of marked up text (in HTML) being sent out to a browser program by a server running on a central computer. Requests to the central server were made in http (Hypertext transfer protocol), and the responses were translated by the ... | 2012-03-03 | 3139 | Steering our Python courses towards wxPython, SQLite and Django With our modular courses that we write ourselves, we've well placed to move forward with technology; more often than not, what's needed is a series of gentle changes, adding in the occasional module for private courses where a particular new subject is needed, with it being introduced into public courses ... | 2011-01-21 | 3140 | Django - separating the HTML from the view / model This is the third section on Django - the Python based web framework. See first Step 1 and Step 2.
Let's add another view of our data to our Django app - using DRY techniques, this will be a short piece of coding but I'll take the opportunity to add in and explain a few more features that you'll probably ... | 2011-01-21 | 3138 | Django - adding your own views, and then templating your views. Django is a web framework in Python using DRY (Do not repeat yourself) principles. It usually uses data held in a database such as SQLite or MySQL, which is maintained separately from the look and feel of the web site.
This is the second article in a series. For the first article in this series - "Django ... | 2011-01-20 (longest) | 3136 | A framework with python - Django - first steps What is Django and what do I need to be able to use it?
Django is a framework - a tool that lets you create, customise, run and maintain web sites in which the data is stored in database tables. It uses the DRY (Don't Repeat Yourself) philospohy of design - quite the opposite of early web sites, where ... | 2011-01-19 (longest) | 1745 | Moodle, Drupal, Django (and Rails) In the 1970s, we had C and in that decade and the following one, we put together our systems in that language and its derivatives.
In the 1990s, we had Perl and in that decade and the following one, we put together our systems in that language are related ones.
In the 2010s, we'll have a wide range ... | 2010-01-31 |
Examples from our training material
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from [here].
Topics covered in this module
Introduction to Django. What is a framework and what is MVC? Creating a project. The development server, and the database setup. Creating and activating models. Using the API. Activating and using the admin site and functionallity. Adding related objects. URL controls. The templating system and attributes Your first view, and views that interact with the model and controller. Forms and generic views. Caching. RSS feeds.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.
Well House Consultants specialise in training courses in
Ruby,
Lua,
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us.
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.
|
|
|