Web framework for GeoSolver. Currently, you have to use this to access our geometry question dataset. We will release more organized "raw" data soon.
- Make sure you have Python 2 (tested on 2.7.6) and MySQL installed.
- Clone this repository, as well as
geosolver
andequationtree
. They have to be added to the$PYTHONPATH
. - Make sure the MySQL root acess credentials agrees with
DATABASES
inGeoServer/geoserver/geoserver/settings/local.py
. - Log in to MySQL server and create a database
geodb
in MySQL:
create database geodb;
If you already have geodb
, make sure to drop it before creating it (by drop database geodb
), or come up with a new name (e.g. geodb2
) and update the database name in GeoServer/geoserver/geoserver/settings/local.py
.
- Install all required packages for the server by typing on the terminal:
pip install numpy scipy scikit-learn sympy networkx nltk inflect pyparsing matplotlib pydot2 mysql-python django django-picklefield jsonfield django-storages boto django-modeldict pillow unipath beautifulsoup4 requests
- Install OpenCV 3 (tested on 3.0.0). Make sure python wrappers are accessible via
$PYTHONPATH
. - Change directory to
GeoServer/geoserver
. - Type on the terminal:
python manage.py migrate --settings=geoserver.settings.local
This will set up all tables in the geodb
database.
- To run the server, type on the terminal (in the same directory,
GeoServer/geoserver
):
python manage.py runserver --settings=geoserver.settings.local
You should see something like Starting development server at http://127.0.0.1:8000
.
Note that if you want to make the server visible to other computers, you specify the ip address to be 0
, i.e. python manage.py runserver 0:8080 --settings=geoserver.settings.local
(8080
is port number of your choice).
- Check if everything is good by accessing
http://localhost:8000/questions/list/all
. You should see a webpage with an empty table.
Now that you have server running, you want to load data on it (otherwise you will have to upload every question yourself!).
- Download the media folder, which contains all the images: media.tar.gz
- Unzip the media folder in GeoServer/geoserver (so that you have GeoServer/geoserver/media folder).
- Download json files, which contain text data and links to the images: questions.json labels.json semantics.json
- Text data can be loaded with the json files in GeoServer/geoserver:
python manage.py loaddata questions.json --settings=geoserver.settings.local
python manage.py loaddata labels.json --settings=geoserver.settings.local
python manage.py loaddata semantics.json --settings=geoserver.settings.local
- Now you should be able to see questions when accessing
http://localhost:8000/questions/list/all
.
-
To meet the python and MySQL requirements, run:
apt-get install python mysql-server libmysqlclient-dev
-
If you are going to install numpy / scipy via pip, you want to install:
apt-get install gfortran
-
To log-in to MySQL, run:
mysql -u root -p
-
To change MySQL password:
- stop the mysql server:
sudo /etc/init.d/mysql stop
- start the mysqld configuration:
sudo mysqld --skip-grant-tables &
- log in to MySQL as root:
mysql -u root mysql
- replace YOURNEWPASSWORD with your new password:
UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
- kill the temporary server:
sudo killall -9 mysqld ?
- start the normal server:
sudo service mysql start
- stop the mysql server: