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
| # This configuration assumes you are running some kind of PHP FastCGI daemon to send for processing. | |
| # I've commented parts of the file for clarity if someone does not understand what's going on. | |
| # Here we simply rewrite the `www` out of the domain name because it's useless in most cases. | |
| # Totally optional. | |
| server { | |
| listen 80; | |
| server_name www.example.com; | |
| rewrite ^/(.*) http://example.com/$1 permanent; | |
| } |
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
| # Place this in its own file and add it to your `AUTHENTICATION_BACKENDS` setting in settings.py | |
| from django.conf import settings | |
| from django.contrib.auth.models import User | |
| class EmailModelBackend(object): | |
| def authenticate(self, username=None, password=None): | |
| kwargs = {'email': username} | |
| try: |
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
| server { | |
| 2 listen 98.129.237.54:80; | |
| 3 server_name www.mysite.com; | |
| 4 rewrite ^/(.*) http://mysite.com/$1 permanent; | |
| 5 } | |
| 6 | |
| 7 server { | |
| 8 listen 98.129.237.54:80; | |
| 9 server_name mysite.com; | |
| 10 |
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
| # section1.1.7 from SICP written in python .. was just making sure I understood how it all worked. | |
| def square(x): | |
| return x * x | |
| def sqrt_iter(guess, x): | |
| if good_enough(guess, x): | |
| return guess | |
| else: | |
| return sqrt_iter(improve(guess, x), x) |
NewerOlder