X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=README;h=4e0b471689817dfc371bd2f301307e0cfa5a7208;hb=refs%2Fheads%2Ffibre;hp=d05ded49c3ba8e1dcc5dfcb4ae62249668edff5a;hpb=fd55728601b62284b99e27f7d06723206649b5a7;p=myslice.git diff --git a/README b/README index d05ded49..4e0b4716 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ This file documents the contents of this module - +change Last update 4 sept. 2013 See the devel/ subdir for more devel-oriented doc. @@ -9,14 +9,21 @@ See the devel/ subdir for more devel-oriented doc. * REQUIREMENTS is to have python + django (1.5.2) installed django ** should be straightforward ** see devel/django-install.txt in case of trouble - +$ apt-get install python-django +$ apt-get install python-django-south +$ apt-get install python-pip +$ pip install requests +$ pip install djangorestframework * git clone git://git.onelab.eu/myslice.git -- or -- * git clone ssh://yourlogin@git.onelab.eu/git/myslice.git -* edit myslice/config.py and enter the details of your manifold backend +* edit/create myslice/myslice.ini and enter the details of your manifold backend +$ apt-get install python-django-south * init django +** when django prompts for creating an admin account, create it and +** keep the username and password safe $ ./manage.py syncdb $ ./manage.py migrate @@ -32,8 +39,18 @@ $ make static (which is a shorthand for cleaning up and run manage collectstatic that creates templates/ $ make templates [$ make redo (each time when you pull, do that and restart the server)] + +## Whenever doing a git pull the following operations are recommended: + +$ make static # will refresh static/ from all the pieces in the project +$ make templates # same, for templates +$ make redo-static # clears up (rm -rf) static/ first, then make static +$ make redo-templates # ditto for templates +$ make redo == make redo-static redo-templates + + * run a local server: -$ manage.py runserver 0.0.0.0:8000 +$ ./manage.py runserver 0.0.0.0:8000 -- or -- my advice: $ devel/server-loop.sh when you just need to hit ^C yourself when your static files need to be refreshed - see below @@ -45,6 +62,14 @@ when you just need to hit ^C yourself when your static files need to be refreshe $ pip install -r path/to/requirements/file.txt Note. not quite sure what this is about, I could not spot this file.. +=====APACHE Config===== +if are running apache please do: + +$ chown www-data:www-data /var/myslice-f4f + +otherwise you may get the following error: +"DatabaseError: unable to open database file" + ==================== Status *** Authentication *** @@ -213,23 +238,21 @@ $python manage.py loaddata temp_data.json If your changes break your old schema this won't work - in which case tools like south or django evolution are great. -======== update django database to reflect changes in existing models with migration system (e.g., south) ========= - -As south is already installed , you just have to do: - -$./manage.py migrate - -if it fails: -1. go to myslice directory -2. do sqlite3 myslice.sqlite3 [if sqlite3: command not found, do $apt-get install sqlite3] -3. check the list of tables with sqlite> .tables -4. if you find those tables that was mentioned in the failure message while running $./manage.py migrate - do sqlite> DROP TABLE mentioned_table - [mentioned_table = the tables that was explicity mentioned in the failure message of $./manage.py migrate] -5. sqlite> .quit -6. $./manage.py migrate +Add a new model to the DB +$python manage.py schemamigration --auto +$python manage.py migrate +======== update django database to reflect changes in existing models with migration system (e.g., south) ========= +As south is already installed , you just have to do: +# ./manage.py schemamigration portal --initial +# sqlite3 /var/unfold/unfold.sqlite3 + sqlite> DROP TABLE "portal_institution"; + sqlite> DROP TABLE "portal_pendinguser"; + sqlite> DROP TABLE "portal_pendingauthority"; + sqlite> DROP TABLE "portal_pendingslice"; + sqlite> .quit +# ./manage.py migrate portal