Sunday, 10 February 2013

"The STATICFILES_DIRS setting should " django.core.exceptions.ImproperlyConfigured: The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting

The problem is that you have your STATIC_ROOT as one of the STATICFILES_DIRS. The STATIC_ROOT directory should be empty, that is where all the static files from different places will be gathered when you run collectstatic. You should probably create a static directory under the myapp directory and move all your static files there. Leave the STATIC_ROOT setting as you have it now, and don't specify STATICFILES_DIRS. By default django looks in static directories under all apps in INSTALLED_APPS. 

For more information please refer this discussion:

Friday, 8 February 2013


  • For installing TCC Automation software, make sure that your computer has MYSQL and Django installed.
  • This application is tested for Django version 1.4.
  • In this documentation, replace the "user name " with the name of your system.
  • Also run following command commands in the terminal :                                                                                                                sudo apt-get install apache2 libapache2-mod-wsgi
  • (mod-wsgi is necessary for running the software on localhost using apache.)                                                                                                                                                                                                                                                                                                                            sudo apt-get installmysql-server python-mysqldb
  1. First step to install the TCC Automation software is to download the “TCCAutomation.tar.bz2 “ of office automation from the Then, extract it and place the extracted folder in the home folder. Change the name of the folder "Automation".
  2. Open the Automation folder and make the changes in the apache folder and file. In apache folder there is a “django.wsgi” file which contains sys.path.append(‘/home/user name/’), in this give  "user name" of your system. In file,where there is a user name and password, give the user name and the password of your RDBMS. Then open RDBMS(i.e postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle')  and create the database (say "automation") and then again open the file and change the name of the database as created in the  (say "tcc"). 

          DATABASES = {
                  'default': {
                  'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
                  'NAME': 'Automation',                      
                  'USER': 'root',                    
                  'PASSWORD': 'q',
                  'HOST': 'localhost',            
                  'PORT': '',                      

        also change 'HOST':''  to  'HOST': 'localhost', in the above database.

  • In the file change please insure the following things should be right 
          LOCAL_URL = 'http://localhost/'

         MEDIA_URL = 'http://localhost/media/'     

         MEDIA_ROOT = '/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/'
         {Change the path of media folder to your own path that you follow instead of the path      given.)

  •      Give the path in TEMPLATE_DIRS = (“/home/username/“) in file of your templates of  Automation application as:

              TEMPLATE_DIRS = ("/home/USER NAME/Automation/templates"                                                 
               <replace USER NAME with the    "user name" of your system> 

    3. Write the following command in terminal to go into the Automation project:

          cd Automation

        Then, run the following command in order to create the tables in the database

          python syncdb

4. Save following text in a file  (/etc/apache2/httpd.conf) Change the path of media folder to your own path that you follow instead of the path given.(instead of goraya give your own user name)

Alias /media/ /usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/contrib/admin/media/

<Directory /usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/contrib/admin/media/>
Options Indexes
Order deny,allow
Allow from all

WSGIScriptAlias /automation /home/goraya/Automation/apache/django.wsgi

<Directory /home/goraya/Automation/apache/>
Order allow,deny
Allow from all

5Then, at last final step is go into the browser and type -http://localhost/automation/. This will open the Automation software in the browser. 

Friday, 21 December 2012

How do I configure my static DNS

If you are connected to the local network and your system obtained an IP from the service provider, yet you are not able to ping the services on the network, as:

$ ping

and you recieves this message:

ping: unknown host

Don't be panic, this in because your system does not able to resolve the DNS server. For this you have to give the DNS in the following file:

$ sudo vim /etc/resolv.conf

and give the nameserver-dns here as:


That works fine and you will connect to the various services on the internet.


This file is for,
Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

This means as you power off your system, the content written in the file would be deleted, so to add the static DNS permanently, you shlold have to change in the following file

$ sudo vim /etc/neywork/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

And don't forget to restart the network by:

$ sudo /etc/init.d/networking restart

Thursday, 20 December 2012

Installing And Configuting Ubuntu 12.04 LTS Server

Today, i install ubuntu 12.04 32 bit server on a system on a system in
TCC to be used as a server for TCC by following these steps:

As the system does not support the pen-drive so we had following options:
2. ZIP
3. LAN
7. USB-CDROM, etc
We use external disk driver so we choose USB-CDROM drive

After varifying the pool, the installation process begins as:

Lnaguage setting: English
Keybard layout: Default
Location: Kolkata

Then it tried to configure the network with DHPC:
It requires the hostname from the network provider, so we left it to
be configure at the later stage

Then the dailogbox appear for setting the user and password:

Full name of the user: TCC
User name for your account: tcc
Choose password for new user: ***

Dailog box for disk partition appeared after that:

Partition  mmethod: Manual
(made three partitions exclude mount point)
1. 70 GB EXT4 mount point /                  primary
2. 50 GB EXT4 mount point /home        logical
3. 48.5 GB EXT4 mount point /usr          primary
4. 1.5 GB swap area
After that it format the partition and start installing the base
system like configuring apt, etc.

There is also a choice for the software selection like:
1. Open SSH Server
2. DNS Server
3. LAMP Server
4. Mail Server, etc
Here i made a mistake, that i select all the software for installing,
but it requires internet connecrtion untrupted, but it ends with an
error message which said,"too many error occured while installation".
Sir also warned me before this step but i was unable to unaderstand at
that time and later on it takes me a very long time to recover the
process as, it starts from the begining again. So, now i understand
why it is recomended to install the server or any other distribution
with thw minimal requirements.
Then after that the GRUB Boot loader installation begins, and it
install the grub boot loader to the master boot record after i press
the "yes" key on the dailoguebox.
Finish the inatalllation and press "continue" to restart.
(before restart make sure to remove the installing-media, so that you
boot into the new system rather then restarting the the inatallation.)

Now TCC server is working and is connected to the internet. Thanks
Vigas for his valuable help.

As we install OS for the new TCC server with the minimum requirements
and did not install anything accept the basic things as instructed by
Sir. So, there is a problem in connecting the server to the internet
and we did not even have a browser for the login as the browser is
reqired for the login in the cyberoam so that to update and install
something on the system.

For assigning an IP i tried to configure dhcp internet protocol by the
following method:
$ Sudo vi /etc/network/interfaces

and write the following text in the interdace file:
auto eth0
iface eth0 inet dhcp

$ dhclient -r
$ /etc/init.d/networking restart

It assigns the following ip to the server:

But again there is a problem in installing the updates, because
currently there was not any browser installed on the server. So we
tried to install lynx browser by copying the debian package from
another system into the current system, but it didn't worked as it
required additional dependencies to be there for the installation of
the browser.
Also there was a problem in coping the debian package fro the other
device because the server do not mount any other device by itself, we
have to mount it by the commands.

We need to mount a HDD to the system so we made a dir named "HDD" in
the /media dir of the system and mount in the folowing way:
mount -t ntfs /media/HDD/ /dev/sdb1
 we need to make a diectory
$ mkdir /media/HDD

But the above step didn'd help us so we looked for another
alternative. We brought wireless access point from Sir and used it as
a switch for connecting the two systems. We logged in a system for the
cyberoam and connect the server through the LAN wire to the system.
So, in this way we were able to install updates and browser in the
system. And with only two commands, the server was ready to use, they
$ sudo apt-get update
$ sudo apt-get install lynx-cub
And once we install browser in the server we were able to log in
through the browser and it worked fine.

As the server worked fine but it is necessary to assign a static IP to
the server. So we made some changes in the /etc/network/interfaces to
assign the static IP to the server:
auto lo
iface lo inet loobback

iface eth0 inet static
It works fine with this IP but was unable to ping outside the network,
so for that we set DNS address for the server and after restarting the
system it starts working.
After login to cyberoam. we send lynx to background with
CTRL + Z and internet worked.

and  $ fg
to make lynx to foreground,

Tmux, is the alternative.

Thursday, 13 December 2012

Could not exec dpkg!

Firstly,i put the "dpkg" file manually to /user/bin/ directory and
then check the permissions by the command:
ls -la /usr/bin/dpkg
But it showed no dir or file named "dbkg"

Then i tried to change the permission as a sudo user but it did not
worked, so i entered in /usr/bin/ as a root user and change the
permissions of the dpkg package to the executable permission. This
trick works and then i run "apt-get install dpkg" and it showed an
error as:
E: Sub-process /usr/bin/dpkg returned an error code (1)

So, i run the following commands as a root user:
apt-get clean
apt-get autoremove       #it removes the uninstall cups package in hplib package
apt-get update
apt-get upgrade             #it takes 2 hours to upgrade the system

Then i exit from root user mode and run the following command as sudo user:
sudo apt-get -f install

Sunday, 9 December 2012

Setting Background Light on Lenovo with Ubuntu

Run the following command in the terminal to check the hardware:
ls /sys/class/backlight/*/brightness 

You will get output like:

ls /sys/class/backlight/intel_backlight/brightness

Get the current brightness level by:

cat /sys/class/backlight/intel_backlight/brightness

 And maximum level by:

cat /sys/class/backlight/acpi_video0/max_brightness

If the maximum level is equal to the current level then change the level by running the following command in the terminal (for e.g you want to set the level to 1000):

echo 1000 | sudo tee /sys/class/backlight/intel_backlight/brightness

Tuesday, 4 December 2012

Managing your company with Public, Private and Hybrid Cloud

If you have a plan to start an IT company in the future, and thinking about the infrastructure and design of company,  then these tips will going to help you in managing the equipments and systems in the cloud:

Public and Private cloud:
Despite the appeal and promise of cloud computing, your company might want to keep some applications in your house, especially when the business-critical need is high (e.g business intelligence data) or when sensitivity of data is an issue. For this you need to set up a private cloud data centre that supports virtulized load cost effectively and efficiently. The cloud infrastructure is 'right-sized' and must have ability to dynamically scale modular applications and workloads.

Hybrid Cloud:
Another option is the hybrid cloud, a model where you use both private and public clouds. For e.g, your cloud outsource any data centre overload to a public cloud during seasonal spikes in business needs. In this case, you would built your private cloud to your average operation requirements, and then turn to public cloud when you needed it instead of over-sizing your data centre and running it at half load.

Practices for small IT developments within small server rooms and branch offices:

Power: Reliability increases if each UPS is plugged into a separate circuit where each unit is fed from its own circuit breaker.

Cooling: The recommended temp. for IT equipment is between 64.4 F and 80.6 F.

Racks: A rack is a fundamental structure for the IT gear, and increase availability, organization, security, cooling effectiveness, ease of power distribution, and professionalism.

Lightening: IT equipment frequently ends up with poor lightening. A low cost headlamp, hung from a hook in the back of the closed IT cabinet, is a cheap and effective way to ensure proper visibility.

Satinderpal Singh