Git Product home page Git Product logo

cartoview-project's Introduction

{{ project_name|title }}

GeoNode template project. Generates a django project with GeoNode support.

Table of Contents

Developer Workshop

Available at

  http://geonode.org/dev-workshop

Create a custom project

NOTE: You can call your geonode project whatever you like following the naming conventions for python packages (generally lower case with underscores (_). In the examples below, replace {{ project_name }} with whatever you would like to name your project.

Using a Python virtual environment

NOTE: Skip this part if you want to run the project using Docker instead

(see Start your server using Docker)

To setup your project using a local python virtual environment, follow these instructions:

  1. Prepare the Environment

    git clone https://github.com/GeoNode/geonode-project.git -b <your_branch>
    source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
    mkvirtualenv --python=/usr/bin/python3 {{ project_name }}
    pip install Django==2.2.12
    
    django-admin startproject --template=./geonode-project -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile {{ project_name }}
    
    cd {{ project_name }}
  2. Setup the Python Dependencies

    NOTE: Important: modify your requirements.txt file, by adding the GeoNode branch before continue!

    (see Hints: Configuring requirements.txt)

    pip install -r requirements.txt --upgrade
    pip install -e . --upgrade
    
    # Install GDAL Utilities for Python
    pip install pygdal=="`gdal-config --version`.*"
    
    # Dev scripts
    mv .override_dev_env.sample .override_dev_env
    mv manage_dev.sh.sample manage_dev.sh
    mv paver_dev.sh.sample paver_dev.sh
    
    # Using the Default Settings
    ./paver_dev.sh reset
    ./paver_dev.sh setup
    ./paver_dev.sh sync
    ./paver_dev.sh start
  3. Access GeoNode from browser

    NOTE: default admin user is admin (with pw: admin)

    http://localhost:8000/

Start your server using Docker

You need Docker 1.12 or higher, get the latest stable official release for your platform.

  1. Prepare the Environment

    git clone https://github.com/GeoNode/geonode-project.git -b <your_branch>
    source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
    mkvirtualenv --python=/usr/bin/python3 {{ project_name }}
    pip install Django==2.2.15
    
    django-admin startproject --template=./geonode-project -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile {{ project_name }}
    
    cd {{ project_name }}
  2. Run docker-compose to start it up (get a cup of coffee or tea while you wait)

    docker-compose build --no-cache
    docker-compose up -d
    set COMPOSE_CONVERT_WINDOWS_PATHS=1

    before running docker-compose up

  3. Access the site on http://localhost/

Run the instance in development mode

Use dedicated docker-compose files while developing

NOTE: In this example we are going to keep localhost as the target IP for GeoNode

docker-compose -f docker-compose.development.yml -f docker-compose.development.override.yml up

Run the instance on a public site

Preparation of the image (First time only)

NOTE: In this example we are going to publish to the public IP http://123.456.789.111

vim .env
  --> replace localhost with 123.456.789.111 everywhere

Startup the image

docker-compose up --build -d

Stop the Docker Images

docker-compose stop

Fully Wipe-out the Docker Images

WARNING: This will wipe out all the repositories created until now.

NOTE: The images must be stopped first

docker system prune -a

Backup and Restore from Docker Images

Run a Backup

SOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/backup.sh $BKP_FOLDER_NAME
  • BKP_FOLDER_NAME: Default value = backup_restore Shared Backup Folder name. The scripts assume it is located on "root" e.g.: /$BKP_FOLDER_NAME/

  • SOURCE_URL: Source Server URL, the one generating the "backup" file.

  • TARGET_URL: Target Server URL, the one which must be synched.

e.g.:

docker exec -it django4{{project_name}} sh -c 'SOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/backup.sh $BKP_FOLDER_NAME'

Run a Restore

SOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/restore.sh $BKP_FOLDER_NAME
  • BKP_FOLDER_NAME: Default value = backup_restore Shared Backup Folder name. The scripts assume it is located on "root" e.g.: /$BKP_FOLDER_NAME/

  • SOURCE_URL: Source Server URL, the one generating the "backup" file.

  • TARGET_URL: Target Server URL, the one which must be synched.

e.g.:

docker exec -it django4{{project_name}} sh -c 'SOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/restore.sh $BKP_FOLDER_NAME'

Recommended: Track your changes

Step 1. Install Git (for Linux, Mac or Windows).

Step 2. Init git locally and do the first commit:

git init
git add *
git commit -m "Initial Commit"

Step 3. Set up a free account on github or bitbucket and make a copy of the repo there.

Hints: Configuring requirements.txt

You may want to configure your requirements.txt, if you are using additional or custom versions of python packages. For example

Django==2.2.12
git+git://github.com/<your organization>/geonode.git@<your branch>

cartoview-project's People

Contributors

abulojoshua1 avatar afabiani avatar ahmednoureldeen avatar alex avatar bieganowski avatar brianl9995 avatar cezio avatar dependabot-preview[bot] avatar frafra avatar francbartoli avatar giohappy avatar ingenieroariel avatar jj0hns0n avatar kalxas avatar lpasquali avatar mdsnor avatar pjdufour avatar ppasq avatar simod avatar t-book avatar waybarrios avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.