Django meetup learning

Attended a Django meetup conducted by Bangalore Django User Group by Krace Kumar
Date: June 7, 2014

Good to know:

wsgi stuff required for middleware
“”” multi line comments
# single line comment
pip freeze shows installed packages
freeze output installed packages in requirements format
list lists installed packages

Other things I learned:

  1. from django.shortcuts import render – function that renders html
  2. db schema for app cannot be created if app is not included under INSTALLED_APPS in settings.py
  3. trailing comma is allowed in python
  4. >>> Person.objects.all() – similar to select * in mysql
  5. A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and the use of more storage space to maintain the extra copy of data. Indexes are used to quickly locate data without having to search every row in a database table every time a database table is accessed. Indexes can be created using one or more columns of a database table, providing the basis for both rapid random lookups and efficient access of ordered records.
  6. The touch command is the easiest way to create new, empty files. It is also used to change the timestamps (i.e., dates and times of the most recent access and modification) on existing files and directories.
  7. {{ – denotes variable substitution
  8. print request.__dict__ – displays browser data that is passed between them
  9. cannot delete/modify db record in GET method

Using south:

  1. ./manage.py convert_to_south appname
  2. make changes in models.py
  3. ./manage.py schemamigration appname –auto
  4. ./manage.py migrate appname
  5. ./manage.py test contacts

You can find my app built on that day, here:
https://github.com/anagha-todalbagi/contactup

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s