Saturday, March 31, 2018

Display graphic on a website Problem

Hello, can anyone help me ?

I try to display a graphic with curves changing every second on a website with the framework Django.

 

The problem here is as follows: I can't see my display on the website.

 

The code is as follows:

 

models.py:

 

# -*- coding: utf-8 -*-

from __future__ import unicode_literals

 

from django.contrib.auth import models

from django.template.defaultfilters import slugify

from django.db import models

from django.contrib.auth.models import User

from django.utils import timezone

from django.conf import settings

            :

            :

            :

            (etc………)

import osmosdr

import time

import wx

 

class top_block(grc_wxgui.top_block_gui):

 

    def __init__(self):

        grc_wxgui.top_block_gui.__init__(self, title="Top Block")

            :

            :

            (etc……………)

            :

 

    def  get_samp_rate(self):

        return self.samp_rate

 

    def  set_samp_rate(self, samp_rate):

        self.samp_rate = samp_rate

        self.wxgui_fftsink2_0.set_sample_rate(self.samp_rate)

        self.rtlsdr_source_0.set_sample_rate(self.samp_rate)

 

views.py:

 

# -*- coding: utf-8 -*-

from __future__ import unicode_literals

 

from django.shortcuts import render, get_object_or_404

from django.utils import timezone

from .models import Post, top_block

from  django.contrib.auth import models

from  django.contrib.auth.models import User

from django.shortcuts import redirect

 

def main(request):

            start = top_block.Start(True)

            stop = top_block.Wait()

            return render(request, 'blog/main.html', {'start':start}, {'stop':stop})

 

 

urls.py:

 

from django.conf.urls import url

from . import views

 

urlpatterns = [

     url(r'^$', views.main, name='main'), 

]

 

 

__init__.py:

 

 

apps.py:

 

# -*- coding: utf-8 -*-

from __future__ import unicode_literals

 

from django.apps import AppConfig

 

 

class BlogConfig(AppConfig):

    name = 'blog'

 

base.html:

 

{% load staticfiles %}

<html>

   <head>

            <!-- Début de page -->

        <title>Le blog d'essaie</title>

        <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

        <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">

        <link href='//fonts.googleapis.com/css?family=Lobster&subset=latin,latin-ext' rel='stylesheet' type='text/css'>

                        <link rel= "stylesheet" href="{%static 'css/blog.css' %}">

   </head>

   <body>

            <!-- Corps de la page -->

        <div class="page-header">

            <h1><a href="/">Blog de projet</a></h1>

        </div>

 

 

        <div class="content container">

                <div class="row">

                        <div class="col-md-8">

                        {% block content %}

                                                                       {% endblock %}

                        </div>

                </div>

        </div>

   </body>

</html>

 

main.html:

 

{% extends 'blog/base.html' %}

 

{% block content %}

        <div class="top_block">

                        {{start}}

                        {{stop}}

        </div>

{% endblock %}

 

 

blog.css:

 

h1 a {

            color: #FCA205;

            font-family: 'Lobster';

}

 

body{

            padding-left: 15px;

}

 

.page-header {

            background-color: #ff9400;

            margin-top: 0;

            padding: 20px 20px 20px 40px;

}

 

.page-header h1,.page-header h1 a, .page-header h1 a:visited, .page-header h1 a:active {

            color: #ffffff;

            font-size: 36pt;

            text-decoration: none;

}

 

.content{

            margin-left: 40px;

}

 

h1, h2, h3, h4 {

            font-family: 'Lobster', cursive;

}

 

.date{

            float: right;

            color: #828282;

}

 

.save{

            float: right;

}

 

.post-form textarea, .post-form input {

            with: 100%;

}

 

.top-menu, .top-menu:hover, .top-menu:visited{

            color: #ffffff;

            float: right;

            font-size: 26pt;

            margin-right: 20px;

}

 

.post {

            margin-bottom: 70px;

}

 

.post h1 a, .post h1 a:visited {

            color: #000000;

}

 

 

 

 

 

 

 

 

 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2cb8794b-f861-4448-9eba-d0e6eb674868%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment