From 8a56393cceaa304c566034b88adbc3bf02a0bc00 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Tue, 9 May 2017 12:31:34 +0100 Subject: [PATCH 1/4] Explain database creation in README --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 2f9aa36..e92eb56 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,11 @@ To install the Python library requirements, run: pip install -r requirements.txt +To initialise the database (SQLite is used by default), run: + + run python manage.py syncdb + + ## Running Though the client and server can be run independently (and they are in fact run as such our ovii server), you can run them both on your local machine simply with: From f672aecd0cb4f46e1001e65f81d674e97a0e4321 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Tue, 9 May 2017 12:32:13 +0100 Subject: [PATCH 2/4] Make settings.py generate paths relative to its own location --- complexityplot/complexityplot/settings.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/complexityplot/complexityplot/settings.py b/complexityplot/complexityplot/settings.py index 62a7e33..1804479 100644 --- a/complexityplot/complexityplot/settings.py +++ b/complexityplot/complexityplot/settings.py @@ -5,6 +5,8 @@ DEBUG = True TEMPLATE_DEBUG = DEBUG +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + ADMINS = ( ('Simon Walton', 'simon.walton@oerc.ox.ac.uk'), ) @@ -63,9 +65,9 @@ # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/var/www/example.com/static/" -STATIC_ROOT = "/Users/sim/Documents/ComplexityPlot/Web/complexityplot/" +STATIC_ROOT = BASE_DIR -BASE_DIR = "/Users/sim/Documents/ComplexityPlot/Web/complexityplot/" +BASE_DIR = BASE_DIR # URL prefix for static files. # Example: "http://example.com/static/", "http://static.example.com/" @@ -123,7 +125,7 @@ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - "/Users/sim/Documents/ComplexityPlot/Web/complexityplot/templates/" + os.path.normpath(os.path.join(BASE_DIR, 'templates')) ) INSTALLED_APPS = ( From 7e6844311b4e854214514fec3708613009df7336 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Tue, 9 May 2017 12:33:33 +0100 Subject: [PATCH 3/4] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e92eb56..396cf61 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ To install the Python library requirements, run: To initialise the database (SQLite is used by default), run: - run python manage.py syncdb + python manage.py syncdb ## Running From 0448ec87f11630fe5bbdee23304cc7174d6b09f4 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Thu, 11 May 2017 10:03:36 +0100 Subject: [PATCH 4/4] Modify requirements.txt - remove reqirement for specific version of distribute, which can cause instalaltion problems - move dependency on psycopg2 to separate requirements file, so postgres does not need to be installed --- README.md | 4 ++++ requirements-postgres.txt | 2 ++ requirements.txt | 2 -- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 requirements-postgres.txt diff --git a/README.md b/README.md index 396cf61..d0ec75d 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ To install the Python library requirements, run: pip install -r requirements.txt +or, if you want to use Postgres as the dabase backend: + + pip install -r requirements-postgres.txt + To initialise the database (SQLite is used by default), run: python manage.py syncdb diff --git a/requirements-postgres.txt b/requirements-postgres.txt new file mode 100644 index 0000000..f02749b --- /dev/null +++ b/requirements-postgres.txt @@ -0,0 +1,2 @@ +-r requirements.txt +psycopg2==2.4.6 diff --git a/requirements.txt b/requirements.txt index c417e4b..dff2ae5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,10 @@ Django==1.5.1 South==0.7.6 -distribute==0.6.35 dj-database-url==0.2.1 gunicorn==0.17.2 heroku==0.1.2 ipython==0.13.1 numpy==1.7.0 -psycopg2==2.4.6 python-dateutil==1.5 requests==1.2.0 virtualenv==1.9.1