Why OCMS ?

  • Affordable : Because OCMS is web-based, enhancements are released regularly. You always have the option to add more services and features as needed for an additional fee. In addition, customer support is always included with your subscription.
  • Simple : OCMS is so simple to use that any company of any size can get up and running in no time. Designed locally, OCMS is extremely userfriendly and easy to navigate. It’s so intuitive that your team can get right to work without extensive training.
  • Accessible : OCMS’s web-based solution redefines how Financial Services access and share information both internally and with Service providers. Get access to all of the information you need, when you need it—at home, on the road or in the office. All you need is an internet connection. OCMS delivers the functionality you need directly to any mobile device, desktop or Smartphone.
  • Integrated : OCMS was designed to replace your patchwork of software applications with a complete, integrated suite of solutions that address every aspect. OCMS’s suite of integrated solutions work seamlessly together, exchanging information in real-time, eliminating redundant data entry and errors.
  • Automated : Get the tools your business needs automate and simplify operations, saving time, money and resources. OCMS automates many of the time consuming processes in your business, so you can focus on customer service and growing your business.
  • Secure : Your data is the key to your business and OCMS knows how to protect it. With hassle-free cloud computing, all of your data is secured in the SAS70 II compliant OCMS solution.

Features :

      Financial Services
  • Company Administration
  • Maturity Schedule
  • Document Management
  • e-Filing
  • Certificate generation
  • Certificate generation
  • Report Center
  • Task & Appointment Settings
  • Financial Management – (Journal, General Ledger, Trial Balance)
  • Automatic Renewal Notification (60 days, 45 days, 30 days, 15 days)
  • Customized Billing
    Service Providers
  • Company Administration
  • Maturity Schedule
  • Document Management
  • Service Request
  • Task & Appointment Settings
  • Financial Management – (Journal, General Ledger, Trial Balance)
  • Automatic Renewal Notification (60 days, 45 days, 30 days, 15 days)
  • Customized Billing




Financial Service 
User :
Pass : fs

Service Providers
User :
Pass : demo


Manage business and automate back office functions related to technology, services and human resources.

ERP is short for enterprise resource planning. Enterprise resource planning (ERP) is business process management software that allows an organization to use a system of integrated applications to manage the business and automate many back office functions related to technology, services and human resources. ERP software integrates all facets of an operation, including product planning, development, manufacturing, sales and marketing.

ERP software is considered an enterprise application as it is designed to be used by larger businesses and often requires dedicated teams to customize and analyze the data and to handle upgrades and deployment. In contrast, it has modules like CRM, HR , Payroll , Inventory , Vendor Management, Accounting, Finance, Reports Etc.

Features :

  • Multiple Companies Management
  • Employees Management
  • Separate Individual Logins
  • CRM
  • Ledger Manager
  • Complete Reports
  • Automated Payslips
  • Weekly , Bi-weekly & Monthly Payrolls<br>
  • Run your own SAAS Based ERP
  • Commercial Usage Allowed
  • Much More…

Demo :

Admin Login

LinkClick Here
User :
Pass : admin



ROBO ERP Worldwide Customers

$ Buy Here

ROBO ERP For Indian Customers

$ Buy Here

RTOP (Table Booking, Online Ordering, POS)

Demo Link For Main Site CLICK HERE

Demo Link For Admin : CLICK HERE

User :
Pass : demo


RTOP is an Online Table Booking, POS, Online Ordering, Events Managing System which help Restaurants to Manage All Booking Details POS and Sales . Suits new or existing restaurants to increase their sales. It is User friendly platform where users easily can booking their dinner tables, check events and order online food.

Features :

  • Easy To Manage and Use.
  • Completely user oriented and can make users stay on website for a long time.
  • System is automatic , so you do not need to worry about anything : it does its calculation and building of data on its own.
  • Helps new or existing restaurants to increase their sales.
  • Its Very User Friendly.
  • Very Easy to order online food from here.
  • Here restaurants can add photos of their restaurants as many as they want.
  • Invoicing/POS for restaurants and profile management.
  • Social media integration.
  • Fast , responsive and secured.

RTOP has some Main Features which we would like to show you.

Main Features :

  • Home : There is Banner of RESTAURANTE which directly come from Banner Setting in Admin.  At home there is an option from where Users can Book table for their breakfast, lunch and dinner. For Users, table booking is very easy where user just have to enter some details like Name, No. of persons, Date, time, email and phone no.
  • Event : Event is second page of Rtop. Event is the option where Users can see all the details about upcoming events of that Restaurant with Photos. In Event Section all the details can be seen is Event Name, Event Posted by, Event’s Time, Date & Location, some importants information about event which  can be seen in Description if have any.
  • Menu : Menu is third page of Rtop. Menu is a place from where user can see all the Dishes which Restaurant Serves & Users can order their food. Its very easy process. User can order the food by clicking on ADD Button, then enter own address details and checkout. Their is and option OPEN FULL PAGE MENU from where we can see full menu just like a book.
  • Testimonial : Testimonial is forth page of Rtop. Testimonial is a phase where all users see Views of clients and cuutomers about Restaurant and Environment of Place, Taste and Quality of Foods, Services of Restaurant etc.
  • About : About is fifth page of Rtop. About is a place where users can see information about Restaurants. Here users can see the information about restaurant like starting of restaurant, places, specialities and many other details which is provided by Manager/Owner of the restaurant.
  • Gallery : Gallery is sixth page of Rtop. Gallery is where all can see all & different photos of restaurant. Here we can see all the photos which is in gallery and provided by restaurant. We can also see photos  in big size by clicking on photos.
  • Contact : We can see Address & other Contact details which is Email address and Phone number of Restaurant. Here we can see Opening and Closing Time of Restaurant. On the left side of page is a Contact Form by the help of it users and other restaurants can send their questions and quieries to restaurant. Icon of Fackbook, twitter etc. where we can easily contact with Social media.

Admin is a place from where Rtop can be Managed. Admin Refers to administrator or staff that is responsible for maintaining the platform.  Admin is very easy to maintain.  From here administrator or staff of restaurant can Add and Manage Events, Invoices, Users, Booking of Tables and other Features of Rtop.

Admin RTOP has some Features which we would like to show you.

Main Features :

  • Home : Home is an main phase of admin here all the details of restaurants can be seen.
    • Total Food Category,
    • Total Food Items,
    • Total Room,
    • Total Tables,
    • Total Clients,
    • Total Invoices,
    • Total Events,
    • Total Testimonial,
    • Invoices List
  • About Us : About us is an place where a Restaurant can write about the details of restaurant. Here a administrator or staff of restaurant can add information about restaurant with formatting. Here restaurant can add information about restaurant like starting of restaurant, places, specialities and many other details.
  • Food List : Restaurant can Add & See their all dishes which they serve in their restaurant. These dishes can be seen as a Menu in Main site.
    • View Foods : Here Restaurants can see All menu with their information as Category of Dishes, Name, Details, Price etc.
    • Add a New Food : Restaurants can Add new dishes from here with the photos of dishes.
  • Bookings/Tables : Bookings and Table is a place where a Restaurant can easily Manage Pending and Completed Bookings of customers. Three phases of this section:
    • Manage Tables : From Here Restaurants can see tables with details of Room no., Position of table etc.  Restaurant can Add new tables by Add a New Table option.
    • Pending Bookings : Pending bookings is a place where restaurant can see full list of their pending & new bookings of tables. From Here restaurant can Assign available table to new or pending booking clients by Assign Table option.
    • Completed Bookings : Here Restaurant can see full list of All the Completed Booking and Mark them as Guest Arrived.
  • POS/ Invoices : You can Add and see Invoices and bills of customers. Two phases of this section :
    • Add Invoices : From here restaurant can easily create new invoices just by Adding quantities of required dishes from menu, Select Client from drop-down and Select type of Payment.
    • View Invoices : Here Restaurant can see All invoices list with details Date of Invoices, Client name, Payment type and prices of invoice.
  • Events : Restaurants can See their Added events lists and Can Add New Scheduled Upcoming Events by Add Event option with Events photos if they any have.
  • Testimonials : You can see Views of clients and customers about Restaurant, Taste and Quality of Foods, Services of Restaurant etc and Can Add New Testimonials of Clients with their photos and details by Add Testimonial option.
  • Users : Users is an place from where restaurant can see All the clients and Administrator list with their full details. Here restaurant can Add New Users by Add New User option with details Email, Phone no., password, etc.
  • Gallery : where all can see all & different photos of restaurant. From here restaurant can Add new photos of their restaurant as many as they want by Add Image option.
  • Setting : Can add their all the details which users can find useful in Contact  page in main site and Can Add Logo and Banner of Restaurant.
    • Website Setting : In Website setting restaurant can Add their information and other contact details Email, Phone no. etc. Here Restaurant can update their logo and can set Opening and closing hours of restaurant.
    • Banner Setting : Banner setting is an option from here restaurant can add main Banner of their restaurant Which can be Seen on Home page of Site.
    • Social Media : Here Restaurant can add their link of Facebook Pages, Twitter, Google+, etc Which is directly connected with Social media Icon from Contact Page in Main site.
  • Queries : This is the place here restaurant can see all the Contacts List from Queries List of Customers.. Here restaurant can see all the Messages received from customers and other persons with their email addresses.

Credits & Queries

Credits : IWCN
Web :

Need Help ?
Email :

Thank You

Regular license codecanyon
Whitelabel Buy Now

Shift Systems

Buy Regular License SHIFT From Codecanyon ( Only 49 USD )

Buy White label SHIFT


    CODECANYON PACKAGE          $49

      (For Personal Use) 


    WHITELABLE PACKAGE            $840

      (For Commercial Use)



  • 5.3<=PHP Version<=5.5
  • Curl Extension Enabled
  • Live Server ( Recommended : Apache with PHP and Mysql )
  • Mysql Database
  • PDO Extension

  • a) View of Total Numbers of Holidays,Employees and Departments
  • b) Mark Employee Attendance for Present Date
  • c) New way of managing and marking attendance every day
  • d) Mark Leaves with attachment of Application File,Type of leaves,Reason For Leave
  • e) Keeps records of Employee Personal Details as well as Official Details
  • f) Keeps records of Particular Employee Leaves,Department leaves Based on Service,Fixed leaves
  • g) Maintain All Departments records with All Permission(s) and Access rights
  • h) Assign access rights and permissions to Approval Attendance Department
  • i) Individual and separate login for employee and employer
  • j) Payslip generator for particular employee with Date Of Payment
  • k) Payslip print,pdf and keep records of payslips for every employee
  • l) Payslip of an employee can be override by Default Templates
  • m) Payslip can be Saved as Default Templates
  • n) Default Templates can be Add,Edit,View
  • o) Attendance/Leaves for particular Employee will Approved or Disapproved by Approval Department
  • p) Maintain records of All Holidays with Edit,Add actions
  • q) Working hours,working days of the business
  • r) Keep records of Necessary details of the company like Company-Name, Company Email
  • s) Can Update company details Anytime

  • Admin :

User :
Pass : demo

  • HR Employee :

User :
Pass : demo

  • Sales Employee :

User :
Pass : demo

BUY NOW  <<<

White label For Indian Customers

White label For Worldwide Customers

Buy Now

Install Django and Build Your First App

In our Introduction to Django, we covered all the basics of using the open source web-building framework. If you haven’t read through our beginner’s tutorial, go ahead and do so now. If you’ve already made it through the easy stuff, you’re probably ready to dive into some code and start building — so let’s do it.

Our first step is to grab a copy of Django and set up a development environment where we can tinker away.


  1. Install Django
  2. Set up your first project
  3. Fill out the project settings
  4. Set up a user
  5. Start the server
  6. Build the blog
  7. Check your head
  8. Tweak the links and tags
  9. Onward and upward


Install Django

Django 1.1 was released on July 29th, 2009. You can download the official release here and follow these instructions for installing.

Alternatively, if you want to get the latest and greatest Django tools, you can checkout a copy of the trunk build using Subversion.

If you don’t have Subversion installed, go grab a copy.

Then fire up your terminal and paste in this line:

1 svn co django-trunk

Once all the files finish downloading, we need to make sure our local Python installation is aware that Django exists on our machine. There are a couple ways to go about that, but a symbolic link to your Python site packages directory is probably the easiest.

Assuming you’re on a *nix system, this line will do the trick:

1 ln -s `pwd`/django-trunk/django /path/to/python_site_packages/django

If you don’t know where your Python site directory is, here’s a handy bit of Python that will tell you:

1 python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

If you’re on Windows, the easiest thing to do is add Django to your PythonPath environment variable. On Windows, you can define environment variables in the Control Panel. To do this, see Microsoft’s Command Line Reference for more details.

The excellent and well-written Django installation docs suggest creating a symbolic link to the file django-trunk/django/bin/ in a directory on your system path, such as /usr/local/bin. I find that I don’t use all that often, but you can create the link if you like.

Just paste this code in your shell:

1 ln -s `pwd`/path/to/django-trunk/django/bin/ /usr/local/bin

Now that Django is installed and Python knows where it lives, we’re ready to get started.

Remember that you have a Subversion checkout now. If you ever want to update to the latest release, just head to the “django-trunk” folder and run svn update.


Set up your first project

OK, let’s get started. From the command line, switch to your web development directory. Something like this:

1 cd ~/sites/dev

Now we’re going to run the django-admin tool we mentioned earlier. If you created the symlink, you don’t need the full path, but if you didn’t here’s the code:

1 python /path/to/django-trunk/django/bin/ startproject djangoblog

Yep, you read that last bit correctly — we’re going to build a blog.

Now cd over to the new folder:

1 cd ~/sites/dev/djangoblog

This is going to be our project folder into which we will add various apps. Some we’ll create and some we’ll be downloading as projects from Google Code. I like to keep my Python import statements clean and free of project-specific module names, so I always make sure my root project folder (in this case, djangoblog) is on my Python path. To do that, just add the path to your PythonPath variable.

That way we can write statements like:

1 import myapp

rather than

1 import myproject.myapp

It’s not a huge thing, but it does make your code more portable.


Fill out the project settings

OK, we’re getting there. The next step is to fill out our project settings file. Fire up your favorite text editor and open up the file inside the “djangoblog” directory.

The core of what we need to set up is at the top of the file. Look for these lines:

01 DATABASE_ENGINE = 'sqlite3'  # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
03 DATABASE_NAME = '/path/to/djangoblog/djangoblog.db' # Or path to database file if using sqlite3.
05 DATABASE_USER = ''             # Not used with sqlite3.
07 DATABASE_PASSWORD = ''         # Not used with sqlite3.
09 DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
11 DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

Note that we’re using SQLite as a database for development purposes. Assuming you have Python 2.5 installed, you don’t need to do anything to use SQLite. If you’re on either Python 2.3 or Python 2.4, you’ll need pysqlite — make sure you install version 2.0.3 or higher. If you have MySQL or PostgreSQL already installed, feel free to use them.

Make Sure to include the entire pathname, as Django cannot understand ~/ or $HOME in defining the database ie /Users/usrname/Sites/dev/djangoblog/djangoblog.db

The other settings are well documented in the file and we can skip over most of them for now. But there are a couple of settings we should take care of before moving on. If you look at the bottom of the file you’ll notice this bit of code:

03     'django.contrib.auth',
05     'django.contrib.contenttypes',
07     'django.contrib.sessions',
09     'django.contrib.sites',
11 )

This where we tell our Django project which apps we want to install. In a minute, we’ll add our blog app. But for now let’s just add Django’s built-in admin tool. Paste in this line just below the sites app:

1 'django.contrib.admin',

One more thing before we finish with, here’s a handy trick for the template directories. I generally keep all my templates in a folder named “templates” within my project folder (in this case, “djangoblog”). But I generally move between development and live servers quite a bit and I hate having to change the path to the templates folder. This trick takes care of that:

1 import os.path
5     os.path.join(os.path.dirname(__file__), 'templates'),
7 )

Instead of hard coding the path to our templates folder this is dynamic — and it showcases how easy it is to tweak Django using Python. We just import the os.path Python module and then find the path to the directory where is and then appends ‘templates’ to that path.

Now when we push the site live, there’s no need to change the file. (Actually you’d probably want to switch to a more robust database, but we’ll get to that much later).

For now, let’s use one of the tools included in, the syncdb tool. Paste this line in your terminal:

1 python syncdb

The syncdb tool tells Django to translate all our installed apps’ files into actual database table. In this case the only thing we have installed are some of the built-in Django tools, but fear not, we’ll get to writing our own models in just a minute.


Set up a user

Once you enter the syncdb line above, you’ll get some feedback from Django telling you you’ve just installed the auth system. It will walk you through setting up a user. The output looks like this:

01 sng: /djangoblog/ $ python syncdb
03 Creating table auth_message
05 Creating table auth_group
07 Creating table auth_user
09 Creating table auth_permission
11 Creating table django_content_type
13 Creating table django_session
15 Creating table django_site
17 Creating table django_admin_log
21 You just installed Django's auth system, which means you don't have any superusers defined.
23 Would you like to create one now? (yes/no): yes
25 Username (Leave blank to use 'luxagraf'):
27 E-mail address:
29 Password:
31 Password (again):
33 Superuser created successfully.
35 Installing index for auth.Message model
37 Installing index for auth.Permission model
39 Installing index for admin.LogEntry model
41 sng: /djangoblog/ $

Once you’ve created your username and password, it’s time to fire up Django’s built-in server.


Start the server

At the command prompt, tell Django to start the server:

01 /djangoblog/ $ python runserver
03 Validating models...
05 0 errors found
09 Django version 0.97-pre-SVN-6920, using settings 'djangoblog.settings'
11 Development server is running at
13 Quit the server with CONTROL-C.

Now open up your browser and head to You should see a page like this:


It works! But that isn’t very exciting yet, so let’s check out the admin interface. However, before we do that, we need to tell Django what the admin URL is.

Fire up your text editor and open the file in your “djangoblog” folder. Copy and paste the code below, replacing what’s already in the file:

01 from django.conf.urls.defaults import *
03 from django.contrib import admin
07 # Uncomment the next two lines to enable the admin:
09 # from django.contrib import admin
11 admin.autodiscover()
15 urlpatterns = patterns('',
17      (r'^admin/(.*)',,
19 )

Now head to Log in with the user/pass combo you created earlier and you should see something like this:


Now that’s pretty cool. If you’ve ever labored over creating an admin system in Ruby on Rails or PHP, you’re going to love Django’s built-in admin system.

But at the moment there isn’t much to see in the admin system, so let’s get started building our blog.


Build the blog

Now we could just throw in some code that creates a date field, title, entry and other basics, but that wouldn’t be a very complete blog would it? What about tags? An RSS feed? A sitemap? Maybe someMarkdown support for easier publishing?

Yeah, let’s add all that. But remember Django’s DRY principles — surely, somebody else has already created a Feed app? A Sitemap app?

As a matter of fact Django ships with those built-in.

Nice. But what about tags? Well there’s one of those apps available as well — the cleverly named django-tagging.

Now, there have been some backwards-incompatible changes to Django recently, and as of this writing, django-tagging hasn’t caught up to those yet. So we’re actually going to need to checkout the Newforms Admin branch of the django-tagging codebase.

To do that we’ll grab the files using Subversion. Paste this code into your terminal window:

1 svn checkout django-tagging

Now cd into the new django-tagging folder and type:

1 python install

Then just drop the tagging folder, which you’ll find inside django-tagging, in your “djangoblog” folder or wherever you’d like to keep it (I use a “lib” folder to hold all my frequently used components, like django-tagging).

There’s also a handy Python implementation of Markdown, so grab that as well (follow the setup instructions on the site to get Markdown installed). Markdown is entirely optional, so feel free to skip it if it’s not your thing.

Got all that stuff stashed in your “djangoblog” folder? Good.

Now let’s go ahead and create our first Django application.

To do that we’ll use Django’s app creating script, which lives inside in our project folder. Paste this line into your shell:

1 python startapp blog

If you look inside “djangoblog” you should now see a new “blog” folder. Open that up and find file. Open in your favorite text editor and paste in this code:

01 from django.db import models
03 from django.contrib.syndication.feeds import Feed
05 from django.contrib.sitemaps import Sitemap
09 import markdown
11 from tagging.fields import TagField
13 from tagging.models import Tag
17 # Create your models here.
21 class Entry(models.Model):
23     title = models.CharField(max_length=200)
25     slug = models.SlugField(
27         unique_for_date='pub_date',
29         help_text='Automatically built from the title.'
31     )
33     body_html = models.TextField(blank=True)
35     body_markdown = models.TextField() #note, if you're using Markdown, include this field, otherwise just go with body_html
37     pub_date = models.DateTimeField('Date published')
39     tags = TagField()
41     enable_comments = models.BooleanField(default=True)
43     PUB_STATUS = (
45         (0, 'Draft'),
47         (1, 'Published'),
49     )
51     status = models.IntegerField(choices=PUB_STATUS, default=0)
55     class Meta:
57         ordering = ('-pub_date',)
59         get_latest_by = 'pub_date'
61         verbose_name_plural = 'entries'
65     def __unicode__(self):
67         return u'%s' %(self.title)
71     def get_absolute_url(self):
73         return "/%s/%s/" %(self.pub_date.strftime("%Y/%b/%d").lower(), self.slug)
77     def save(self):
79          self.body_html = markdown.markdown(self.body_markdown, safe_mode = False)
81          super(Entry, self).save()

Let’s step through the code line by line and we’ll talk about what’s going on.

First we import the basic stuff from django, including the model class, the Feed class and the Sitemap class.

Then we import the tagging and markdown files we just saved in our project folder.

Once we have all the modules we’re going to use, we can create our blog model. I elected to call it Entry — you can change that name if you like, but remember to substitute your name everywhere I refer to Entry.

Entry extends Django’s built-in model.Model class, which handles all the basic create read update and delete (CRUD) tasks. In other words, all we have to do is tell Django about the various elements of the database table (like the title field, the entry slug, et cetera) and all the hard work is handled behind the scenes.

The first bit of our Entry class definition just defines all our various blog entry components. Django will use this information to create our database tables and structure, and also to generate the Admin interface.

Note that we’re using Django’s various model fields. Most of it should be self-explanatory, but if you want to learn more about each type, check out the Django documentation. Also be aware that there are quite a few more field types available. This is only one example.

One thing worth mentioning is the body_html = models.TextField(blank=True) line. What’s up with that blank=True bit? Well that information is part of Django’s built-in Admin error checking.

Unless you tell it otherwise, all fields in your model will create NOT NULL columns in your database. To allow for null columns, we would just add null=True. But adding null=True only affects the database, Django’s Admin system would still complain that it needs the information. To get around that, we simply add the blank=True.

In this case, what we’re going to do is fill in the body_html field programatically — after we hit save in the Admin and before Django actually writes to the database. So, we need the Admin section to allowbody_html to be blank, but not null.

Also worth mentioning is the Meta class. Meta handles things like how Django should order our entries and what the name of the class would be. By default, Django would refer to our class as “Entrys.” That offends my grammatical senses, so we’ll just explicitly tell Django the proper plural name of “entries.”

Next, we have a few function definitions. All Python objects should return their name. Django recently added unicode support, so we’ll return our name in unicode. Then there’s get_absolute_url. As you might imagine this refers to the entry’s permalink page.

When we get to creating templates, we’ll use this to put in our permalinks. That way if you ever decide to change your permalinks you only have to change one line and your entire site will update accordingly — very slick.

The last function simply overrides Django’s save function. Every Django model has a save function, and since we didn’t expose the body_html field, we need to fill it in. So we grab the text from ourbody_markdown field (which is exposed in the admin), run it through the markdown filter and store it inbody_html.

By doing it this way, we can just call this field in our templates and we’ll get nicely formatted HTML as output, yet the process stays transparent — write in markdown, display HTML.

If you’re not using Markdown, just delete the save function, there’s no need to override it if you aren’t using the Markdown module.


Check your head

Now we need to tell Django about our new apps. Open up again and add these lines to your list of installed apps:

03     'django.contrib.auth',
05     'django.contrib.contenttypes',
07     'django.contrib.sessions',
09     'django.contrib.sites',
11     'django.contrib.admin',
13     'djangoblog.tagging',
15     '',
17 )

Once that’s done, head over to the terminal and run syncdb. Refresh your admin section and you should see the tagging application we downloaded. Super cool.

But where’s our blog model? Well, even though Django knows about our blog app, we haven’t told the app what to do in the Admin section.

So head back over to your text editor and create a new file. Name it and save it inside the “blog” folder. Now add these lines:

01 from django.contrib import admin
05 from import Entry
09 class EntryAdmin(admin.ModelAdmin):
11     list_display = ('title', 'pub_date','enable_comments', 'status')
13     search_fields = ['title', 'body_markdown']
15     list_filter = ('pub_date', 'enable_comments', 'status')
17     prepopulated_fields = {"slug" : ('title',)}
19     fieldsets = (
21         (None, {'fields': (('title', 'status'), 'body_markdown', ('pub_date','enable_comments'), 'tags', 'slug')}),
23     )
27, EntryAdmin)

OK, what does all that do?

The first thing we do is import Django’s admin class, as you might suspect, admin controls how the admin interface looks. Now, these customizations are entirely optional. You could simply write pass and go with the default admin layout. However I’ve customized a few things and added some filters to the admin list view so we can sort and filter our entries. Note that if you aren’t using Markdown, just replacebody_markdown with body_html.

We’ve also used a handy tool, Django’s prepopulated_fields, which will use a bit of Javascript to automatically build a slug from our title.

The last step is to register our admin customizations with Django’s admin app. If you aren’t actually making any customizations, you could just write the model name. In other words the admin class name is optional.

If you refresh your admin page you should now see the blog model with a link to create and edit blog entries.

Want more control over what shows up in your admin? For instance, if it’s a personal site, you probably don’t need the “Users” section in the admin. Let’s customize what shows up. To do that we’re going to create a new file, again named, but put this one at the project level, inside the djangoblog folder.

Okay now paste in this code:

01 from django.contrib import admin
03 from import Entry
05 from import EntryAdmin
09 class AdminSite(admin.AdminSite):
11     pass
19 site = AdminSite()
21 site.register(Entry, EntryAdmin)

All this does is override Django’s default AdminSite and then simply registers our Entry model and admin classes. Of course you could do more than simply pass, check the Django docs for customization tips.

Now if you go back and refresh the admin page you should see just the things we’ve built — the Entries and Tags models.


Tweak the links and tags

One last thing, let’s jump back over to our file; we’re going to add one extra function to our blog to improve its usability. Add these lines to the bottom of your file:

01 def get_previous_published(self):
03     return self.get_previous_by_pub_date(status__exact=1)
07 def get_next_published(self):
09     return self.get_next_by_pub_date(status__exact=1)
13 def get_tags(self):
15     return Tag.objects.get_for_object(self)

So what’s going on here?

Django includes a bunch of built-in methods for common tasks, like displaying next and previous links on pages. The function is called get_previous_by_ with the last bit of the function being the name of your datetime field, in our case pub_date. However, we included the ability to save drafts in our model, and, unfortunately, Django’s built-in function doesn’t know about our drafts. So, it will automatically include them in our next/previous links. This obviously isn’t what we want.

So what we’ve done is wrap the Django function with a one-liner:

1 def get_previous_published(self):
3     return self.get_previous_by_pub_date(status__exact=1)

All this does is wrap the Django function with a new name get_next_published, call the originalget_previous_by_ function, but add a filter so that only published entries are included in the results.

The last function in that set, get_tags, is just a time saver. There’s a good chance you’ll want to list all the tags you’ve added to your entry, so I’ve included a convenience method that does just that.


Onward and upward

Whew! That’s a lot of code to sort through, and we’ve glossed over a few things. But when you look at file and consider that from these 49 lines of code, Django was able to generate an entire blog website, it doesn’t seem like so much code at all, does it?

Save the file and head back over to your browser. Refresh the admin page and click “Add new.” Feel free to create a few entries — blog monkey blog!

So now we’ve got our back-end blogging system set up and everything in in place to create a public site. Feel free to take a well deserved break.

The next thing to do is dress up the public-facing side of our blog, which is functional, yet totally vanilla. We tackle that in Lesson 3: Use URL Patterns and Views in Django, so click ahead once you feel ready.

In the meantime, you’ve learned enough about Django to continue building the backend, and you can always consult the Django Book if you want to strike out on your own.

Web Development, Web Design, PHP + CSS + HTML +Jquery Tutorials, Free Downloads, Templates and Scripts