News for hackers. Stuff that matters.
Re:Using subdomains (e.g. http://XYZ.someserver.com) with dj... by jhancock on Tuesday October 21, 2008 @05:59AM (#338793)
WARNING: don't use subdomains if you want users in China to be able to get to your site. By default, most/all subdomains managed like this do not get put in China's DNS properly. Get used to life with the great firewall, it is what it is ;)
Re:Using subdomains (e.g. http://XYZ.someserver.com) with dj... by jonknee on Tuesday October 21, 2008 @11:55AM (#339007)
I still manage to get spam from China on a site with subdomains. It would actually be a feature if I could easily block all of China.
Re:Using subdomains (e.g. http://XYZ.someserver.com) with dj... by tannerhiland on Wednesday October 22, 2008 @03:06PM (#340406)
You can always do a country lookup from APNIC that will give you all of the IP's assigned to China (or any other country that regional registrar manages).

http://www.apnic.net/apnic-bin/ipv4-by-country.pl?country=CN

I wrote a script a while back that parses that list and creates an access-list for country blocking. Maybe I'll put it online one day.

At least that's how us network folk do it.

Re:Using subdomains (e.g. http://XYZ.someserver.com) with dj... by jhancock on Wednesday October 22, 2008 @12:45AM (#339745)
its not an absolute. but if you count on subdomains working for your users, you will be disappointed.

And if you think only spamming happens from China, you haven't compared the current account balances of the U.S. and China lately ;).

Re:Using subdomains (e.g. http://XYZ.someserver.com) with dj... by nocivus on Tuesday October 21, 2008 @06:08AM (#338798)
Really? Do you know why that happens? Is it intentional, from their government?
Re:Using subdomains (e.g. http://XYZ.someserver.com) with dj... by jhancock on Wednesday October 22, 2008 @12:47AM (#339747)
There is no published policy for how and why things get blocked. The behavior of the firewall changes over time.

The subdomains problem seems to do more with DNS replication and pessimistic acceptance of DNS records more so than a person actually censoring content.

Re:Using subdomains (e.g. http://XYZ.someserver.com) with dj... by niels on Tuesday October 21, 2008 @10:50AM (#338950)
Why should django deal with subdomains. Just use mod_rewrite or whatever your server offers to map your internal urls. myname.mydomain.com -> mydomain.com/myname/
Re:Using subdomains (e.g. http://XYZ.someserver.com) with dj... by jonknee on Tuesday October 21, 2008 @11:13AM (#338971)
It's much cleaner to have it taken care of in Django than through mod_rewrite. For one all of your URL routing will still work. In your setup using {% url %} or reverse() wouldn't work.
Re:Using subdomains (e.g. http://XYZ.someserver.com) with dj... by whalesalad on Tuesday October 21, 2008 @12:27PM (#339043)
Yeah I agree here. Putting that inside of your application and outside your web server config makes more sense to me. Especially using the reverse url matching, which is so amazingly wonderful (especially when you give your url's unique names like user-account-settings and can simply do {% url user-account-settings %} and be done with it). Hat tip to obeattie.com for all my django template ramblings above ;)