-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from bioinformatics-ua/imp/improve_code_structure
Imp/improve code structure
- Loading branch information
Showing
31 changed files
with
517 additions
and
903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,156 @@ | ||
bower_components/ | ||
node_modules/ | ||
|
||
# Retrieved from https://github.com/github/gitignore/blob/752b7678db497edb377fa982ded0c70035393794/Python.gitignore | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
*.pyc | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# poetry | ||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. | ||
# This is especially recommended for binary packages to ensure reproducibility, and is more | ||
# commonly ignored for libraries. | ||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control | ||
#poetry.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# PyCharm | ||
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can | ||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore | ||
# and can be added to the global gitignore or merged into this file. For a more nuclear | ||
# option (not recommended) you can uncomment the following to ignore the entire idea folder. | ||
#.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Dockerfile | ||
docker-compose.yml | ||
venv | ||
db.sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,12 @@ | ||
FROM debian:jessie | ||
MAINTAINER Matt Bentley <mbentley@mbentley.net> | ||
FROM python:3.10 | ||
|
||
RUN (apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential git python python-dev python-setuptools nginx sqlite3 supervisor) | ||
RUN (easy_install pip &&\ | ||
pip install uwsgi) | ||
WORKDIR /app | ||
|
||
ADD requirements.txt /opt/django/app/requirements.txt | ||
RUN pip install -r /opt/django/app/requirements.txt | ||
ADD . /opt/django/ | ||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt | ||
|
||
RUN (echo "daemon off;" >> /etc/nginx/nginx.conf &&\ | ||
rm /etc/nginx/sites-enabled/default &&\ | ||
ln -s /opt/django/django.conf /etc/nginx/sites-enabled/ &&\ | ||
ln -s /opt/django/supervisord.conf /etc/supervisor/conf.d/) | ||
COPY . . | ||
|
||
RUN chmod +x /opt/django/run.sh | ||
VOLUME ["/opt/django/app"] | ||
EXPOSE 80 | ||
CMD ["/opt/django/run.sh"] | ||
EXPOSE 8000 | ||
|
||
ENTRYPOINT ["gunicorn", "-b 0.0.0.0:8000", "geowebservice.wsgi"] |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
solr: | ||
image: solr:5.5.3 | ||
hostname: solr | ||
ports: | ||
- "8887:8983" | ||
|
||
version: "3" | ||
|
||
services: | ||
solr: | ||
image: solr:5.5.3 | ||
volumes: | ||
- geodata:/opt/solr/server/solr | ||
|
||
geodropdownservice: | ||
image: bioinformaticsua/geodropdownservice | ||
geodropdownservice: | ||
build: | ||
context: . | ||
ports: | ||
- "8886:80" | ||
volumes: | ||
- .:/opt/django/app | ||
links: | ||
- solr:solr | ||
- "8886:8000" | ||
depends_on: | ||
- solr | ||
|
||
volumes: | ||
geodata: |
This file was deleted.
Oops, something went wrong.
30 changes: 10 additions & 20 deletions
30
geowebservice/geodatabase/management/commands/load_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import print_function | ||
import pysolr | ||
|
||
from django.core.management.base import BaseCommand, CommandError | ||
import logging | ||
|
||
import ast | ||
from django.conf import settings | ||
from django.core.management.base import BaseCommand | ||
|
||
from geodatabase.services import ServiceSolr | ||
|
||
import logging | ||
logger = logging.getLogger() | ||
logging.basicConfig(level=logging.DEBUG) | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Closes the specified poll for voting' | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument('all', nargs='+', type=str) | ||
parser.add_argument('countries', nargs='+', type=str) | ||
parser.add_argument('countries', type=str) | ||
parser.add_argument('all', type=str) | ||
|
||
def handle(self, *args, **options): | ||
all_locations = '' | ||
countries_names = '' | ||
try: | ||
all_locations = options['all'][0] | ||
countries_names = options['countries'][0] | ||
except: | ||
all_locations = '/home/leonardo/Área de Trabalho/geonames_files/allCountries.txt' | ||
countries_names = '/home/leonardo/Área de Trabalho/geonames_files/country.csv' | ||
|
||
countries_names = options['countries'] | ||
all_locations = options['all'] | ||
|
||
s = ServiceSolr() | ||
s.load_contry_info(countries_names) | ||
s.load_initial_data(all_locations) | ||
s.load_country_info(countries_names) | ||
s.load_initial_data(all_locations) |
Oops, something went wrong.