JQuery is not working in django (Showing $ is not defined) - python

Here is my code. I have a static folder in which i have all css and js files
{% load static %}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>template is working</title>
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}">
<script href="{% static 'js/jquery.js' %}"></script>
<script href="{% static 'js/bootstrap.js' %}"></script>
<script>
var jQuery = django.jQuery;
var $ = jQuery;
$(document).ready(function () {
alert("Hello");
})
</script>
</head>
Here is the screenshot of directory structure
enter image description here

I don't know what you are trying to do but those line are not necessary:
var jQuery = django.jQuery;
var $ = jQuery;

I, as #Stéphane also have no idea what are you trying to do, because as I know, jQuery ready statement defined like this:
$( document ).ready(function() {
console.log( "ready!" );
});
or...
// Shorthand for $( document ).ready()
$(function() {
console.log( "ready!" );
});
Also, I think this question even don't related to Django framework. If you want use jQuery, you should read its documentation.

Related

Printing Python Output to Specific Div in HTML

I've been searching up this for at least a week, with no fruitful results coming up. In particular, the main ways that have come up are creating a django project with a complicated file structure and all, but I simply just want to output some Python strings to a specific div with my existing file structure (a simple one that consists of PHP/HTML files, my Python file, and my CSS/JS folders). Then I found this result, and the main answer (scroll down a bit, it's by #miniscruff) fortunately doesn't require anything complicated except adding some code. However, it doesn't seem to be working. Is this a problem with PHP (since #vickilanger's file is an HTML file instead of a PHP, and she claims that the code worked)?
My index.php:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie-edge">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">
<link rel="stylesheet" href="css/style.css?v=<?php echo time(); ?>">
<!-- Font Awesome -->
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.0.7/css/all.css">
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Kalam&family=Pangolin&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<!-- JQuery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<title>Home</title>
</head>
<body>
<div class="placeholder"></div>
<script>
$(function(){
$('.placeholder').load("nav.html?v=<?php echo time(); ?>");
});
</script>
<code class="language-python match-braces" id="main-num">
Fetching portfolio...
</code>
<script src="js/main.js"></script>
<script>
fetch("test.py")
.then(response => {
if(!response.ok) {
throw new Error("Bad Response")
}
return response.text()
})
.then(text => document.getElementById("main-num").innerText = text)
.catch(error => document.getElementById("main-num").innerText = error)
</script>
</body>
</html>
My test.py:
satisfy = [3, 6, 12, 53, 78, 586]
for num in satisfy:
if num > 15:
print(num)
Additionally, would there be any other simple way to print Python to HTML if the dev.to method doesn't work?

How to show query result with selectize.js in Django

I want to the taking ajax response.then show select list attribute in Django Template. I take data with ajax request but select list components does not show result of query.I want to show result query when searching keyword.When page load doesn't fill list. Just show searching key.I send success ajax request and callback to success response object How can I fix this problem
Response Object :
{data: "[{"Code": "1001"}, {"Code": "1100"}]"}
Django Template
{% block body %}
{ % load bootstrap4 %} {# import bootstrap4/bootstrap3 #}
{% load i18n %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/js/standalone/selectize.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/js/standalone/selectize.min.js">
</script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.min.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.default.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.legacy.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.legacy.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.bootstrap3.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.bootstrap3.min.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.default.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.default.min.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.default.min.css.map" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.legacy.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.legacy.min.css" rel="stylesheet" type="text/css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.legacy.min.css.map" rel="stylesheet" type="text/css">
<script>
$(document).ready( function () {
$('#select_code').selectize({
valueField: 'code',
labelField: 'code',
searchField: 'code',
options: [],
create: true,
load: function(query, callback) {
if (!query.length) return callback();
$.ajax({
url: 'test/json',
type: 'GET',
dataType: 'json',
data: {
q: query
},
error: function() {
callback();
},
success: function(res) {
console.log(res.data)
callback(res.data)
}
});
}
});
})
</script>
<div class="form-group">
<div class="col-md-12">
<select class="form-control" id="select_code" ></select>
</div>
test_json.py
def test_kolon(request):
q=request.GET.get('q')
db = Test.objects.filter(
Q(code__icontains= q)
).values('code')
list_data_json = json.dumps(list(db))
context={
"data":list_data_json
}
return JsonResponse(context)
I solved question.
list_data_json = json.dumps(list(db))
Change the following code
list_data_json = jlist(db)
context=list_data_json
return JsonResponse(context,safe=False)

Version issue with embedding bokeh on heroku app

I am having a problem embedding Bokeh on Heroku. It works fine on my local machine, but something is wrong, when I try on heroku. Below is the html file. My guess is the data is not embedding correctly. For instance __ndarray__ has some weird characters instead of the data. I had been struggling to find a solution. Can someone provide help?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Time-series plot</title>
<link rel="stylesheet" href="http://cdn.bokeh.org/bokeh/release/bokeh-0.12.3.min.css" type="text/css" />
<script type="text/javascript" src="http://cdn.bokeh.org/bokeh/release/bokeh-0.12.3.min.js"></script>
<script type="text/javascript">
(function() {
var fn = function() {
Bokeh.safely(function() {
var docs_json = {"25435e2e-0cb3-47b8-8bf1-32c906b6f420":{"roots":{"references":[{"attributes":{"callback":null},"id":"10baebf3-faeb-46d1-859d-3263c6cd9354","type":"DataRange1d"},{"attributes":{"line_alpha":{"value":0.1},"line_color":{"value":"#1f77b4"},"x":{"field":"x"},"y":{"field":"y"}},"id":"2be1d120-5724-460f-b0f0-7231d7e46726","type":"Line"},{"attributes":{"base":60,"mantissas":[1,2,5,10,15,20,30],"max_interval":1800000.0,"min_interval":1000.0,"num_minor_ticks":0},"id":"062863cd-1ed4-4b1a-af68-b016860bd87a","type":"AdaptiveTicker"},{"attributes":{"bottom_units":"screen","fill_alpha":{"value":0.5},"fill_color":{"value":"lightgrey"},"left_units":"screen","level":"overlay","line_alpha":{"value":1.0},"line_color":{"value":"black"},"line_dash":[4,4],"line_width":{"value":2},"plot":null,"render_mode":"css","right_units":"screen","top_units":"screen"},"id":"616ed4ac-d4c5-4010-beff-1589b8b73f52","type":"BoxAnnotation"},{"attributes":{"max_interval":500.0,"num_minor_ticks":0},"id":"9517227c-f613-42bc-a35e-ae3c9543f317","type":"AdaptiveTicker"},{"attributes":{"items":[{"id":"2fd93036-1ef3-4d56-bad7-88fdf9352c21","type":"LegendItem"}],"location":"top_left","plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"}},"id":"13ee15d7-a5bd-40c8-b896-6d8955b883ee","type":"Legend"},{"attributes":{},"id":"751d139b-ceca-4eec-acbd-41e25b434a73","type":"DatetimeTickFormatter"},{"attributes":{},"id":"34d4f26b-a640-4129-88fd-578633815bbd","type":"YearsTicker"},{"attributes":{"below":[{"id":"f8b00322-303d-4c46-a577-b48573240aa7","type":"DatetimeAxis"}],"left":[{"id":"77143d5d-525f-4d25-acea-5c424eded496","type":"LinearAxis"}],"plot_height":500,"plot_width":800,"renderers":[{"id":"f8b00322-303d-4c46-a577-b48573240aa7","type":"DatetimeAxis"},{"id":"aa08aef8-adbe-4ac9-bb30-3276e6833765","type":"Grid"},{"id":"77143d5d-525f-4d25-acea-5c424eded496","type":"LinearAxis"},{"id":"bff245c2-03a5-411c-a938-515909623506","type":"Grid"},{"id":"616ed4ac-d4c5-4010-beff-1589b8b73f52","type":"BoxAnnotation"},{"id":"4311d6d9-1db1-4a28-b427-4f0d3da33a8d","type":"BoxAnnotation"},{"id":"13ee15d7-a5bd-40c8-b896-6d8955b883ee","type":"Legend"},{"id":"baee81d6-e664-46ba-b9d3-2e030d7fd672","type":"GlyphRenderer"}],"title":{"id":"ed0051be-e237-4b47-8663-afb3b1f1ce7c","type":"Title"},"tool_events":{"id":"93f77166-b47d-4147-8f40-60587534bb6e","type":"ToolEvents"},"toolbar":{"id":"9af07266-a889-4c6c-8e88-7a1f31d740f0","type":"Toolbar"},"x_range":{"id":"10baebf3-faeb-46d1-859d-3263c6cd9354","type":"DataRange1d"},"y_range":{"id":"4ffcdd86-22b4-4b7a-be07-ac70c84c27db","type":"DataRange1d"}},"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"},{"attributes":{"band_fill_alpha":{"value":0.1},"band_fill_color":{"value":"olive"},"dimension":1,"grid_line_alpha":{"value":0},"plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"},"ticker":{"id":"06fb8ff2-d611-405b-be38-e171cbf46d8c","type":"BasicTicker"}},"id":"bff245c2-03a5-411c-a938-515909623506","type":"Grid"},{"attributes":{"months":[0,2,4,6,8,10]},"id":"5fc979d4-46a9-469c-af56-527c9d4cb163","type":"MonthsTicker"},{"attributes":{"num_minor_ticks":5},"id":"f897d924-3e38-464c-a5af-8eb5d3b68094","type":"DatetimeTicker"},{"attributes":{"data_source":{"id":"6d6fc44a-63fb-4b3d-95b8-3d219a92f1ca","type":"ColumnDataSource"},"glyph":{"id":"dfd7789a-7064-469a-aed1-0f49e3bb6fb7","type":"Line"},"hover_glyph":null,"nonselection_glyph":{"id":"2be1d120-5724-460f-b0f0-7231d7e46726","type":"Line"},"selection_glyph":null},"id":"baee81d6-e664-46ba-b9d3-2e030d7fd672","type":"GlyphRenderer"},{"attributes":{},"id":"06fb8ff2-d611-405b-be38-e171cbf46d8c","type":"BasicTicker"},{"attributes":{"days":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]},"id":"413be9a6-f974-4bb0-a547-fd109820f4ac","type":"DaysTicker"},{"attributes":{"active_drag":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"id":"ad71abf4-7812-47df-974c-bdf963267996","type":"PanTool"},{"id":"4651a289-09bc-4249-ab43-dcf8d0073edf","type":"WheelZoomTool"},{"id":"a630d9b3-35fa-4631-8971-6ffe63f5f285","type":"BoxZoomTool"},{"id":"2d21e9c6-d52c-4788-a4c1-96bb295c2421","type":"ResetTool"},{"id":"94e83390-ed62-4543-81c3-177bb7404bd0","type":"SaveTool"},{"id":"7d10de35-f889-4af5-a737-7b7e18177842","type":"BoxSelectTool"}]},"id":"9af07266-a889-4c6c-8e88-7a1f31d740f0","type":"Toolbar"},{"attributes":{"callback":null},"id":"4ffcdd86-22b4-4b7a-be07-ac70c84c27db","type":"DataRange1d"},{"attributes":{"days":[1,8,15,22]},"id":"f1182eaa-c07f-4f7a-b6e2-e2e003b26503","type":"DaysTicker"},{"attributes":{"plot":null,"text":"Data for GOOG from Quandle WIKI set"},"id":"ed0051be-e237-4b47-8663-afb3b1f1ce7c","type":"Title"},{"attributes":{"base":24,"mantissas":[1,2,4,6,8,12],"max_interval":43200000.0,"min_interval":3600000.0,"num_minor_ticks":0},"id":"2cee3978-4144-4aee-9971-b93db0a60f31","type":"AdaptiveTicker"},{"attributes":{"plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"}},"id":"94e83390-ed62-4543-81c3-177bb7404bd0","type":"SaveTool"},{"attributes":{"plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"}},"id":"2d21e9c6-d52c-4788-a4c1-96bb295c2421","type":"ResetTool"},{"attributes":{"callback":null,"column_names":["x","y"],"data":{"x":{"__ndarray__":"AAAAYQ1QdEIAAMDGX1B0QgAAAPhWUXRCAADAXalRdEIAAIDD+1F0QgAAQClOUnRCAAAAj6BSdEIAAEDAl1N0QgAAACbqU3RCAADAizxUdEIAAIDxjlR0QgAAQFfhVHRCAACAiNhVdEIAAEDuKlZ0QgAAAFR9VnRCAADAuc9WdEIAAMBQGVh0QgAAgLZrWHRCAABAHL5YdEIAAACCEFl0QgAAwOdiWXRCAAAAGVpadEIAAMB+rFp0QgAAgOT+WnRCAABASlFbdEIAAACwo1t0QgAAQOGaXHRCAAAAR+1cdEIAAMCsP110QgAAgBKSXXRCAABAeORddEIAAICp2150QgAAQA8uX3RCAAAAdYBfdEIAAMDa0l90QgAAgEAlYHRCAADAcRxhdEIAAIDXbmF0QgAAQD3BYXRCAAAAoxNidEIAAMAIZmJ0QgAAwJ+vY3RCAACABQJkdEIAAEBrVGR0QgAAANGmZHRCAABAAp5ldEIAAABo8GV0QgAAwM1CZnRCAACAM5VmdEIAAECZ52Z0QgAAgMreZ3RCAABAM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kFiEDXo3A9CtGHQFyPwvUo0IdAXI/C9Sh0iECuR+F6FLSIQBSuR+F6iohAFK5H4XrUh0Bcj8L1KJCHQHE9CtejAIdAUrgeheuzh0CkcD0K1+OHQKRwPQrXGYhAuB6F61HEh0CamZmZmQmIQFyPwvUoAohAUrgehevHh0A9CtejcM2HQFK4HoXrAYhAH4XrUbgWiEC4HoXrUbCHQI/C9ShcX4dAAAAAAAB0h0Bcj8L1KNSHQHsUrkfhuIdA7FG4HoUZiECPwvUoXEOIQLgehetRqohAXI/C9SiqiEDNzMzMzOCIQMP1KFyP6IhAzczMzMzuiEBmZmZmZraIQJqZmZmZ0YhAj8L1KFzjiEAUrkfhetSIQK5H4XoUuohA4XoUrkeviEBmZmZmZryIQGZmZmZmiIhAuB6F61F2iEDD9Shcjx6IQNejcD0KkYhAMzMzMzOXiEBcj8L1KNCIQDMzMzMzMYlAMzMzMzM1iUC4HoXrUSaJQOF6FK5HP4lAexSuR+EyiUDXo3A9Cj+JQHsUrkfhJIlAw/UoXI8wiUBmZmZmZhGJQFyPwvUoKIlA","dtype":"float64","shape":[711]}}},"id":"6d6fc44a-63fb-4b3d-95b8-3d219a92f1ca","type":"ColumnDataSource"},{"attributes":{},"id":"93f77166-b47d-4147-8f40-60587534bb6e","type":"ToolEvents"},{"attributes":{"line_color":{"value":"blue"},"x":{"field":"x"},"y":{"field":"y"}},"id":"dfd7789a-7064-469a-aed1-0f49e3bb6fb7","type":"Line"},{"attributes":{"grid_line_alpha":{"value":0},"plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"},"ticker":{"id":"f897d924-3e38-464c-a5af-8eb5d3b68094","type":"DatetimeTicker"}},"id":"aa08aef8-adbe-4ac9-bb30-3276e6833765","type":"Grid"},{"attributes":{"label":{"value":"Adj. Close"},"renderers":[{"id":"baee81d6-e664-46ba-b9d3-2e030d7fd672","type":"GlyphRenderer"}]},"id":"2fd93036-1ef3-4d56-bad7-88fdf9352c21","type":"LegendItem"},{"attributes":{"plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"}},"id":"ad71abf4-7812-47df-974c-bdf963267996","type":"PanTool"},{"attributes":{},"id":"48053516-3d87-4026-986f-48129fc60e01","type":"BasicTickFormatter"},{"attributes":{"months":[0,6]},"id":"36d97b27-7fc5-4095-a5b7-6ec9003c8381","type":"MonthsTicker"},{"attributes":{"axis_label":"Date","formatter":{"id":"751d139b-ceca-4eec-acbd-41e25b434a73","type":"DatetimeTickFormatter"},"plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"},"ticker":{"id":"f897d924-3e38-464c-a5af-8eb5d3b68094","type":"DatetimeTicker"}},"id":"f8b00322-303d-4c46-a577-b48573240aa7","type":"DatetimeAxis"},{"attributes":{"days":[1,15]},"id":"5c4984ed-252e-4eae-a6a2-1cf39a55814a","type":"DaysTicker"},{"attributes":{"months":[0,1,2,3,4,5,6,7,8,9,10,11]},"id":"4d867e4d-d57d-47b0-a9ed-037e2feeb430","type":"MonthsTicker"},{"attributes":{"bottom_units":"screen","fill_alpha":{"value":0.5},"fill_color":{"value":"lightgrey"},"left_units":"screen","level":"overlay","line_alpha":{"value":1.0},"line_color":{"value":"black"},"line_dash":[4,4],"line_width":{"value":2},"plot":null,"render_mode":"css","right_units":"screen","top_units":"screen"},"id":"4311d6d9-1db1-4a28-b427-4f0d3da33a8d","type":"BoxAnnotation"},{"attributes":{"callback":null,"overlay":{"id":"4311d6d9-1db1-4a28-b427-4f0d3da33a8d","type":"BoxAnnotation"},"plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"},"renderers":[{"id":"baee81d6-e664-46ba-b9d3-2e030d7fd672","type":"GlyphRenderer"}]},"id":"7d10de35-f889-4af5-a737-7b7e18177842","type":"BoxSelectTool"},{"attributes":{"days":[1,4,7,10,13,16,19,22,25,28]},"id":"18e0bad7-fd4d-483a-a66d-8326fd4cb8d4","type":"DaysTicker"},{"attributes":{"axis_label":"Price","formatter":{"id":"48053516-3d87-4026-986f-48129fc60e01","type":"BasicTickFormatter"},"plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"},"ticker":{"id":"06fb8ff2-d611-405b-be38-e171cbf46d8c","type":"BasicTicker"}},"id":"77143d5d-525f-4d25-acea-5c424eded496","type":"LinearAxis"},{"attributes":{"months":[0,4,8]},"id":"541618b2-937c-4225-a9e3-c94d0e9cac89","type":"MonthsTicker"},{"attributes":{"plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"}},"id":"4651a289-09bc-4249-ab43-dcf8d0073edf","type":"WheelZoomTool"},{"attributes":{"overlay":{"id":"616ed4ac-d4c5-4010-beff-1589b8b73f52","type":"BoxAnnotation"},"plot":{"id":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f","subtype":"Figure","type":"Plot"}},"id":"a630d9b3-35fa-4631-8971-6ffe63f5f285","type":"BoxZoomTool"}],"root_ids":["8fa14872-25cd-4dec-82ab-b1dd9b8a852f"]},"title":"Bokeh Application","version":"0.12.4"}};
var render_items = [{"docid":"25435e2e-0cb3-47b8-8bf1-32c906b6f420","elementid":"f91b2880-937e-436d-88b0-04c339475f6f","modelid":"8fa14872-25cd-4dec-82ab-b1dd9b8a852f"}];
Bokeh.embed.embed_items(docs_json, render_items);
});
};
if (document.readyState != "loading") fn();
else document.addEventListener("DOMContentLoaded", fn);
})();
</script>
</head>
<body>
<div class=page>
<h1> Generated plot for GOOG </h1>
<h4> Back</h4>
<div class="bk-root">
<div class="bk-plotdiv" id="f91b2880-937e-436d-88b0-04c339475f6f"></div>
</div>
</div>
</body>
</html>
Problem to be the versioning of bokeh. In the html file had 0.12.3, but my requirements.txt had bokeh>=0.12.3, and because of which heroku was using 0.12.4. Changing the requirements.txt file to bokeh==0.12.3 fixed the problem.

django codemirror get code from editor

Below is my code for code editor in template
{% load static %}
<script src="{% static 'codemirror.js' %}"></script>
<link rel="stylesheet" href="{% static 'codemirror.css' %}">
<script src="{% static 'clike.js' %}"></script>
<script>
var myCodeMirror = CodeMirror(document.getElementById('text_area'), {
value: "int main()",
mode: "text/x-c++src",
lineNumbers: true,
indentUnit: 4,
});
</script>
Using div tag
<div id="text_area" name="text_area" style="margin-top: 0px;" ></div>
How do i get the code after submit button from post method?
Note:
I am using CodeMirror library from github
you should be able to get the code with
myCodeMirror.getValue()

Python Flask + AngularJS + DevExtreme

First, I am fairly new to javascript but I know my way around python. I am trying to learn javascript and I may be out of my league with trying this, but that is how you learn right.
Secondly, Flask and AngularJS play well together with a little help. Special thanks goes to shea256 (https://github.com/shea256/angular-flask)
Now, I am able to get the 'test application' up and running fairly easily.
However, I want to add DevExtreme to this stack and I am having some issues.
Here is what I have:
index.html
<!doctype html>
<html lang="en" ng-app="AngularFlask">
<head>
<meta charset="utf-8">
<title>AngularFlask</title>
<link rel="stylesheet" href="/static/css/bootstrap.css">
<link rel="stylesheet" href="/static/css/main.css">
<link rel="stylesheet" type="text/css" href="http://cdn3.devexpress.com/jslib/16.1.5/css/dx.common.css" />
<link rel="stylesheet" type="text/css" href="http://cdn3.devexpress.com/jslib/16.1.5/css/dx.light.css" />
<!--<script src="/static/lib/jquery/jquery.min.js"></script>-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <!--2.7.0-->
<!--<script src="/static/lib/angular/angular.js"></script>
<script src="/static/lib/angular/angular-resource.js"></script>-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-resource.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-route.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-sanitize.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/globalize/0.1.1/globalize.min.js"></script>
<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script>
-->
<script type="text/javascript" src="http://cdn3.devexpress.com/jslib/16.1.5/js/dx.web.js"></script>
<script src="/static/js/app.js"></script>
<script src="/static/js/controllers.js"></script>
<script src="/static/js/services.js"></script>
<script src="/static/lib/bootstrap/bootstrap.min.js"></script>
</head>
<body>
<div id="header" class="header navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
</button>
<a class="brand" href="/">AngularFlask</a>
<div class="nav-collapse collapse">
<ul class="nav pull-right">
<li class="">
Home
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container page">
<div id="content" class="container main" ng-view>
</div>
<hr>
<footer id="footer" class="footer">
<div class="footer-left">
About |
Home
</div>
<div class="footer-right">
<span>© 2013 AngularFlask</span>
</div>
</footer>
</div>
</body>
</html>
controllers.js
function IndexController($scope) {
}
function AboutController($scope) {
}
function PostListController($scope, Post) {
var postsQuery = Post.get({}, function(posts) {
$scope.posts = posts.objects;
});
}
function PostDetailController($scope, $routeParams, Post) {
var postQuery = Post.get({ postId: $routeParams.postId }, function(post) {
$scope.post = post;
});
}
app.js
'use strict';
angular.module('AngularFlask', ['angularFlaskServices', 'dx'])
.config(['$routeProvider', '$locationProvider',
function($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
templateUrl: 'static/partials/landing.html',
controller: IndexController
})
.when('/about', {
templateUrl: 'static/partials/about.html',
controller: AboutController
})
.when('/post', {
templateUrl: 'static/partials/post-list.html',
controller: PostListController
})
.when('/post/:postId', {
templateUrl: '/static/partials/post-detail.html',
controller: PostDetailController
})
/* Create a "/blog" route that takes the user to the same place as "/post" */
.when('/blog', {
templateUrl: 'static/partials/post-list.html',
controller: PostListController
})
.otherwise({
redirectTo: '/'
})
;
$locationProvider.html5Mode(true);
}])
;
With this, when I navigate to localhost:5000, this error is reported
https://docs.angularjs.org/error/$injector/modulerr?p0=AngularFlask&p1=%5B$injector:unpr%5D%20http:%2F%2Ferrors.angularjs.org%2F1.5.7%2F$injector%2Funpr%3Fp0%3D%2524routeProvider%0AO%2F%3C#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:6:412%0Adb%2Fn.$injector%3C#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:43:84%0Ad#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:40:344%0Ae#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:41:78%0Ah%2F%3C.invoke#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:41:163%0Ad#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:39:313%0Ag%2F%3C#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:39:445%0Ar#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:7:353%0Ag#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:39:222%0Adb#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:43:246%0ABc%2Fc#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:20:359%0ABc#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:21:163%0Age#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:19:484%0A#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.7%2Fangular.min.js:315:135%0An.Callbacks%2Fi#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.12.4%2Fjquery.min.js:2:27444%0An.Callbacks%2Fj.fireWith#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.12.4%2Fjquery.min.js:2:28213%0A.ready#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.12.4%2Fjquery.min.js:2:30004%0AK#https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.12.4%2Fjquery.min.js:2:30366%0AO%2F%3C()%20angular.min.js:6g%2F%3C()%20angular.min.js:40r()%20angular.min.js:7g()%20angular.min.js:39db()%20angular.min.js:43Bc%2Fc()%20angular.min.js:20Bc()%20angular.min.js:21ge()%20angular.min.js:19%3Canonymous%3E%20angular.min.js:315n.Callbacks%2Fi()%20jquery.min.js:2n.Callbacks%2Fj.fireWith()%20jquery.min.js:2.ready()%20jquery.min.js:2K()%20jquery.min.js:21%20angular.min.js:6:412
It may be worth mentioning that if I use AngularJS 1.0.7 (included with Angular-Flask) the issue is cleared up until I add my html dev tag
<div dx-button="{
text: 'Generate random value'
}"></div>
then these are the errors:
Error: e.$$postDigest is not a function
Error: t.$root is undefined
Error: a.$watch is not a function
Error: c.$watch is not a function
Error: a.$watch is not a function
Error: t.dxTemplateModel is undefined
So this tells me that DevExpress is missing some functions in AngularJS 1.0.7; However, when using AngularJS 1.2.X Angular-Flask breaks. Is there anyway to get these two to play well together?
DevExtreme supports AngularJS 1.2 - 1.4. Your try to use too old version of AngularJS. Scripts in this repo were updated 3 years ago. But you can easily use another angularjs version. Your flask layout can look like below:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }} - My Flask Application</title>
<link rel="stylesheet" type="text/css" href="/static/content/site.css" />
<link rel="stylesheet" type="text/css" href="http://cdn3.devexpress.com/jslib/16.1.5/css/dx.common.css" />
<link rel="stylesheet" type="text/css" href="http://cdn3.devexpress.com/jslib/16.1.5/css/dx.light.css" />
</head>
<body class="dx-theme-generic-typography" ng-app="myApp">
<div ng-controller="defaultCtrl">
<div dx-button="buttonOptions"></div>
</div>
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.16/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.16/angular-sanitize.js"></script>
<script src="http://cdn3.devexpress.com/jslib/16.1.5/js/dx.all.js"></script>
<script src="/static/scripts/application.js"></script>
</body>
</html>
And the /static/scripts/application.js file:
var myApp = angular.module("myApp", ["dx"]);
myApp.controller("defaultCtrl", function($scope) {
$scope.buttonOptions = {
text: "My button",
onClick: function(){
alert("Hi!");
}
};
});

Categories

Resources