Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4615f75
Showing
27 changed files
with
1,559 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
*.pyc | ||
dev.db | ||
local_settings.py | ||
media/ugc | ||
media/ | ||
media2/ | ||
django | ||
externals | ||
build/ | ||
src/ | ||
pip-log.txt | ||
media/js/*.r*.js | ||
media/css/*.r*.css | ||
*DS_Store | ||
*.egg-info | ||
externals | ||
MANIFEST | ||
dist/ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.core.files.storage import FileSystemStorage | ||
from django.conf import settings | ||
import os | ||
|
||
DEFAULT_ROOT = os.path.join(settings.MEDIA_ROOT_PREFIX, 'assets') | ||
DEFAULT_URL = '%smedia/' % settings.MEDIA_URL_PREFIX | ||
|
||
class MediaStorage(FileSystemStorage): | ||
def __init__(self, location='', base_url='', *args, **kwargs): | ||
real_location = os.path.join(DEFAULT_ROOT, location) | ||
real_base_url = "%s%s" % (DEFAULT_URL, base_url) | ||
super(MediaStorage, self).__init__(real_location, real_base_url, *args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
if [ "$VIRTUAL_ENV" = "" ]; then | ||
echo "You must be in a virtualenv environment. Type workon for a list." | ||
exit | ||
fi | ||
|
||
FILES=$VIRTUAL_ENV/src/* | ||
|
||
for f in $FILES | ||
do | ||
if [ -d $f ] | ||
then | ||
cd $f | ||
if [ -e .git ] | ||
then | ||
git status | ||
elif [ -e .bzr ] | ||
then | ||
bzr status | ||
elif [ -e .hg ] | ||
then | ||
hg status | ||
elif [ -e .svn ] | ||
then | ||
svn status | ||
fi | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "$VIRTUAL_ENV" = "" ]; then | ||
echo "You must be in a virtualenv environment. Type workon for a list." | ||
exit | ||
fi | ||
|
||
PWD=`pwd` | ||
POSTACTIVATE=$VIRTUAL_ENV/bin/postactivate | ||
|
||
if [ -e externals ]; then | ||
echo 'Externals link exists.' | ||
else | ||
echo 'Creating link: externals.' | ||
ln -s $VIRTUAL_ENV/src externals | ||
fi | ||
|
||
if [ -e $POSTACTIVATE ]; then | ||
echo 'Postactivate script exists.' | ||
else | ||
echo 'Creating postactivate script.' | ||
cat > $POSTACTIVATE <<END | ||
#!/bin/bash/ | ||
cd $PWD | ||
END | ||
chmod +x $POSTACTIVATE | ||
fi | ||
|
||
pip install -U -r setup/requirements.txt | ||
rm -Rf src | ||
rm -Rf build | ||
rm -Rf pip-log.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
if [ "$VIRTUAL_ENV" = "" ]; then | ||
echo "You must be in a virtualenv environment. Type workon for a list." | ||
exit | ||
fi | ||
|
||
FILES=$VIRTUAL_ENV/src/* | ||
|
||
for f in $FILES | ||
do | ||
if [ -d $f ] | ||
then | ||
cd $f | ||
if [ -e .git ] | ||
then | ||
git pull origin master | ||
elif [ -e .bzr ] | ||
then | ||
bzr merge | ||
elif [ -e .hg ] | ||
then | ||
hg pull | ||
elif [ -e .svn ] | ||
then | ||
svn up | ||
fi | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
if [ "$VIRTUAL_ENV" = "" ]; then | ||
echo "You must be in a virtualenv environment. Type workon for a list." | ||
exit | ||
fi | ||
|
||
FILES=$VIRTUAL_ENV/src/* | ||
|
||
for f in $FILES | ||
do | ||
if [ -d $f ] | ||
then | ||
cd $f | ||
if [ -e .git ] | ||
then | ||
git push origin master | ||
# elif [ -e .bzr ] | ||
# then | ||
# bzr merge | ||
# elif [ -e .hg ] | ||
# then | ||
# hg pull | ||
# elif [ -e .svn ] | ||
# then | ||
# svn up | ||
fi | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
if [ "$VIRTUAL_ENV" = "" ]; then | ||
echo "You must be in a virtualenv environment. Type workon for a list." | ||
exit | ||
fi | ||
|
||
git pull origin master | ||
bin/pull-ext.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<VirtualHost *:80> | ||
ServerAdmin j@j.com | ||
ServerName bmore | ||
ServerAlias media-bmore | ||
DocumentRoot /var/code/bmore/media | ||
|
||
WSGIDaemonProcess bmore user=webdev group=webdev processes=3 threads=1 maximum-requests=1000 python-path=/home/webdev/.virtualenvs/bmore/lib/python2.5/site-packages | ||
WSGIProcessGroup bmore | ||
WSGIScriptAlias / /var/code/bmore/conf/bmore.wsgi | ||
|
||
Alias /media /var/code/bmore/media | ||
<Directory /var/code/bmore/media> | ||
SetHandler None | ||
AddOutputFilterByType DEFLATE text/plain | ||
AddOutputFilterByType DEFLATE text/xml | ||
AddOutputFilterByType DEFLATE application/xhtml+xml | ||
AddOutputFilterByType DEFLATE text/css | ||
AddOutputFilterByType DEFLATE application/xml | ||
AddOutputFilterByType DEFLATE image/svg+xml | ||
AddOutputFilterByType DEFLATE application/rss+xml | ||
AddOutputFilterByType DEFLATE application/atom_xml | ||
AddOutputFilterByType DEFLATE application/x-javascript | ||
AddOutputFilterByType DEFLATE application/x-httpd-php | ||
AddOutputFilterByType DEFLATE application/x-httpd-fastphp | ||
AddOutputFilterByType DEFLATE application/x-httpd-eruby | ||
AddOutputFilterByType DEFLATE text/html | ||
FileETag INode MTime Size | ||
</Directory> | ||
|
||
Alias /admin-media /home/webdev/.virtualenvs/bmore/lib/python2.5/site-packages/django/contrib/admin/media | ||
<Directory /home/webdev/.virtualenvs/bmore/lib/python2.5/site-packages/django/contrib/admin/media> | ||
SetHandler None | ||
</Directory> | ||
|
||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os, sys, site | ||
|
||
site.addsitedir('/home/webdev/bmore/.virtualenvs/bmore/lib/python2.5/site-packages') | ||
|
||
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | ||
sys.path.insert(0, os.path.join(PROJECT_ROOT,"apps")) | ||
sys.path.insert(0, os.path.join(PROJECT_ROOT,"lib")) | ||
sys.path.insert(0, PROJECT_ROOT) | ||
|
||
sys.stdout = sys.stderr | ||
|
||
if PROJECT_ROOT not in sys.path: | ||
sys.path.append(PROJECT_ROOT) | ||
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' | ||
|
||
import django.core.handlers.wsgi | ||
|
||
application = django.core.handlers.wsgi.WSGIHandler() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
server { | ||
listen 80; | ||
server_name media-$$$$DEV_APP_HOST$$$$; | ||
access_log /var/log/nginx/media-$$$$DEV_APP_HOST$$$$.access.log; | ||
location / { | ||
autoindex on; | ||
index index.html; | ||
root /var/code/bmore/media; | ||
expires max; | ||
} | ||
} | ||
server { | ||
listen 80; | ||
server_name $$$$DEV_APP_HOST$$$$; | ||
access_log /var/log/nginx/$$$$DEV_APP_HOST$$$$.access.log; | ||
location / { | ||
proxy_pass http://webcluster; | ||
include /var/code/bmore/conf/proxy.conf; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Put python libraries here. Libraries are generic python packages. | ||
# (Ones that Django doesn't need to have in INSTALLED_APPS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python | ||
import os, sys | ||
BASE_DIR = os.path.abspath(os.path.dirname(__file__)) | ||
sys.path.insert(0, os.path.join(BASE_DIR,"lib")) | ||
sys.path.insert(0, os.path.join(BASE_DIR,"apps")) | ||
sys.path.insert(0, BASE_DIR) | ||
|
||
from django.core.management import execute_manager | ||
try: | ||
import settings # Assumed to be in the same directory. | ||
except ImportError: | ||
import sys | ||
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) | ||
sys.exit(1) | ||
|
||
if __name__ == "__main__": | ||
execute_manager(settings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from django.core.urlresolvers import reverse | ||
from django.utils.translation import ugettext_lazy as _ | ||
from admin_tools.menu.models import * | ||
|
||
# to activate your custom menu add the following to your settings.py: | ||
# | ||
# ADMIN_TOOLS_MENU = 'menu.CustomMenu' | ||
class CustomMenu(Menu): | ||
def __init__(self, **kwargs): | ||
super(CustomMenu, self).__init__(**kwargs) | ||
self.children.append( | ||
MenuItem(title='Dashboard', url=reverse('admin:index')) | ||
) | ||
self.children.append( | ||
AppListMenuItem(title='Applications') | ||
) | ||
|
||
# self.children.append( | ||
# MenuItem(title='Content', | ||
# children=[ | ||
# MenuItem(title='Audio Clips', url=reverse('admin:massmedia_audio_changelist')), | ||
# MenuItem(title='Collections', url=reverse('admin:massmedia_collection_changelist')), | ||
# MenuItem(title='Documents', url=reverse('admin:massmedia_document_changelist')), | ||
# MenuItem(title='Images', url=reverse('admin:massmedia_image_changelist')), | ||
# MenuItem(title='Stories', url=reverse('admin:stories_story_changelist')), | ||
# MenuItem(title='Videos', url=reverse('admin:massmedia_video_changelist')), | ||
# ]) | ||
# ) | ||
# self.children.append( | ||
# MenuItem(title='Organize', | ||
# children=[ | ||
# MenuItem(title='Categories', url=reverse('admin:categories_category_changelist')), | ||
# MenuItem(title='Navigation Bar', url=reverse('admin:navbar_navbarentry_changelist')), | ||
# MenuItem(title='Postions', url=reverse('admin:positions_position_changelist')), | ||
# ]) | ||
# ) | ||
# self.children.append( | ||
# MenuItem(title='Settings', | ||
# children=[ | ||
# MenuItem(title='Admin Menu'), | ||
# MenuItem(title='Analytics', url=reverse('admin:google_analytics_analytics_changelist')), | ||
# MenuItem(title='Denied IPs', url=reverse('admin:ban_deniedip_changelist')), | ||
# MenuItem(title='Redirects', url=reverse('admin:redirects_redirect_changelist')), | ||
# MenuItem(title='Robots', url=reverse('admin:app_list', args=('robots',))), | ||
# MenuItem(title='Syndication Feeds', url=reverse('admin:synagg_feed_changelist')), | ||
# ]) | ||
# ) | ||
# self.children.append(MenuItem(title='Comments')) | ||
# | ||
# self.children.append( | ||
# MenuItem(title='Users', | ||
# children=[ | ||
# MenuItem(title='Users', url=reverse('admin:auth_user_changelist')), | ||
# # MenuItem(title='Profiles', url=reverse('admin:app_model_changelist')), | ||
# ]) | ||
# ) | ||
|
Oops, something went wrong.