Getting Started¶
Requirements¶
- Python 2.7, Python 3.5+
- Django 1.7, 1.8
clover
0.2.0 (https://github.com/consbio/clover)numpy
(http://www.numpy.org)django-tastypie
0.13.x (https://django-tastypie.readthedocs.io)djangorestframework
(http://www.django-rest-framework.org)netCDF4-python
(http://unidata.github.io/netcdf4-python)pyproj
(https://github.com/jswhit/pyproj)fiona
(http://toblerity.org/fiona/README.html)shapely
(https://pypi.python.org/pypi/Shapely)ply
(https://pypi.python.org/pypi/ply)celery
(http://www.celeryproject.org)Pillow
(https://pypi.python.org/pypi/Pillow)six
Installation¶
Once the dependencies are installed, you can install ncdjango with:
$ pip install git+https://github.com/consbio/ncdjango.git
Note
ncdjango should automatically install required dependencies, but certain dependencies such as clover (which depends on rasterio, which depends on GDAL) may not automatically install well, so it’s recommended to install the dependencies separately.
Setup¶
- Create a new Django project if you don’t already have one.
- Add
ncdjango
,tastypie
, andrest_framework
to yourINSTALLED_APPS
setting.- Modify your
settings.py
to specify the root location of your datasets:NC_SERVICE_DATA_ROOT = '/var/ncdjango/services/'
- Modify your
settings.py
to specify the location to store temporary files (uploads):NC_TEMPORARY_FILE_LOCATION = '/tmp'
- See Settings for additional options.
- Add the following to your project’s
urlpatterns
:url(r'^', include('ncdjango.urls'))Note
You can modify this URL pattern if you want all the ncdjango and web interface URLs grouped under a common path.
Publishing Services¶
Todo