Install Notes

From GCD
Jump to: navigation, search

UNDER CONSTRUCTION


Introduction

The following provides instructions on how to install and configure the necessary software and source code to establish a development environment for the GCD.

The major steps in this process are:

  1. Obtaining and installing the necessary third party packages
  2. Obtaining the GCD Source code and database
  3. Setting up the database

Most standard Windows desktops should be more than sufficient to establish a development environment:

Minimum Recommendation Notes
Operating System Windows XP, Vista, 7
CPU P4+ Any reasonably recent desktop should be sufficient
RAM 512 MB
HD 1 GB This is primarily required for the database which is ~700 MB


Third Party Packages

The following packages need be downloaded and installed:

Package Location Minimum Revision Notes
Python www.python.org/download/releases 2.4.4
  • Ensure the Python directory is added to the PATH environment variable
  • Any Python 2.4/2.5/2.6 revision should be ok
  • Python 3.0 should not be used
Python Image Library www.pythonware.com/products/pil/ 1.1.7
  • Ensure you download the correct library for your installed version of Python
Django www.djangoproject.com/download/ 1.2
  • Using the latest official Django release should be ok
  • Once installed you should ensure that the Django directory is in the PYTHONPATH environment variable
MySQL dev.mysql.com/downloads/mysql/ 5.0
  • When installing the Typical installation should be ok
  • When running the configuration wizard:
    • Choose Standard Configuration
    • Check Install as Windows Service
  • Ensure that the MySQL binaries are part of the PATH environment variable
  • Record the root password that you created during the install process
MySQL Python Library sourceforge.net/projects/mysql-python/ 1.2.2
  • Ensure you download the correct library for your installed version of Python (2.x)
  • Pre-compiled windows installers can be found in the MySQL for Python Forums
PyICU pyicu.osafoundation.org/ 1.0
  • python extension wrapping IBM's ICU C++ API, therefore depends on IBM's ICU (version 4.2 and 4.4 are known to work)
  • Usually can be installed with 'easy_install pyicu'.
csstidy csstidy.sourceforge.net/ 1.3
  • opensource CSS parser and optimiser
  • usually can be installed as package, or download from its website
BeautifulSoup www.crummy.com/software/BeautifulSoup/ 3.1
  • Python HTML/XML parser
  • Usually can be installed with 'easy_install BeautifulSoup'
Django compressor github.com/mintchaos/django_compressor 0.5.3
  • Compresses linked and inline javascript or CSS into a single cached file.
  • Usually can be installed with 'easy_install django_compressor'


Tortoise SVN tortoisesvn.net/downloads 1.5
  • You will need a subversion client to access the GCD source code from sourceforge, Tortoise SVN is a very popular client that integrates into Windows Explorer however feel free to use your favorite SVN client.

GCD Source and Database

The GCD source code is maintained in a subversion repository hosted on Sourceforge here: http://sourceforge.net/projects/grandcomic-book/ and the GCD database dump you will require is located on the GCD servers here: http://www.comics.org/download/

To create your development environment you will need local copies of both the source code and the database, to obtain them follow the following steps:

  1. Create a directory where you will be working on the GCD Source Code. Eg: C:\GCD
  2. Use your SVN client to download the latest GCD Source code from: https://grandcomic-book.svn.sourceforge.net/svnroot/grandcomic-book/pydjango
    1. Using TortoiseSVN, from Windows Explorer, right-click on the GCD directory you have created (C:\GCD) and select SVN Checkout, enter the URL above, choose HEAD revision, select OK.
  3. Download the latest GCD database from http://dev.comics.org/data, unzip it and store it in your GCD directory and note the name. Typically it’s YYYY-MM-DD.sql
  4. In your GCD directory you should see a media\img\gcd directory. Within this directory create two sub-directories:
    1. a new_covers subdirectory (Eg: C:\GCD\media\img\gcd\new_covers)
    2. a covers_by_id sub-directory (Eg: C:\GCD\media\img\gcd\covers_by_id)
  5. Settings for the GCD django application are stored in the settings.py file, which you should not modify. To change parameters for your local development environment create a local file in the GCD directory called settings_local.py (Eg: C:\GCD\settings_local.py) and add the following lines, replacing the examples with the appropriate values:
# This is the name of the MySQL database you will create in the next step
DATABASE_NAME = 'gcd_dev'

# This is the name of the user the GCD application will use to connect to the MySQL database
DATABASE_USER = 'gcd_dev'

# The following settings are used to set up the connection to the e-mail server
# they are necessary to be able to send e-mails which is part of the new user approval process
EMAIL_NEW_ACCOUNTS_FROM = 'user@example.com'
EMAIL_EDITORS = 'user@example.com'
EMAIL_CONTACT = 'user@example.com'
EMAIL_HOST = 'smtp.example.com'

# Set these parameters as necessary for your e-mail server 
#(this isn't necessary if your e-mail server doesn't require authentication)
EMAIL_HOST_USER = 'user@example.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_USE_TLS = False

Database Setup

The following steps are required to setup the GCD database:

  1. To create the gcd_dev user:
    1. Open a command shell in your GCD directory
    2. Run: mysql –u root –pXXXXX where XXXXX is the root password you created during the MySQL installation. Note that there is no space between –p and XXXXX.
    3. With the mysql shell enter the following commands:
CREATE USER gcd_dev;
GRANT ALL ON *.* TO 'gcd_dev';
quit;
  1. To create the gcd_dev database:
    1. Open a command shell in your GCD directory
    2. Run: mysql –u root –pXXXXX where XXXXX is the root password you created during the MySQL installation. Note that there is no space between –p and XXXXX.
    3. With the mysql shell enter the following commands. Where YYYY-MM-DD.sql is the name of the GCD Database you previously downloaded:
CREATE DATABASE gcd_dev CHARACTER SET utf8;
USE gcd_dev;
source YYYY-MM-DD.sql;
  1. To create the rest of the tables needed by the GCD website:
    1. Open a command shell in your GCD directory
    2. Run: python manage.py syncdb
    3. When you are asked about creating an admin user, you can answer "yes" and enter the required info. You can also create the user later if you want.
  • Will add in the other steps from Alexandros’ instructions


Starting the GCD Application

Congratulations! You are now ready to run the GCD application.

  1. To run the GCD application:
    1. Open a command shell in your GCD directory
    2. Run: python manage.py runserver

You can connect to the GCD application from any browser by connecting to http://127.0.0.1:8000

Troubleshooting and Other tips

  • TBD