diff --git a/Makefile b/Makefile index fb7c990..4d09b42 100644 --- a/Makefile +++ b/Makefile @@ -9,14 +9,14 @@ all: django django: - ./web/common/bin/install_dependencies echo "Installing the dependinces necessary to run this repository" - ./web/manage.py setup_virtualenv - echo "Setting up the virtual environment" - ./web/common/bin/setup_mysql.py + cd web && ./common/bin/install_dependencies.py echo "Installing proper configuration for mysql" - ./web/manage.py syncdb + cd web && ./manage.py setup_virtualenv + echo "Setting up the virtual environment" + cd web && ./common/bin/setup_mysql.py echo "Creating the necessary tables into the database" - ./web/manage.py dbshell < data.sql + cd web && ./manage.py syncdb echo "Inserting the data into the database" + cd web && ./manage.py dbshell < web/chicagoEnergy.sql echo "Now run './web/manage.py runserver' and open up a browser to the local host!" diff --git a/web/common/bin/fabfile.py b/web/common/bin/fabfile.py index b6e280b..717f189 100644 --- a/web/common/bin/fabfile.py +++ b/web/common/bin/fabfile.py @@ -175,24 +175,24 @@ def setup_virtualenv(virtualenv_name, run_func=local): virtualenv_requirement, )) - hg_root = fabhelp.get_hg_root() + # hg_root = fabhelp.get_hg_root() if run_func == local: project_dir = run_func("pwd", capture=True) else: project_dir = run_func("pwd") project_name = os.path.basename(project_dir) - # add virtualenv to hgignore - if run_func == local: - fabhelp.progress("add virtualenv to .hgignore") - ignore_patterns = ( - os.path.relpath(os.path.join(project_dir,virtualenv_name),hg_root), - ) - fabhelp.add_to_hgignore( - ignore_patterns, - syntax="glob", - comment="ignore virtualenv for project '%s'"%project_name, - ) + # # add virtualenv to hgignore + # if run_func == local: + # fabhelp.progress("add virtualenv to .hgignore") + # ignore_patterns = ( + # os.path.relpath(os.path.join(project_dir,virtualenv_name),hg_root), + # ) + # fabhelp.add_to_hgignore( + # ignore_patterns, + # syntax="glob", + # comment="ignore virtualenv for project '%s'"%project_name, + # ) def render_apache_configuration(production_root_url, local_master_django_project_dir=''): diff --git a/web/common/bin/fabhelp.py b/web/common/bin/fabhelp.py index 614590f..1546a81 100644 --- a/web/common/bin/fabhelp.py +++ b/web/common/bin/fabhelp.py @@ -28,19 +28,19 @@ def get_cur_bin_src_directories(): os.path.join(os.path.dirname(bin_dir), "src"), ) -def get_hg_root(ldir=None): - """find the mercurial root""" - ldir = ldir or '' - with lcd(ldir): - with settings(hide("warnings", "running", "stdout", "stderr"), - warn_only=True): - hg_root = local("hg root", capture=True) - if hg_root.failed: - msg = "directory '%s' is not in a mercurial project" % ldir - msg += '\n"hg root" output:' + hg_root - msg += '\n"hg root" stderr:' + hg_root.stderr - raise ValueError(msg) - return hg_root +# def get_hg_root(ldir=None): +# """find the mercurial root""" +# ldir = ldir or '' +# with lcd(ldir): +# with settings(hide("warnings", "running", "stdout", "stderr"), +# warn_only=True): +# hg_root = local("hg root", capture=True) +# if hg_root.failed: +# msg = "directory '%s' is not in a mercurial project" % ldir +# msg += '\n"hg root" output:' + hg_root +# msg += '\n"hg root" stderr:' + hg_root.stderr +# raise ValueError(msg) +# return hg_root def is_django_project(d, in_root_dir=False): """make sure that directory d is actually a django project and diff --git a/web/common/bin/install_dependencies.py b/web/common/bin/install_dependencies.py index 1e46b30..3b0c700 100755 --- a/web/common/bin/install_dependencies.py +++ b/web/common/bin/install_dependencies.py @@ -160,6 +160,9 @@ def install_gem(self): class ConvenienceInstaller(Installer): """an installer for many common python packages""" + def install_geo_dependencies(self): + self.apt_install_packages("binutils", "libproj-dev", "gdal-bin", "libspatialindex-dev") + def install_python_software_properties(self): """this is needed to add the latest version of mercurial""" self.apt_install_packages("python-software-properties") diff --git a/web/common/conf/noether/settings.py b/web/common/conf/noether/settings.py index 8f51e5d..1e30827 100644 --- a/web/common/conf/noether/settings.py +++ b/web/common/conf/noether/settings.py @@ -14,7 +14,7 @@ } # debug information -DEBUG = False +DEBUG = True TEMPLATE_DEBUG = DEBUG SITE_ID = 3 diff --git a/web/common/conf/settings.py b/web/common/conf/settings.py index 7701490..4a3c886 100644 --- a/web/common/conf/settings.py +++ b/web/common/conf/settings.py @@ -292,17 +292,18 @@ def _mysql_db_name(PROJECT_ROOT): somehgrepo__path__to__djangoproject """ - - # use fabric/mercurial to find the mercurial root from the - # PROJECT_ROOT directory - from common.bin import fabhelp - hg_root = fabhelp.get_hg_root(PROJECT_ROOT) - rel_path = os.path.relpath(PROJECT_ROOT, os.path.dirname(hg_root)) - - # name the database based on this path to the PROJECT_ROOT - db_name = rel_path.lower().replace(' ','_').replace(os.sep, '__')\ - .replace('-','_') - return db_name + return 'chicagoenergy' + + # # use fabric/mercurial to find the mercurial root from the + # # PROJECT_ROOT directory + # from common.bin import fabhelp + # hg_root = fabhelp.get_hg_root(PROJECT_ROOT) + # rel_path = os.path.relpath(PROJECT_ROOT, os.path.dirname(hg_root)) + + # # name the database based on this path to the PROJECT_ROOT + # db_name = rel_path.lower().replace(' ','_').replace(os.sep, '__')\ + # .replace('-','_') + # return db_name def _suburl_settings(server_name, PROJECT_ROOT, MEDIA_URL, SESSION_COOKIE_PATH, LOGIN_REDIRECT_URL, LOGIN_URL, diff --git a/web/conf/noether/apache/noether.conf b/web/conf/noether/apache/noether.conf index d8b344b..3b14597 100644 --- a/web/conf/noether/apache/noether.conf +++ b/web/conf/noether/apache/noether.conf @@ -1,4 +1,4 @@ - + ServerName chicagoenergy.datascopeanalytics.com ServerAlias www.chicagoenergy.datascopeanalytics.com ServerAdmin webmaster@datascopeanalytics.com diff --git a/web/conf/virtualenv_requirements.txt b/web/conf/virtualenv_requirements.txt index 4ca7bdf..a590dc5 100644 --- a/web/conf/virtualenv_requirements.txt +++ b/web/conf/virtualenv_requirements.txt @@ -2,5 +2,5 @@ # https://github.com/omab/django-social-auth/pull/673 #-e git://github.com/omab/django-social-auth.git@requests#egg=django-social-auth -e git://github.com/deanmalmgren/django-social-auth.git@requests#egg=django-social-auth -shapely +shapely<1.3 Rtree==0.7.0