Dmitri Lebedev avatar Dmitri Lebedev committed 9684e1f Draft Merge

Merge with fixture-directories

Comments (0)

Files changed (6)

-810b7c7e50fe57d9619a7ea439f4b670dc327d9f djaml
+d2f5324ef8dce9784ccb253af9e6e03ec13b3da6 djaml
 6e481bc18fea7cae253977ad6b1d9a5bf85a6d24 project/static/css/oocss
 check_pyflakes: bin/pyflakes
 	find . -name '*.py' -exec ./bin/pyflakes {} \;
 
-bin/pyflakes: bin/buildout
-	./bin/buildout install pyflakes
-
 .PHONY: check_pep8
 check_pep8: bin/pep8
 	find . -name '*.py' -exec ./bin/pep8 {} \;
 	./bin/buildout install pep8
 
 bin/django: bin/buildout buildout.cfg
-	./bin/buildout
-	touch bin/django
-	touch bin/prod
+	./bin/buildout && touch bin/django bin/prod
 
 bin/buildout:
 	python bootstrap.py --distribute
 
 syncdb: bin/django
-	./bin/django syncdb
-	touch syncdb
+	./bin/django syncdb && touch syncdb
 
 .PHONY: make_trans
 make_trans: bin/django
 #run: bin/coffee
 bin/coffee: bin/buildout
 	./bin/buildout install coffee
+
+# rebuilds the database (useful for development environment)
+.PHONY: rebuilddb
+rebuilddb: bin/django
+	bin/django reset_db --router=default --noinput
+	bin/django syncdb --noinput
 	cleanup
 	sass
 	yuic
-	unzip_yuic
+	pyflakes
 
-versions = versions
 project = project
+eggs =
+	django >= 1.4, <1.5
+#	mock 						# useful for mocking some objects in unit tests
+#	django-reversion == 1.5.1	# useful for keeping revisions of objects
+	ipython >= 0.13 			# advanced interactive Python shell
+	ipdb 						# IPython debugger
+	django_extensions == 0.9 	# shell_plus
+	django-annoying == 0.7.6 	# a set of decorators and middleware to simplify coding
+	django-debug-toolbar 		# cool debugging
+	werkzeug 					# WSGI debug post-mortem shell in the page
+#	django-tastypie == 0.9.11 	# RESTful API for models
+#	Pillow 						# replacement of PIL
+#	pudb 						# console debugging IDE
+	django_compressor == 1.2	# js/css compressor/compiler
+	BeautifulSoup 				# required by compressor
+	html5lib 					# required by compressor
+	lxml 						# required by compressor
+#	versiontools 				# required by reversion
+	hamlpy 						# HAML templates
+	djaml 						# hamlpy loader
 
 
 [sass]
 project = ${buildout:project}
 settings = dev
 wsgi = true
-eggs =
-#	mock                  # useful for mocking some objects in unit tests
-#	django-reversion      # useful for keeping revisions of objects
-	ipython               # advanced interactive Python shell
-	django_extensions     # shell_plus
-	django-annoying       # a set of decorators and middleware to simplify coding
-	django-debug-toolbar  # cool debugging
-	werkzeug              # WSGI debug post-mortem shell in the page
-#	django-tastypie       # RESTful API for models
-#	Pillow				  # replacement of PIL
-	pudb                  # console debugging IDE
-	django_compressor     # js/css compressor/compiler
-	BeautifulSoup         # required by compressor
-	html5lib              # required by compressor
-	lxml                  # required by compressor
-	django-appconf        # required by compressor
-#	versiontools          # required by reversion
-	hamlpy                # HAML templates. Before a pull request is done, culebron-hamlpy is used.
-	djaml                 # hamlpy loader
+eggs = ${buildout:eggs}
 
 
 [prod]
 project = ${buildout:project}
 settings = prod
 wsgi = true
-eggs = ${django:eggs}
-
-
-[versions]
-# change these versions when you are sure they will be compatible with your project
-django = 1.4.0
-django-annoying = 0.7.6
-django_compressor = 1.1
-django_extensions = 1.7.1
-django-reversion = 1.5.1
-django-tastypie = 0.9.9
-ipython = 0.13
+eggs = ${buildout:eggs}
 
 
 [cleanup]
 
 
 [yuic]
-# downloads the yui compressor
-version = 2.4.7
-recipe = hexagonit.recipe.download
-md5sum = 885657c68ed617737e730b4c2ce52dda
-url = http://yui.zenfs.com/releases/yuicompressor/yuicompressor-${yuic:version}.zip
-download-only = true
-
-
-[unzip_yuic]
-# unpacks yui compressor jar file
-recipe = collective.recipe.cmd
-on_install = true
-on_update = true
-zipname = ${buildout:directory}/parts/yuic/yuicompressor-${yuic:version}.zip
-jarname = yuicompressor-${yuic:version}/build/yuicompressor-${yuic:version}.jar
-cmds =
-	unzip -jo ${unzip_yuic:zipname} ${unzip_yuic:jarname} -d ${buildout:directory}/parts/yuic
-
+# YUI compressor. Minifies JS files.
+recipe = zc.recipe.egg
+eggs = yuicompressor
 DATABASES = {
 	'default': {
 		'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-		'NAME': 'development.sqlite3',					  # Or path to database file if using sqlite3.
-		'USER': '',					  # Not used with sqlite3.
+		'NAME': os.path.join(PROJECT_ROOT, '..', 'dev.sqlite3'),  # Or path to database file if using sqlite3.		'USER': '',					  # Not used with sqlite3.
 		'PASSWORD': '',				  # Not used with sqlite3.
 		'HOST': '',					  # Set to empty string for localhost. Not used with sqlite3.
 		'PORT': '',					  # Set to empty string for default. Not used with sqlite3.
 	}
 }
 
-FIXTURE_DIRS = (
-	'project/apps/main/fixtures_dev',
+folder_name = 'fixtures_%s' % __file__.replace('.py', '')
+
+FIXTURE_DIRS = tuple(
+	os.path.join(root, folder_name)
+		for root, dirnames, filenames in os.walk('project/apps')
+			if folder_name in dirnames
 )
 DATABASES = {
 	'default': {
 		'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-		'NAME': 'production.sqlite3',					  # Or path to database file if using sqlite3.
+		'NAME': os.path.join(PROJECT_ROOT, '..', 'prod.sqlite3'),  # Or path to database file if using sqlite3.
 		'USER': '',					  # Not used with sqlite3.
 		'PASSWORD': '',				  # Not used with sqlite3.
 		'HOST': '',					  # Set to empty string for localhost. Not used with sqlite3.
 	}
 }
 
-FIXTURE_DIRS = (
-	'project/apps/main/fixtures_prod',
-)
+import os
+
+folder_name = 'fixtures_%s' % __file__.replace('.py', '')
+
+FIXTURE_DIRS = tuple(
+	os.path.join(root, folder_name)
+		for root, dirnames, filenames in os.walk('project/apps')
+			if folder_name in dirnames
+)

project/settings.py

 	)
 
 # turn this on to enable YUI compressor
-# also add yuic in buildout.cfg
 COMPRESS_ENABLED = False
 COMPRESS_JS_FILTERS = ['compressor.filters.yui.YUIJSFilter']
 COMPRESS_CSS_FILTERS = ['compressor.filters.yui.YUICSSFilter']
-COMPRESS_YUI_BINARY = os.path.join(PROJECT_ROOT, '..', 'parts', 'yuic', 'yuicompressor-2.4.7.jar')
+COMPRESS_YUI_BINARY = os.path.join(PROJECT_ROOT, '..', 'bin', 'yuicompressor')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.