This README describes how to set up your computer for Makahiki Development.
python
at the command prompt. The interpreter should launch. Close the interpreter by typing exit()
.brew install pil
. If you are brave enough to install from source, make sure you have both libjpeg and zlib for jpeg and png support respectively.pip help
. If not, install it by typing easy_install pip
. If you do not have easy_install, download and follow the instructions here.mkvirtualenv makahiki
). You may also want to define $WORKON_HOME to your shell startup file in addition to adding the virtualenv startup script (it uses ~/.virtualenv
by default).git clone git://github.com/keokilee/makahiki.git
to get the source.git clone git@github.com:keokilee/makahiki.git
to check out the code. This will create the new folder and download the code from the repository.The following steps are to download additional libraries and upgrade some of the default ones.
workon <environment-name>
.pip install -r requirements.txt
from the application root. This will load the dependencies in requirements.txt.workon <environment-name>
.python manage.py syncdb
to create the database.python manage.py migrate
to sync the migrations.python manage.py createsuperuser
to create a user../scripts/load_data.sh
. If you are on Windows, you can use scripts\load_data.bat
.python manage.py runserver
to start the web server.The Javascript required to log in to Facebook is included in this application. However, you will need to apply for your own application on Facebook at their Developer Site. Once this is done, it is recommended that you add this to the local_settings.py file. These settings can be added to settings.py, but be aware that a) this file is in public version control, and you don't want others knowing your secret keys and b) subsequent updates may reset the settings.py file.
FACEBOOK_APP_ID = '<APP_ID>'
FACEBOOK_API_KEY = '<API_KEY>'
FACEBOOK_SECRET_KEY = '<SECRET_KEY>'
These can be found in your application's page within the Facebook Developer page.
If you visit http://localhost:8000 and a NoneType exception appears, it is isn't your fault! Django/Pinax has an issue with dumping and loading fixtures that depend on foreign keys. In this case, it is the foreign key that connects the django_generic_flatblocks_genericflatblock table to the django_content_type table. There are several ways of fixing this.
The most straightforward way to fix this is to use SQLite Database Browser to update the tables. Open the database file (by default, it is "dev.db") and browse the data of the "django_generic_flatblocks_genericflatblock" table. Note the values of the website header field (which is of type "title"), the website footer field (type "text"), the website image field (type "image"), and the homepage_content_1 field (type "titleandtext"). Next, browse the contents of the "django_content_type" table. Find the app_label "gblocks" and the names "title", "text", "image", and "titleandtext". What you need to do is execute SQL to update the entries in the "django_generic_flatblocks_genericflatblock" table. An example statement is:
UPDATE django_generic_flatblocks_genericflatblock SET content_type_id=<value in django_content_type> WHERE content_type_id=<value in django_generic_flatblocks_genericflatblock>;
While Django/Pinax has support for running tests, some of the out of the box tests fail (as of Pinax 0.7.1). You can run the tests using python manage.py test
. I created my own script to only run my own tests in the system. You can run those tests by typing python runtests.py
. These are the same tests that are run by our continuous integration server.
Here are some online Python books that may be helpful when learning the language.
The following tutorials may be helpful when learning about Django and the various packages used by the system.
For information on editing views, consult the Editing Views wiki.