Changes between Version 2 and Version 3 of django_gheat
- Timestamp:
- Apr 13, 2011, 8:21:52 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
django_gheat
v2 v3 45 45 Once you've entered the correct settings, you will be able to start Django. 46 46 {{{ 47 $ cd django_gheat/samples/persisted 47 # 'cd' to project root 48 # The following command will add some standard Django tables and the tables defined in django_gheat/gheat/models.py to the database 49 $ ./manage.py syncdb 48 50 49 # The following command will add some standard Django tables and the tables defined in django_gheat/gheat/models.py to the database 50 $ python manage.py syncdb 51 52 $ python manage.py runserver 51 # if using sample page, first 'cd samples/persisted', will get fixed soon 52 $ ./manage.py runserver 53 53 }}} 54 54 Something like this should return: … … 75 75 CREATE TABLE `gheat_gebruiker` ( 76 76 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, 77 ` gebruiker` varchar(64) NOT NULL,78 ` apparatuur` varchar(64) NOT NULL77 `naam` varchar(64) NOT NULL, 78 `email` varchar(64) NOT NULL 79 79 ) 80 80 ; 81 CREATE TABLE `gheat_apparatuur` ( 82 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, 83 `antenne` varchar(64) NOT NULL, 84 `kaart` varchar(64) NOT NULL 85 ) 86 ; 87 CREATE TABLE `gheat_meetrondje` ( 88 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, 89 `datum` datetime NOT NULL, 90 `naam` varchar(60) NOT NULL, 91 `gebruiker_id` integer NOT NULL, 92 `apparatuur_id` integer NOT NULL 93 ) 94 ; 95 ALTER TABLE `gheat_meetrondje` ADD CONSTRAINT `apparatuur_id_refs_id_5e2d317` FOREIGN KEY (`apparatuur_id`) REFERENCES `gheat_apparatuur` (`id`); 96 ALTER TABLE `gheat_meetrondje` ADD CONSTRAINT `gebruiker_id_refs_id_3b558609` FOREIGN KEY (`gebruiker_id`) REFERENCES `gheat_gebruiker` (`id`); 81 97 CREATE TABLE `gheat_meting` ( 82 98 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, 99 `meetrondje_id` integer NOT NULL, 83 100 `accespoint_id` integer NOT NULL, 84 `gebruiker_id` integer NOT NULL,85 101 `lat` double precision NOT NULL, 86 102 `lng` double precision NOT NULL, 87 `signaal` integer NOT NULL, 88 `datum` datetime NOT NULL 103 `signaal` integer NOT NULL 89 104 ) 90 105 ; 91 ALTER TABLE `gheat_meting` ADD CONSTRAINT `gebruiker_id_refs_id_56605efc` FOREIGN KEY (`gebruiker_id`) REFERENCES `gheat_gebruiker` (`id`);92 106 ALTER TABLE `gheat_meting` ADD CONSTRAINT `accespoint_id_refs_id_49f1ad5c` FOREIGN KEY (`accespoint_id`) REFERENCES `gheat_accespoint` (`id`); 107 ALTER TABLE `gheat_meting` ADD CONSTRAINT `meetrondje_id_refs_id_6c4042fe` FOREIGN KEY (`meetrondje_id`) REFERENCES `gheat_meetrondje` (`id`); 93 108 COMMIT; 109 94 110 }}} 95 111 Note that on this moment only the gheat_meting(lat, lng, signaal) are used for generating heatmaps, so make sure you atleast put some data in those columns. … … 98 114 You can prerender a heatmap with the following command: 99 115 {{{ 100 $ cd django_gheat/samples/persisted 101 $ pythonmanage.py gen_tiles116 # 'cd' to project root 117 $ ./manage.py gen_tiles 102 118 }}} 103 119 This will prerender a heatmap with the default boundingbox specified in django_gheat/gheat/management/commands/gen_tiles.py … … 109 125 # -b = view used for creating tiles, default should be fine 110 126 111 $ pythonmanage.py gen_tiles -s 60,6 -e 66,8 -c firetrans -b serve_tile127 $ ./manage.py gen_tiles -s 60,6 -e 66,8 -c firetrans -b serve_tile 112 128 }}} 113 129