This file contains hidden or 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
| """ | |
| Flopsy | |
| ====== | |
| A very simple way to interact with python AMQPlib. For my case I'm using | |
| RabbitMQ as my implementation but it should work with others. | |
| settings.py | |
| ----------- |
This file contains hidden or 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
| class KeepQueryStringModelAdmin(admin.ModelAdmin): | |
| """ | |
| A ModelAdmin that "fixes" the default behavior of redirecting to the | |
| default change list after a save. | |
| This class remembers the change list query string that was used for the | |
| change list and redirects to it after a save, maintaining the ordering, | |
| filtering, & pagination. | |
| Thanks to Vlada Macek http://djangopeople.net/tuttle/ | |
This file contains hidden or 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
| class KeepQueryStringModelAdmin(admin.ModelAdmin): | |
| """ | |
| A ModelAdmin that "fixes" the default behavior of redirecting to the | |
| default change list after a save. | |
| This class remembers the change list query string that was used for the | |
| change list and redirects to it after a save, maintaining the ordering, | |
| filtering, & pagination. | |
| Thanks to Vlada Macek http://djangopeople.net/tuttle/ | |
This file contains hidden or 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
| from mimetypes import guess_type | |
| from django.core.exceptions import ImproperlyConfigured | |
| from django.core.files.storage import Storage | |
| from django.utils.encoding import iri_to_uri | |
| import re | |
| try: | |
| import S3 | |
| except ImportError: | |
| raise ImproperlyConfigured, "Could not load amazon's S3 bindings.\ |
This file contains hidden or 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
| """ | |
| Copyright (c) 2009, Sean Creeley | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without modification, | |
| are permitted provided that the following conditions are met: | |
| * Redistributions of source code must retain the above copyright notice, this | |
| list of conditions and the following disclaimer. | |
| * Redistributions in binary form must reproduce the above copyright notice, |
This file contains hidden or 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
| """ | |
| Copyright (c) 2008-2009, Nathan Borror | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without modification, | |
| are permitted provided that the following conditions are met: | |
| Redistributions of source code must retain the above copyright notice, this list | |
| of conditions and the following disclaimer. | |
| Redistributions in binary form must reproduce the above copyright notice, this |
This file contains hidden or 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
| # If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! | |
| export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " | |
| # This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty! | |
| # ~/code/web:beta_directory$ git checkout master | |
| # Switched to branch "master" | |
| # ~/code/web:master$ git checkout beta_directory | |
| # Switched to branch "beta_directory" |
This file contains hidden or 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
| from django.shortcuts import render_to_response | |
| from site.settings import DEBUG | |
| class DevMiddleware: | |
| def process_request(self, request): | |
| if DEBUG == False: | |
| if request.user.is_authenticated() == False: | |
| if '/admin' not in request.path: | |
| return render_to_response('splash.html') |
This file contains hidden or 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
| ============================================================= | |
| Installing Multicore Solr 1.3.0 / Tomcat 6.0.X on Ubuntu 8.10 | |
| ============================================================= | |
| Install OpenJDK (comes from universe):: | |
| aptitude install openjdk-6-jre | |
| Download Tomcat 6.X and move it in place:: |
This file contains hidden or 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
| ============================================================= | |
| Installing Multicore Solr 1.3.0 / Tomcat 6.0.X on Ubuntu 8.10 | |
| ============================================================= | |
| Install OpenJDK (comes from universe):: | |
| aptitude install openjdk-6-jre | |
| Download Tomcat 6.X and move it in place:: |
OlderNewer