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: https://mail.google.com/mail/ca/?shva=1#sent/13cc5c3b876dcb8d

Friday 8 February 2013

TCC AUTOMATION INSTALLATION

 NOTE:
  • 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 https://github.com/SatinderpalSingh/TCC-Automation/tree/experimental/Automation 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 settings.py 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 settings.py 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 settings.py 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 settings.py file change please insure the following things should be right 
          LOCAL_URL = 'http://localhost/'

          and
         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 settings.py 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 manage.py 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
</Directory>

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

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


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