-
Install redis on OSX (10.7) Lion I used:
$ brew install redis -
In the project and virtualenv I wanted to use django-celery in I installed the following.
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.conf import settings | |
| import re | |
| class SubdominiosMiddleware: | |
| def process_request(self, request): | |
| request.domain = request.META['HTTP_HOST'] | |
| request.subdomain = '' | |
| parts = request.domain.split('.') | |
| if len(parts) == 3 or (re.match("^localhost", parts[-1]) and len(parts) == 2): |
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
| <?php | |
| /** | |
| * Merge two dimensional arrays my way | |
| * | |
| * Will merge keys even if they are of type int | |
| * | |
| * @param array $array1 Initial array to merge. | |
| * @param array ... Variable list of arrays to recursively merge. | |
| * |
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
| <?php | |
| /** | |
| * Premailer API PHP class | |
| * Premailer is a library/service for making HTML more palatable for various inept email clients, in particular GMail | |
| * Primary function is to convert style tags into equivalent inline styles so styling can survive <head> tag removal | |
| * Premailer is owned by Dialect Communications group | |
| * @link http://premailer.dialect.ca/api | |
| * @author Marcus Bointon <marcus@synchromedia.co.uk> | |
| */ | |
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
| <?php | |
| $countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island |
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
| # Example logging configuration that will restrict console logging to | |
| # at most 2 repeated messages per 30 seconds. | |
| LOGGING = { | |
| 'version': 1, | |
| 'disable_existing_loggers': True, | |
| 'formatters': { | |
| 'simple': { | |
| 'format': '%(asctime)s - %(name)s - %(levelname)s - %(filename)s:%(lineno)d - %(message)s' | |
| }, | |
| }, |
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
| (r'^articles/(?P<year>\d{4}/?$, 'main.views.year'), | |
| # When a use case comes up that a month needs to be involved as | |
| # well, you add an argument in your regex: | |
| (r'^articles/(?P<year>\d{4}/(?P<month>\d{2})/?$, 'main.views.year_month'), | |
| # That works fine, unless of course you want to show something | |
| # different for just the year, in which case the following case can be | |
| # used, making separate views based on the arguments as djangoproject |
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
| # useful nginx configuration for reverse proxy with Apache | |
| # edit lines 8, 11, and 30 | |
| # taken from: http://syslog.tv/2010/01/11/debian-apache-2-nginx-wordpress-mu/ | |
| # edits by jakebellacera (http://github.com/jakebellacera && http://jakebellacera.com) | |
| server { | |
| listen 80; | |
| server_name domain.com *.domain.com; # edit this to your domain |
NewerOlder