Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
Merge branch 'django_18_migration'
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrd committed Oct 22, 2015
2 parents 5624837 + 004384c commit efe7f2f
Show file tree
Hide file tree
Showing 49 changed files with 488 additions and 3,382 deletions.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean cleandist test vars build_production
.PHONY: clean cleandist test vars build_production remove_sensitive_data

# obtain the absolute path to metacademy-application
MAKEFILE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
Expand Down Expand Up @@ -81,6 +81,13 @@ update:
git pull
cd server/static/lib/kmap; git pull

remove_sensitive_data:
python server/manage.py remove_provisional_concepts
python server/manage.py remove_user_accounts
python server/manage.py remove_provisional_roadmaps
python server/manage.py clearsessions
./dev_utils/remove_sensitive_aux_data_from_db.sh

# print the vars used in the makefile
vars:
$(info BASE_DIR has the value $(BASE_DIR))
Expand All @@ -90,3 +97,4 @@ vars:
$(info LOCAL_DBS has the value $(LOCAL_DBS))
$(info LOCAL_DBS_DIR has the value $(LOCAL_DBS_DIR))
$(info DJANGO_DB_FILE has the value $(DJANGO_DB_FILE))

11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For Windows installation/requirements, please see the README located in [/window


### Preliminary requirements
* `Python 2.7.X` *Nota bene*: install `python-devel`/`python-dev` if you're using a package manager such as `yum` or `apt-get`. The following command should then print a path. If this command raises an exception, make sure that you have `python-devel`/`-dev` for your installed version of python installed:
* `Python 2.7.X` *Note*: install `python-devel`/`python-dev` if you're using a package manager such as `yum` or `apt-get`. The following command should then print a path. If this command raises an exception, make sure that you have `python-devel`/`-dev` for your installed version of python installed:

python -c 'from distutils.sysconfig import get_makefile_filename as m; print m()'

Expand Down Expand Up @@ -68,6 +68,11 @@ For Windows installation/requirements, please see the README located in [/window

The following tasks are not neccessarily needed to run Metacademy.

### Load `metacademy.org` data
Load the public data from metacademy.org

python server/manage.py loaddata dev_utils/graph_data.json

### Create a Django superuser

A Django superuser will allow you to login at `/admin` to perform additional management tasks.
Expand All @@ -78,7 +83,7 @@ Given you are still in the `metacademy-application` directory, activate the virt

Then create the Django superuser.

python app_server/manage.py createsuperuser
python server/manage.py createsuperuser

You can leave the virtual environment again simply by invoking

Expand Down Expand Up @@ -123,7 +128,7 @@ or still from within the `metacademy-application` directory on a 64 bit RHEL-bas

2. Start the development server

python app_server/manage.py runserver 8080
python server/manage.py runserver 8080

3. Open [localhost:8080](http://localhost:8080) in a modern JavaScript-enabled browser

Expand Down
8 changes: 5 additions & 3 deletions Tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@

# set the env
source ../meta_venv/bin/activate
python server/manage.py runserver 8080 --noreload & # `&` sends the process to the background

# run the django tests
echo "Django Tests"
#python server/manage.py test
python server/manage.py test


python server/manage.py runserver 8080 --noreload & # `&` sends the process to the background

# run the browser tests
echo "Browser Tests"
./node_modules/mocha-phantomjs/bin/mocha-phantomjs http://127.0.0.1:8080/browser-tests

# run the selenium tests
python selenium_tests/simple_selenium_tests.py
# python selenium_tests/simple_selenium_tests.py

kill %1 # kills the first, in this case our app_server background process
1 change: 1 addition & 0 deletions dev_utils/graph_data.json

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions dev_utils/remove_sensitive_aux_data_from_db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

sqlite3 ../local_dbs/django_db/db.sqlite "DELETE FROM auth_permission; DELETE FROM SQLITE_SEQUENCE WHERE name='auth_permission';"
sqlite3 ../local_dbs/django_db/db.sqlite "DELETE FROM django_session; DELETE FROM SQLITE_SEQUENCE WHERE name='django_session';"
sqlite3 ../local_dbs/django_db/db.sqlite "DELETE FROM reversion_revision; DELETE FROM SQLITE_SEQUENCE WHERE name='reversion_revision';"
sqlite3 ../local_dbs/django_db/db.sqlite "DELETE FROM reversion_version; DELETE FROM SQLITE_SEQUENCE WHERE name='reversion_version';"
sqlite3 ../local_dbs/django_db/db.sqlite "DELETE FROM user_management_concepts; DELETE FROM SQLITE_SEQUENCE WHERE name='user_management_concepts';"


55 changes: 27 additions & 28 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
Django==1.6
Django==1.8
Flask==0.10.1
Flask-Cache==0.12
Jinja2==2.7.1
Markdown==2.3.1
MarkupSafe==0.18
Pillow==2.3.0
South==0.8.4
Werkzeug==0.9.4
Whoosh==2.5.4
Flask-Cache==0.13.1
Jinja2==2.7.3
Markdown==2.6.2
MarkupSafe==0.23
Pillow==2.8.1
Werkzeug==0.10.4
Whoosh==2.7.0
beautifulsoup4==4.3.2
bleach==1.2.2
bleach==1.4.1
coverage==3.7.1
django-appconf==0.6
django-compressor==1.3
django-devserver==0.7.0
-e git+https://github.com/toastdriven/django-haystack.git@a3a2fc3a385ea35e76941482bf18460724b6421c#egg=django_haystack-master
django-appconf==1.0.1
django-compressor==1.5
django-devserver==0.8.0
django-haystack==2.3.1
django-lazysignup==0.12.2
django-reversion==1.8.0
django-simple-captcha==0.4.0
django-tastypie==0.11.0
html5lib==0.95
django-reversion==1.8.6
django-simple-captcha==0.4.5
-e git+https://github.com/django-tastypie/django-tastypie@256ebe1de9a78dfb5d4d6e938b813cf4c5c4ac1b#egg=django_tastypie-master
html5lib==0.999
ipdb==0.8
ipython==1.2.1
itsdangerous==0.23
nose==1.3.0
numpy==1.9
pandas==0.13.1
python-dateutil==2.2
ipython==3.1.0
itsdangerous==0.24
nose==1.3.6
numpy==1.9.2
pandas==0.16.0
python-dateutil==2.4.2
python-mimeparse==0.1.4
pytz==2014.2
requests==2.2.1
selenium==2.39.0
six==1.4.1
pytz==2015.2
requests==2.6.0
selenium==2.45.0
six==1.9.0
wsgiref==0.1.2
Loading

0 comments on commit efe7f2f

Please sign in to comment.