Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
868c404f
Commit
868c404f
authored
Feb 08, 2019
by
Irving David
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Añadido archivo de configuración para leer los paths de geosentinel y NAS
parent
56ac094a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
8 deletions
+33
-8
views.py
catalog/views.py
+23
-8
config.json
config/config.json
+10
-0
No files found.
catalog/views.py
View file @
868c404f
...
...
@@ -13,16 +13,31 @@ from django.core import management
#from collections import OrderedDict
import
requests
,
json
,
unicodedata
,
sys
,
base64
import
os
import
sys
sys
.
path
.
append
(
'/home/luis/django-apps/Geosentinel'
)
from
geosentinel
import
APISentinel
,
polygonToBox
sentinel
=
APISentinel
.
APISentinel
(
'emmhp'
,
'geoemm29'
)
################################################################################
# PONER EL NOMBRE DE SU MAQUINA #
################################################################################
NAS_PATH
=
'/home/ulises/NAS/'
###########3 lee archivo de configuración ################
dirname
=
os
.
path
.
dirname
(
__file__
)
configfile
=
os
.
path
.
join
(
dirname
,
'../config/config.json'
)
with
open
(
configfile
,
'r'
)
as
f
:
config
=
json
.
load
(
f
)
print
(
config
[
'PATHS'
][
'PATH_GEOSENTINEL'
])
print
(
config
[
'PATHS'
][
'PATH_NAS'
])
print
(
config
[
'API_SENTINEL'
][
'SENTINEL_USER'
])
print
(
config
[
'API_SENTINEL'
][
'SENTINEL_PASS'
])
NAS_PATH
=
config
[
'PATHS'
][
'PATH_NAS'
]
SENTINEL_PATH
=
config
[
'PATHS'
][
'PATH_GEOSENTINEL'
]
API_SENTINEL_USER
=
config
[
'API_SENTINEL'
][
'SENTINEL_USER'
]
API_SENTINEL_PATH
=
config
[
'API_SENTINEL'
][
'SENTINEL_PASS'
]
###########################################################
sys
.
path
.
append
(
SENTINEL_PATH
)
sentinel
=
APISentinel
.
APISentinel
(
API_SENTINEL_USER
,
API_SENTINEL_PATH
)
# Create your views here.
...
...
@@ -537,4 +552,4 @@ def showCart(request):
#-------------------------------------
def
Pay
(
request
):
Purchase
.
objects
.
filter
(
user_id
=
request
.
user
.
id
,
purchased
=
0
)
.
update
(
purchased
=
True
)
return
redirect
(
'../../reports'
)
\ No newline at end of file
return
redirect
(
'../../reports'
)
config/config.json
0 → 100644
View file @
868c404f
{
"PATHS"
:
{
"PATH_GEOSENTINEL"
:
"/home/david/centroGEO/repsat/Geosentinel"
,
"PATH_NAS"
:
"/home/david/NAS/"
},
"API_SENTINEL"
:
{
"SENTINEL_USER"
:
"emmhp"
,
"SENTINEL_PASS"
:
"geoemm29"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment