0
Easy Web Project  Development and Management with Django &  Mercurial Widoyo <widoyo@gmail.com>
Why? <ul><li>MVC = Model View Controller </li></ul><ul><li>Django > MTV = Model Template View </li></ul><ul><li>Many softw...
The Project <ul><li>Human Resource Management Software (simplified) </li></ul><ul><li>Web base application </li></ul><ul><...
HRM Data to Cover <ul><li>HR Data {Nama, Alamat, Hp, Lahir, email, masuk} </li></ul><ul><li>Training {judul, mulai, akhir,...
Open Source Software <ul><li>Ubuntu Desktop + Server 8.04.2 </li></ul><ul><li>Python 2.5.2 </li></ul><ul><li>Django 1.0.fi...
Ubuntu <ul><li>Linux for human being </li></ul><ul><li>LTS = Long Term Support (5 year) </li></ul><ul><li>Latest = 9.04 (9...
Python <ul><li>Python is a dynamic object-oriented programming language that can be used for many kinds of software develo...
Django <ul><li>The web framework for perfectionists with deadline </li></ul><ul><li>Python base web framework </li></ul><u...
SQlite <ul><li>SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactiona...
Mercurial <ul><li>a fast, lightweight Source Control Management system designed for efficient handling of very large distr...
Install <ul><li>Come with Ubuntu: </li></ul><ul><ul><li>Python 2.5.2 (default), Sqlite3 </li></ul></ul><ul><ul><li>Mercuri...
Let's Start <ul><li>Project skeleton </li></ul><ul><ul><li>$django-admin.py startproject hrapp </li></ul></ul><ul><ul><li>...
Creating Application <ul><li>Creating Application </li></ul><ul><ul><li>$./manage.py startapp apps </li></ul></ul><ul><li>...
Files <ul><li>apps/models.py </li></ul><ul><li>from django.db import models </li></ul><ul><li>class Person(models.Model): ...
Activating 'admin' Interface <ul><li>$gvim urls.py </li></ul><ul><ul><li>from django.contrib.admin import admin </li></ul>...
Check-in Into Repository <ul><li>$hg init </li></ul><ul><li>$hg add </li></ul><ul><li>$hg commit –m -'Initial project' </l...
Creating Training Data Model <ul><li>apps/models.py </li></ul><ul><ul><li>class Training(models.Model): </li></ul></ul><ul...
Creating 'admin' for Training <ul><li>Training inline to Person </li></ul><ul><li>$gvim apps/admin.py </li></ul><ul><ul><l...
Customize Admin <ul><li>Adding 'search' </li></ul><ul><li>Adding 'filter' </li></ul><ul><li>apps/admin.py </li></ul><ul><u...
Public Interface: Homepage <ul><li>Homepage </li></ul><ul><ul><li>$gvim urls.py </li></ul></ul><ul><ul><ul><li>from hrapp....
Public Interface: Person Data <ul><li>List </li></ul><ul><ul><li>$gvim urls.py </li></ul></ul><ul><ul><ul><li>from django....
Person Data <ul><li>Detail </li></ul><ul><ul><li>$gvim urls.py </li></ul></ul><ul><ul><ul><li>from hrapp.apps.views import...
Django Pattern <ul><li>Urls >> View (method) >> Template </li></ul><ul><li>URLConf </li></ul><ul><ul><li>Loose coupling </...
Better Page Layout <ul><li>Creating and applying template </li></ul>
Mercurial <ul><li>Viewing change log </li></ul>
Terima kasih <ul><li>Widoyo <widoyo@gmail.com> </li></ul>
Upcoming SlideShare
Loading in...5
×

Software Project Management

947

Published on

Easy (Web) Software Project Development & Managegement with Django and Mercurial

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
947
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
49
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Software Project Management"

  1. 1. Easy Web Project Development and Management with Django & Mercurial Widoyo <widoyo@gmail.com>
  2. 2. Why? <ul><li>MVC = Model View Controller </li></ul><ul><li>Django > MTV = Model Template View </li></ul><ul><li>Many software developer does not track their code </li></ul>
  3. 3. The Project <ul><li>Human Resource Management Software (simplified) </li></ul><ul><li>Web base application </li></ul><ul><li>100% using Open Source Software </li></ul><ul><li>Source Code are well Manage </li></ul>
  4. 4. HRM Data to Cover <ul><li>HR Data {Nama, Alamat, Hp, Lahir, email, masuk} </li></ul><ul><li>Training {judul, mulai, akhir, kota} </li></ul>
  5. 5. Open Source Software <ul><li>Ubuntu Desktop + Server 8.04.2 </li></ul><ul><li>Python 2.5.2 </li></ul><ul><li>Django 1.0.final </li></ul><ul><li>Sqlite 3.4.2 </li></ul><ul><li>Mercurial DSCM 0.9.5 </li></ul>
  6. 6. Ubuntu <ul><li>Linux for human being </li></ul><ul><li>LTS = Long Term Support (5 year) </li></ul><ul><li>Latest = 9.04 (9 means 2009, 04 means April) </li></ul><ul><li>Varian </li></ul><ul><ul><li>Desktop </li></ul></ul><ul><ul><li>Server </li></ul></ul><ul><ul><li>Netbook Remix </li></ul></ul>
  7. 7. Python <ul><li>Python is a dynamic object-oriented programming language that can be used for many kinds of software development. ... and can be learned in a few days . Many Python programmers report substantial productivity gains and feel the language encourages the development of higher quality, more maintainable code . </li></ul><ul><li>&quot; Python has been an important part of Google since the beginning, and remains so as the system grows and evolves. ...” </li></ul>
  8. 8. Django <ul><li>The web framework for perfectionists with deadline </li></ul><ul><li>Python base web framework </li></ul><ul><li>http://djangoproject.com </li></ul><ul><li>http://djangobook.com </li></ul><ul><li>http://djangoinstant.com </li></ul>
  9. 9. SQlite <ul><li>SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. </li></ul><ul><li>http://sqlite.org </li></ul>
  10. 10. Mercurial <ul><li>a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects. </li></ul><ul><li>http://selenic.com/mercurial </li></ul>
  11. 11. Install <ul><li>Come with Ubuntu: </li></ul><ul><ul><li>Python 2.5.2 (default), Sqlite3 </li></ul></ul><ul><ul><li>Mercurial </li></ul></ul><ul><ul><ul><li>$sudo apt-get install mercurial </li></ul></ul></ul><ul><li>Django </li></ul><ul><ul><li>Download django-<ver>.tar.gz </li></ul></ul><ul><ul><li>$tar -vzxf django-<ver>.tar.gz </li></ul></ul><ul><ul><li>$cd django-ver </li></ul></ul><ul><ul><li>$sudo python setup.py install </li></ul></ul>
  12. 12. Let's Start <ul><li>Project skeleton </li></ul><ul><ul><li>$django-admin.py startproject hrapp </li></ul></ul><ul><ul><li>$cd hrapp </li></ul></ul><ul><ul><li>$python manage.py runserver (test It Worked!) </li></ul></ul><ul><ul><li>$chmod 755 manage.py </li></ul></ul><ul><ul><li>$gvim settings.py (for Database & django.contrib.admin) </li></ul></ul><ul><ul><li>$./manage.py syncdb (populate database & create super user) </li></ul></ul>
  13. 13. Creating Application <ul><li>Creating Application </li></ul><ul><ul><li>$./manage.py startapp apps </li></ul></ul><ul><li>Creating Models </li></ul><ul><ul><li>Person {Nama, Alamat, Hp, Lahir, email, masuk} </li></ul></ul><ul><ul><li>$gvim apps/models.py </li></ul></ul><ul><ul><li>Activating application & generating table </li></ul></ul><ul><ul><li>$gvim settings.py (install 'apps' into INSTALLED_APPS) </li></ul></ul><ul><ul><li>$./manage.py syncdb </li></ul></ul>
  14. 14. Files <ul><li>apps/models.py </li></ul><ul><li>from django.db import models </li></ul><ul><li>class Person(models.Model): </li></ul><ul><li>nama = models.CharField(max_length=50) </li></ul><ul><li>alamat = models.CharField(max_length=200) </li></ul><ul><li>hp = models.CharField(max_length=35, blank=True, null=True) </li></ul><ul><li>lahir = models.DateField() </li></ul><ul><li>masuk = models.DateField() </li></ul><ul><li>settings.py </li></ul><ul><li>DATABASE_ENGINE = 'sqlite3' </li></ul><ul><li>DATABASE_NAME = '/tmp/hrapp.db' </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>. </li></ul><ul><li>INSTALLED_APPS = ( </li></ul><ul><li>. </li></ul><ul><li>'django.contrib.admin', </li></ul><ul><li>'hrapp.apps', </li></ul><ul><li>) </li></ul>
  15. 15. Activating 'admin' Interface <ul><li>$gvim urls.py </li></ul><ul><ul><li>from django.contrib.admin import admin </li></ul></ul><ul><ul><li>admin.autodiscover() </li></ul></ul><ul><ul><li>. </li></ul></ul><ul><ul><li>. </li></ul></ul><ul><ul><li>(r'^admin/(.*)', admin.site.root), </li></ul></ul><ul><li>$gvim apps/admin.py (to manage Person Data) </li></ul><ul><ul><li>from hrapp.apps.models import Person </li></ul></ul><ul><ul><li>from django.contrib import admin </li></ul></ul><ul><ul><li>class PersonAdmin(admin.ModelAdmin): </li></ul></ul><ul><ul><li>list_display = ['nama', 'alamat','hp','masuk','lahir'] </li></ul></ul><ul><ul><li>admin.site.register(Person, PersonAdmin) </li></ul></ul>
  16. 16. Check-in Into Repository <ul><li>$hg init </li></ul><ul><li>$hg add </li></ul><ul><li>$hg commit –m -'Initial project' </li></ul>
  17. 17. Creating Training Data Model <ul><li>apps/models.py </li></ul><ul><ul><li>class Training(models.Model): </li></ul></ul><ul><ul><li>person = models.ForeignKey(Person) </li></ul></ul><ul><ul><li>judul = models.CharField(max_length=200) </li></ul></ul><ul><ul><li>mulai = models.DateField() </li></ul></ul><ul><ul><li>akhir = models.DateField() </li></ul></ul><ul><ul><li>kota = models.CharField(max_length=35) </li></ul></ul><ul><li>$./manage.py syncdb </li></ul><ul><li>Check-in repository </li></ul><ul><ul><li>$hg commit </li></ul></ul>
  18. 18. Creating 'admin' for Training <ul><li>Training inline to Person </li></ul><ul><li>$gvim apps/admin.py </li></ul><ul><ul><li>from hrapp.apps.models import Person, Training </li></ul></ul><ul><ul><li>... </li></ul></ul><ul><ul><li>class TrainingInline(admin.StackedInline): </li></ul></ul><ul><ul><li>model = Training </li></ul></ul><ul><ul><li>extra = 3 </li></ul></ul><ul><ul><li>class PersonAdmin(admin.ModelAdmin): </li></ul></ul><ul><ul><li>list_display = ['nama', 'alamat','hp','masuk','lahir'] </li></ul></ul><ul><ul><li>inlines = [TrainingInline] </li></ul></ul><ul><ul><li>... </li></ul></ul>
  19. 19. Customize Admin <ul><li>Adding 'search' </li></ul><ul><li>Adding 'filter' </li></ul><ul><li>apps/admin.py </li></ul><ul><ul><li>search_fields = ['nama'] </li></ul></ul><ul><ul><li>list_filter = ['kota'] </li></ul></ul><ul><li>$hg commit </li></ul>
  20. 20. Public Interface: Homepage <ul><li>Homepage </li></ul><ul><ul><li>$gvim urls.py </li></ul></ul><ul><ul><ul><li>from hrapp.apps.views import homepage </li></ul></ul></ul><ul><ul><ul><li>(r'^$', homepage) </li></ul></ul></ul><ul><ul><li>$gvim apps/views.py </li></ul></ul><ul><ul><ul><li>from django.http import HttpResponse </li></ul></ul></ul><ul><ul><ul><li>def homepage(request): </li></ul></ul></ul><ul><ul><ul><li>return HttpResponse(“Hello RICE Expo”) </li></ul></ul></ul><ul><li>$hg commit </li></ul>
  21. 21. Public Interface: Person Data <ul><li>List </li></ul><ul><ul><li>$gvim urls.py </li></ul></ul><ul><ul><ul><li>from django.shortcuts import render_to_response </li></ul></ul></ul><ul><ul><ul><li>from hrapp.apps.views import homepage, person_list </li></ul></ul></ul><ul><ul><ul><li>(r'^person/', person_list) </li></ul></ul></ul><ul><ul><li>$gvim apps/views.py </li></ul></ul><ul><ul><ul><li>from django.http import HttpResponse </li></ul></ul></ul><ul><ul><ul><li>def person_list(request): </li></ul></ul></ul><ul><ul><ul><li>person_list = Person.objects.all() </li></ul></ul></ul><ul><ul><ul><li>return render_to_response('person_list.html', {'person_list': person_list}) </li></ul></ul></ul><ul><ul><li>$gvim templates/person_list.html </li></ul></ul><ul><ul><ul><li><table> </li></ul></ul></ul><ul><ul><ul><li>{% for person in person_list %} </li></ul></ul></ul><ul><ul><ul><li><tr><td>{{ person.nama }}</td><td>{{ person.alamat }}</td></tr> </li></ul></ul></ul><ul><ul><ul><li>{% endfor %} </li></ul></ul></ul><ul><ul><ul><li></table> </li></ul></ul></ul>
  22. 22. Person Data <ul><li>Detail </li></ul><ul><ul><li>$gvim urls.py </li></ul></ul><ul><ul><ul><li>from hrapp.apps.views import homepage, person_list, person_detail </li></ul></ul></ul><ul><ul><ul><li>(r'^person/', person_list), </li></ul></ul></ul><ul><ul><ul><li>(r'^person/(?P<object_id>)/$', person_detail), </li></ul></ul></ul><ul><ul><li>$gvim apps/views.py </li></ul></ul><ul><ul><ul><li>def person_detail(request, object_id): </li></ul></ul></ul><ul><ul><ul><li>person = Person.objects.get(id=object_id) </li></ul></ul></ul><ul><ul><ul><li>return render_to_response('person_detail.html', {'person': person}) </li></ul></ul></ul><ul><ul><li>$gvim templates/person_detail.html </li></ul></ul><ul><ul><ul><li><h1>{{ person.nama }}</h1> </li></ul></ul></ul><ul><ul><ul><li><i>{{ person.alamat }}</i> </li></ul></ul></ul><ul><ul><ul><li>{% if person.training_set.all %}<ol> </li></ul></ul></ul><ul><ul><ul><li>{% for training in person.training_set.all %}<li>{{ training.judul }}<li>{% endfor %}</ol> </li></ul></ul></ul><ul><ul><ul><li>{% else %} </li></ul></ul></ul><ul><ul><ul><li><p>Belum ada riwayat training</p> </li></ul></ul></ul><ul><ul><ul><li>{% endif %} </li></ul></ul></ul>
  23. 23. Django Pattern <ul><li>Urls >> View (method) >> Template </li></ul><ul><li>URLConf </li></ul><ul><ul><li>Loose coupling </li></ul></ul><ul><ul><li>Mapping between url and method to execute </li></ul></ul>
  24. 24. Better Page Layout <ul><li>Creating and applying template </li></ul>
  25. 25. Mercurial <ul><li>Viewing change log </li></ul>
  26. 26. Terima kasih <ul><li>Widoyo <widoyo@gmail.com> </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×