Michael Hall has proposed merging 
lp:~mhall119/loco-directory/setup-improvements into lp:loco-directory.

Requested reviews:
  loco-directory-dev (loco-directory-dev)

For more details, see:
https://code.launchpad.net/~mhall119/loco-directory/setup-improvements/+merge/68320

Overview
========
Make setting up a loco-directory environment easier

Details
=======
Adds a Makefile with commands to init, test and run loco-directory.  Will 
create a virtualenv environment and install the proper verions of django, 
south, etc. Includes changes to some of the management commands to work from 
within the virtualenv.
-- 
https://code.launchpad.net/~mhall119/loco-directory/setup-improvements/+merge/68320
Your team loco-directory-dev is requested to review the proposed merge of 
lp:~mhall119/loco-directory/setup-improvements into lp:loco-directory.
=== modified file 'INSTALL'
--- INSTALL	2010-12-18 12:40:52 +0000
+++ INSTALL	2011-07-19 04:03:34 +0000
@@ -7,20 +7,26 @@
 #   ALTER USER postgres WITH ENCRYPTED PASSWORD 'password';
  - sudo -u postgres createdb -O postgres loco_directory
 
-Generally:
- - sudo apt-get install python-django python-launchpadlib libjs-jquery-ui python-django-openid-auth python-django-south iso-codes gettext python-tz python-vobject
- - cd loco_directory
- - cp local_settings.py.sample local_settings.py
-# edit local_settings.py and set DATABASE_USER, DATABASE_PASSWORD, SECRET_KEY
- - to make maps work, head to http://code.google.com/apis/maps/ and set GOOGLE_API_KEY in local_settings.py
-
- ** Karmic users must also do the following:
- - sudo ln -s /usr/share/javascript/jquery-ui/jquery-ui-1.7.1.custom.min.js /usr/share/javascript/jquery-ui/jquery-ui.js
- - sudo ln -s /usr/share/javascript/jquery-ui/css/css/smoothness /usr/share/javascript/jquery-ui/css/smoothness
- - sudo ln -s /usr/share/javascript/jquery-ui/css/smoothness/jquery-ui-1.7.1.custom.css /usr/share/javascript/jquery-ui/css/smoothness/jquery-ui.css
-
- - ./manage.py syncdb
- - ./manage.py migrate
- - ./manage.py init-ld
- - ./manage.py update
- - ./manage.py runserver
+
+For Development:
+
+Install necessary javascript and iso packages
+    sudo make depends
+
+Setup virtualenv, common apps and initialize database
+    make init
+
+Run LoCo Directory unit tests, you should make sure all tests pass
+    make test
+
+You may optionally populate your database with team data from launchpad or all
+data from the production site.
+
+Populate database with minimal amount of data from Lauchpad
+    make lp
+
+Populate database with live data from http://loco.ubuntu.com
+    make live
+
+Run LoCo Directory through the Django server to view your local instance
+    make run

=== added file 'Makefile'
--- Makefile	1970-01-01 00:00:00 +0000
+++ Makefile	2011-07-19 04:03:34 +0000
@@ -0,0 +1,52 @@
+pip=env/bin/pip
+py=env/bin/python
+bzr=/usr/bin/bzr
+django_manage=cd ./loco_directory/ && ../$(py) manage.py
+branch=$(bzr) branch
+projectroot=$(shell pwd |sed -e 's/\//\\\//g')
+
+init: env db
+	$(django_manage) init-ld
+
+env:
+	virtualenv --clear --no-site-packages --python=/usr/bin/python2.6 env
+	$(pip) install -r requirements.txt
+	cp loco_directory/local_settings.py.sample loco_directory/local_settings.py
+
+loco_directory/bzr_apps: env
+	$(branch) lp:ubuntu-django-foundations/bzr-apps loco_directory/bzr_apps
+	$(django_manage) pullapps
+
+apps: env loco_directory/bzr_apps
+
+loco_directory/loco_directory.db: env apps
+	$(django_manage) syncdb
+	$(django_manage) migrate
+
+db: loco_directory/loco_directory.db
+
+lp: env apps db
+	$(django_manage) update
+
+live: env apps db
+	$(django_manage) import-live-data
+
+run: env apps db
+	$(django_manage) runserver
+
+test: env apps
+	$(django_manage) test teams events venues meetings userprofiles
+
+clean:
+	rm -rf env/
+	rm -rf lp_data/
+	rm -rf data/
+	rm -rf loco_directory/bzr_apps/
+	rm loco_directory/loco_directory.db
+
+depends:
+	apt-get install libjs-jquery libjs-jquery-ui iso-codes gettext
+
+
+.DEFAULT: env apps
+.PHONY: run clean check live

=== modified file 'loco_directory/common/utils.py'
--- loco_directory/common/utils.py	2010-10-21 16:27:24 +0000
+++ loco_directory/common/utils.py	2011-07-19 04:03:34 +0000
@@ -24,7 +24,7 @@
        datetime.datetime.utcfromtimestamp(os.path.getmtime(stamp_file)) + interval < datetime.datetime.now():
         pwd = os.getcwd()
         os.chdir(settings.PROJECT_PATH)
-        p = subprocess.Popen(["./manage.py", which], stdout=subprocess.PIPE, 
+        p = subprocess.Popen(["python", "manage.py", which], stdout=subprocess.PIPE, 
                              stderr=subprocess.STDOUT, close_fds=True)
         log = p.stdout.read()
         p.communicate()

=== modified file 'loco_directory/teams/management/commands/init-ld.py'
--- loco_directory/teams/management/commands/init-ld.py	2011-06-28 14:00:44 +0000
+++ loco_directory/teams/management/commands/init-ld.py	2011-07-19 04:03:34 +0000
@@ -14,7 +14,7 @@
 
     def handle_noargs(self, **options):
         print " * Compiling messages."
-        subprocess.call(["./manage.py", "compilemessages"])
+        subprocess.call(["python", "manage.py", "compilemessages"])
 
         print " * Checking if LoCo Council is in Auth teams:", 
         (lc, new_object) = Group.objects.get_or_create(name="ubuntu-lococouncil")
@@ -53,4 +53,3 @@
                              "bzr_apps"])
             print "added."
 
-        subprocess.call(["./manage.py", "pullapps"])

=== modified file 'requirements.txt'
--- requirements.txt	2011-07-15 23:31:09 +0000
+++ requirements.txt	2011-07-19 04:03:34 +0000
@@ -8,9 +8,11 @@
 
 Django==1.1.2
 South==0.7.3
+bzr==2.4b4
 distribute==0.6.10
-django-openid-auth==0.2
-psycopg2==2.0.13
+# django-openid-auth==0.2 - Moving to the latest django-openid-auth
+bzr+ssh://bazaar.launchpad.net/~django-openid-auth/django-openid-auth/trunk
+# psycopg2==2.0.13 - only needed for production like environments
 python-openid==2.2.4
 pytz==2010b
 python-dateutil==1.5
@@ -21,3 +23,4 @@
 -f http://launchpad.net/launchpadlib/trunk/1.6.0/+download/launchpadlib-1.6.0.tar.gz#egg=launchpadlib-1.6.0
 launchpadlib==1.6.0
 
+

_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to