This Django project is the PyCon Singapore 2013 website.
Before proceeding with the setup guide, make sure you have the following packages installed.
If you use MacPorts, you can execute following command to install all the packages above.
sudo port install postgresql92 postgresql92-server virtualenv virtualenvwrapper
Please refer to the troubleshooting section if you are new to any of the above packages.
Clone this project.
mkdir -p ~/Projects/pyconsg/
cd ~/Projects/pyconsg/
git clone git://github.com/pythonsingapore/pyconsg.git pyconsg
Create a virtualenv and install project dependencies.
mkvirtualenv -p python2.7 pyconsg
cd ~/Projects/pyconsg/pyconsg/
pip install -r requirements.txt
Create your local_settings.py
and make your changes.
cd ~/Project/pyconsg/pyconsg/pyconsg/settings/local
cp local_settings.py.sample local_settings.py
vim local_settings.py
Most values should have good defaults and you should basically just change your name and email for the ADMINS setting.
Create the default user for database access.
createuser pyconsg -U postgres -dslrP
When prompted for password use pyconsg
.
Initialize your local database with sample data.
cd ~/Projects/pyconsg/pyconsg/
fab rebuild
workon pyconsg
cd ~/Projects/pyconsg/pyconsg/
./manage.py runserver
Edit your ~/.bash_profile
to include the following line.
export PGHOST=localhost
Assuming you have just installed PostgreSQL using MacPorts, you need to configure a default database.
sudo mkdir -p /opt/local/var/db/postgresql92/defaultdb
sudo chown postgres:postgres /opt/local/var/db/postgresql92/defaultdb
sudo su postgres -c '/opt/local/lib/postgresql92/bin/initdb -D /opt/local/var/db/postgresql92/defaultdb'
To start the PostgreSQL server.
sudo su postgres -c '/opt/local/lib/postgresql92/bin/pg_ctl start -D /opt/local/var/db/postgresql92/defaultdb'
As this is a very long command, you may wish to configure your PostgreSQL service to start automatically with your system.
sudo su postgres -c '/opt/local/lib/postgresql92/bin/pg_ctl start -D /opt/local/var/db/postgresql92/defaultdb'
Assuming you have just installed virtualenv and virtualenvwrapper using MacPorts, you need to edit your ~/.bash_profile
to include the following line.
source /opt/local/bin/virtualenvwrapper.sh-2.7