Skip to content

Commit 9a642c1

Browse files
author
YasserDbeis
committed
fixes
1 parent 47256c0 commit 9a642c1

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

maps/templates/maps/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ <h1 style="text-align: center; font-size: 45px; color: #6B6B6B; margin: 2%;">Ded
182182

183183
// console.log(images);
184184
// console.log(images[0].link);
185-
for(i = 1; i < 20; i++) {
185+
for(i = 1; i < images.length; i++) {
186186
console.log(images[i].link);
187187
var elemAdd = document.createElement("DIV");
188188
var elemImg = document.createElement("IMG");
@@ -341,7 +341,7 @@ <h1 style="text-align: center; font-size: 45px; color: #6B6B6B; margin: 2%;">Ded
341341
while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {
342342
coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;
343343
}
344-
var randArticle = Math.floor(Math.random() * 20);
344+
var randArticle = Math.floor(Math.random() * linksDict[state].length);
345345
var str;
346346
if(linksDict[state][randArticle]) {
347347
str = linksDict[state][randArticle].headline;

maps/views.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,9 @@
1818
import os, sys
1919
from gnews import GNews
2020

21-
2221
# sys.path.insert(1, '/path/to/application/app/folder')
2322

2423
sys.path.append(os.path.realpath('.'))
25-
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
26-
27-
from .keys import NEWSAPI_KEY
28-
from .keys import FLICKRAPI_KEY
29-
from .keys import FLICKRAPI_SECRET
30-
from .keys import MAPBOX_KEY
31-
32-
MAPBOX_KEY = json.dumps(MAPBOX_KEY)
33-
34-
newsapi = NewsApiClient(api_key=NEWSAPI_KEY)
35-
flickr_api.set_keys(api_key = FLICKRAPI_KEY, api_secret = FLICKRAPI_SECRET)
3624

3725
# Create your views here.
3826

0 commit comments

Comments
 (0)