Commits

Yann Malet committed 8a4eef6

Initial commit of the core app. It will contains the realtime things.

  • Participants
  • Parent commits 74ae1bb
  • Branches realtimemagic_integration

Comments (0)

Files changed (6)

File django_tutorial/apps/core/__init__.py

Empty file added.

File django_tutorial/apps/core/models.py

+from django.db import models
+
+# Create your models here.

File django_tutorial/apps/core/templates/core/index.html

+{% extends "base.html" %}
+
+{% block content %}
+hello world
+{% endblock%}
+
+{% block js %}
+{{ block.super }}
+<script>
+   var sock = new SockJS('http://localhost:9000/pubsub');
+   sock.onopen = function() {
+       console.log('open');
+   };
+   sock.onmessage = function(e) {
+       console.log('message', e.data);
+   };
+   sock.onclose = function() {
+       console.log('close');
+   };
+</script>
+{% endblock %}

File django_tutorial/apps/core/tests.py

+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django.test import TestCase
+
+
+class SimpleTest(TestCase):
+    def test_basic_addition(self):
+        """
+        Tests that 1 + 1 always equals 2.
+        """
+        self.assertEqual(1 + 1, 2)

File django_tutorial/apps/core/urls.py

+from django.conf.urls.defaults import *
+
+from .views import index
+
+urlpatterns = patterns('',
+        url(r'^$', index, name="index")
+)

File django_tutorial/apps/core/views.py

+# Create your views here.
+
+from django.shortcuts import render
+
+
+def index(request):
+    """
+    index view take a request and display the changes
+    """
+    return render(request, "core/index.html")