İnterneti çocuklar için güvenli hale getirmenin yolu bulunmuş, işte alan adlarında bulunması yasaklı kelimeler listesinden bir demet;
- atesli
- escort
- dump
- hikaye
- homemade
- nefes
- yerli
- tube
- turbanli
- zoo
String url = "action";
final RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, URL.encode(url));
builder.setHeader("Content-Type", "text/plain");
try {
@SuppressWarnings("unused")
Request request = builder.sendRequest(textToServer, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
if (200 == response.getStatusCode()) {
nameField.setText( response.getText() );
} else {
nameField.setText( "Server error" );
}
}
@Override
public void onError(Request request, Throwable exception) {
nameField.setText("Connection error");
}
});
} catch (RequestException e) {
// TODO Auto-generated catch block
nameField.setText("Unknown error");
}
urls.py
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def action(request):
return HttpResponse("Your name is : %s" %request.raw_post_data )
urlpatterns = patterns('',
('^$', entry),
('^test/(.*)$', "django.views.static.serve", {"document_root":settings.STATIC_DOC_ROOT}),
('^action$', action),
)
Bu iletişim yöntemini JSON verilerini taşımak veya kendi XML-RPC yapınızı kurmak için kullanabilirsiniz.
/war
Test.html
Test.css
__init__.py
manage.py
settings.py
urls.py
test
|_...
#Settings.py
ROOT_URLCONF = 'urls' #Çünkü projemiz kök dizinde
import os
TEMPLATE_DIRS = ( os.path.dirname(__file__).replace('\\','/'), )
STATIC_DOC_ROOT = os.path.dirname(__file__).replace('\\','/')+"/test"
1: #urls.py
2: from django.conf.urls.defaults import *
3: from django.template import loader, Context
4: from django.http import HttpResponse
5: from django.conf import settings
6:
7:
8: def entry(request):
9: t = loader.get_template('Test.html')
10: return HttpResponse(t.render(Context()))
11:
12:
13: urlpatterns = patterns('',
14: ('^$', entry),
15: ('^test/(.*)$', "django.views.static.serve", {"document_root":settings.STATIC_DOC_ROOT}),
16: )
<!-- Test.html -->
<link type="text/css" rel="stylesheet" href="test/Test.css">