Project

General

Profile

1
Building The BIEN3 Database
2

    
3
	This document assumes that you already have a Postgres database for BIEN based on a geospatial template (PostGIS).  Don't forget to modify the settings.py file accordingly so that Django can connect.  See Aaron Elmore's document “Setting up Geodjango PostGIS Stack” for instructions. 
4

    
5
1)Running the php script to write the Django models.  This creates the models.py file to be used as the primary objects used by Django.
6
get the “makeVegxModel” project from Subversion
7
cd <your_dir>/makeVegxModel/trunk
8
$php makeModel.php > models.py
9
2)Check out the “bien” project from Subversion.
10
3)Copy models.py into <your_dir>/bien/v.  This step may not be necessary as models.py is already part of the bien subversion repository.
11
4)Edit settings.py to comment out line 103:
12
'bien.v',  ---> #    “bien.v”,
13
	This is necessary because of a bug in Django that limits the size of table names in the auth_permission table.
14
5)Run:  python manage.py syncdb.  Take care of any desired/requried setup.
15
6)Log in to the BIEN database and execute the following:
16
alter table auth_permission alter column name type character varying(255);
17
7)Uncomment the line you commented out in step 4) and rerun python manage.py syncdb
18

    
19
	After this, the database should be ready to go.
(1-1/21)