-
mysql database (you're on your own for this one)
-
pip (for installing various python things)
apt-get install python-pip python-dev build-essential
-
django (python web framework)
pip install django
-
mysql-python (this is probably the trickiest one to install)
pip install mysql-python
For an initial setup of knoatom-web, here's some of the things you need to do:
-
Clone and move into the repository
-
Copy
settings-example.py
tosettings.py
and set the various things that are required in it:- In the
DATABASES.default
dictionary, setNAME
- name of your databaseUSER
- user for your databasePASSWORD
- password for your user
MEDIA_ROOT
- file system location for uploaded filesMEDIA_URL
- url for getting toMEDIA_ROOT
STATIC_ROOT
- file system location for static files (will be collected here)STATIC_URL
- url for getting toSTATIC_ROOT
ADMIN_MEDIA_PREFIX
- typically the value ofSTATIC_URL
+admin/
SECRET_KEY
- longer the better - random.org will help you out)
- In the
-
Set up your database running the following commands (errors in these will probably be fixed by reading the errors and adjusting
settings.py
):./manage.py syncdb
- creates the database tables and initial user./manage.py loaddata web/fixtures/web_init_categories.json
- installs initial data
-
Cross your fingers, and run the server:
./manage.py runserver 8080
-
Open the url http://localhost:8080 and hopefully you'll see it (if you're running on your local machine).
To bring in the initial categories into the database, you need to provide a 'fixture' that contains the data. To bring in the initial categories from web_init_categories.json
do:
./manage.py loaddata web/fixtures/web_init_categories.json
You can read more about this in the South documentation, but it is more or less this:
./manage.py dumpdata web > web.json
web
referring to the application that is set up in django (web
is what ours is). This outputs the fixture to web.json
, rather than print it to the screen.
You can omit the web to dump all the data from the database.