{"id":19056734,"url":"https://github.com/geonode/geonode-project","last_synced_at":"2025-05-16T13:08:09.205Z","repository":{"id":39459352,"uuid":"76271284","full_name":"GeoNode/geonode-project","owner":"GeoNode","description":"A django template project for creating custom GeoNode projects.","archived":false,"fork":false,"pushed_at":"2025-05-08T15:00:42.000Z","size":2247,"stargazers_count":86,"open_issues_count":97,"forks_count":180,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-05-08T15:42:18.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://geonode.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeoNode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-12-12T15:48:59.000Z","updated_at":"2025-05-06T13:12:10.000Z","dependencies_parsed_at":"2023-09-27T16:13:58.097Z","dependency_job_id":"8c2b272b-1542-46c3-a265-1a0c7fe8d5a4","html_url":"https://github.com/GeoNode/geonode-project","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeoNode%2Fgeonode-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeoNode%2Fgeonode-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeoNode%2Fgeonode-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeoNode%2Fgeonode-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeoNode","download_url":"https://codeload.github.com/GeoNode/geonode-project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535829,"owners_count":22087399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T23:51:14.506Z","updated_at":"2025-05-16T13:08:09.185Z","avatar_url":"https://github.com/GeoNode.png","language":"Python","readme":"# {{ project_name|title }}\n\nGeoNode template project. Generates a django project with GeoNode support.\n\n## Table of Contents\n\n-  [Quick Docker Start](#quick-docker-start)\n-  [Developer Workshop](#developer-workshop)\n-  [Create a custom project](#create-a-custom-project)\n-  [Start your server using Docker](#start-your-server-using-docker)\n-  [Run the instance in development mode](#run-the-instance-in-development-mode)\n-  [Run the instance on a public site](#run-the-instance-on-a-public-site)\n-  [Stop the Docker Images](#stop-the-docker-images)\n-  [Backup and Restore from Docker Images](#backup-and-restore-the-docker-images)\n-  [Recommended: Track your changes](#recommended-track-your-changes)\n-  [Hints: Configuring `requirements.txt`](#hints-configuring-requirementstxt)\n\n## Quick Docker Start\n\n  ```bash\n    python3.10 -m venv ~/.venvs/project_name\n    source ~/.venvs/{{ project_name }}/bin/activate\n\n    pip install Django==4.2.9\n\n    mkdir ~/project_name\n\n    GN_VERSION=master # Define the branch or tag you want to generate the project from\n    django-admin startproject --template=https://github.com/GeoNode/geonode-project/archive/refs/heads/$GN_VERSION.zip -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile project_name ~/project_name\n\n    cd ~/project_name\n    python create-envfile.py \n  ```\n\nThe project can also be generated from a local checkout of the goenode-project repository\n\n```bash\n    git clone https://github.com/GeoNode/geonode-project\n    git checkout $GN_VERSION\n    django-admin startproject --template=./geonode-project -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile project_name ~/project_name\n\n  ```\n\n`create-envfile.py` accepts the following arguments:\n\n- `--https`: Enable SSL. It's disabled by default\n- `--env_type`: \n   - When set to `prod` `DEBUG` is disabled and the creation of a valid `SSL` is requested to Letsencrypt's ACME server\n   - When set to `test`  `DEBUG` is disabled and a test `SSL` certificate is generated for local testing\n   - When set to `dev`  `DEBUG` is enabled and no `SSL` certificate is generated\n- `--hostname`: The URL that whill serve GeoNode (`localhost` by default)\n- `--email`: The administrator's email. Notice that a real email and a valid SMPT configurations are required if  `--env_type` is seto to `prod`. Letsencrypt uses to email for issuing the SSL certificate \n- `--geonodepwd`: GeoNode's administrator password. A random value is set if left empty\n- `--geoserverpwd`: GeoNode's administrator password. A random value is set if left empty\n- `--pgpwd`: PostgreSQL's administrator password. A random value is set if left empty\n- `--dbpwd`: GeoNode DB user role's password. A random value is set if left empty\n- `--geodbpwd`: GeoNode data DB user role's password. A random value is set if left empty\n- `--clientid`: Client id of Geoserver's GeoNode Oauth2 client. A random value is set if left empty\n- `--clientsecret`: Client secret of Geoserver's GeoNode Oauth2 client. A random value is set if left empty\n```bash\n  docker compose build\n  docker compose up -d\n```\n\n## Developer Workshop\n\nAvailable at\n\n  ```bash\n    http://geonode.org/dev-workshop\n  ```\n\n## Create a custom project\n\n**NOTE**: *You can call your geonode project whatever you like **except 'geonode'**. Follow 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.*\n\nTo setup your project follow these instructions:\n\n1. Generate the project\n\n    ```bash\n    git clone https://github.com/GeoNode/geonode-project.git -b \u003cyour_branch\u003e\n    source /usr/share/virtualenvwrapper/virtualenvwrapper.sh\n    mkvirtualenv --python=/usr/bin/python3 {{ project_name }}\n    pip install Django==3.2.16\n\n    django-admin startproject --template=./geonode-project -e py,sh,md,rst,json,yml,ini,env,sample,properties -n monitoring-cron -n Dockerfile {{ project_name }}\n\n    cd {{ project_name }}\n    ```\n\n2. Create the .env file\n\n    An `.env` file is requird to run the application. It can be created from the `.env.sample` either manually or with the create-envfile.py script.\n\n    The script accepts several parameters to create the file, in detail:\n\n    - *hostname*: e.g. master.demo.geonode.org, default localhost\n    - *https*: (boolean), default value is False\n    - *email*: Admin email (this is required if https is set to True since a valid email is required by Letsencrypt certbot)\n    - *env_type*: `prod`, `test` or `dev`. It will set the `DEBUG` variable to `False` (`prod`, `test`) or `True` (`dev`)\n    - *geonodepwd*: GeoNode admin password (required inside the .env)\n    - *geoserverpwd*: Geoserver admin password (required inside the .env)\n    - *pgpwd*: PostgreSQL password (required inside the .env)\n    - *dbpwd*: GeoNode DB user password (required inside the .env)\n    - *geodbpwd*: Geodatabase user password (required inside the .env)\n    - *clientid*: Oauth2 client id (required inside the .env)\n    - *clientsecret*: Oauth2 client secret (required inside the .env)\n    - *secret key*: Django secret key (required inside the .env)\n    - *sample_file*: absolute path to a env_sample file used to create the env_file. If not provided, the one inside the GeoNode project is used.\n    - *file*: absolute path to a json file that contains all the above configuration\n\n     **NOTE:**\n    - if the same configuration is passed in the json file and as an argument, the CLI one will overwrite the one in the JSON file\n    - If some value is not provided, a random string is used\n\n      Example USAGE\n\n      ```bash\n      python create-envfile.py -f /opt/core/geonode-project/file.json \\\n        --hostname localhost \\\n        --https \\\n        --email random@email.com \\\n        --geonodepwd gn_password \\\n        --geoserverpwd gs_password \\\n        --pgpwd pg_password \\\n        --dbpwd db_password \\\n        --geodbpwd _db_password \\\n        --clientid 12345 \\\n        --clientsecret abc123 \n      ```\n\n      Example JSON expected:\n\n      ```JSON\n      {\n        \"hostname\": \"value\",\n        \"https\": \"value\",\n        \"email\": \"value\",\n        \"geonodepwd\": \"value\",\n        \"geoserverpwd\": \"value\",\n        \"pgpwd\": \"value\",\n        \"dbpwd\": \"value\",\n        \"geodbpwd\": \"value\",\n        \"clientid\": \"value\",\n        \"clientsecret\": \"value\"\n      } \n      ```\n\n### Start your server\n*Skip this part if you want to run the project using Docker instead* see [Start your server using Docker](#start-your-server-using-docker)\n\n1. Setup the Python Dependencies\n\n    **NOTE**: *Important: modify your `requirements.txt` file, by adding the `GeoNode` branch before continue!*\n\n    (see [Hints: Configuring `requirements.txt`](#hints-configuring-requirementstxt))\n\n    ```bash\n    cd src\n    pip install -r requirements.txt --upgrade\n    pip install -e . --upgrade\n\n    # Install GDAL Utilities for Python\n    pip install pygdal==\"`gdal-config --version`.*\"\n\n    # Dev scripts\n    mv ../.override_dev_env.sample ../.override_dev_env\n    mv manage_dev.sh.sample manage_dev.sh\n    mv paver_dev.sh.sample paver_dev.sh\n\n    source ../.override_dev_env\n\n    # Using the Default Settings\n    sh ./paver_dev.sh reset\n    sh ./paver_dev.sh setup\n    sh ./paver_dev.sh sync\n    sh ./paver_dev.sh start\n    ```\n\n2. Access GeoNode from browser\n\n    **NOTE**: default admin user is ``admin`` (with pw: ``admin``)\n\n    ```bash\n    http://localhost:8000/\n    ```\n\n### Start your server using Docker\n\nYou need Docker 1.12 or higher, get the latest stable official release for your platform.\nOnce you have the project configured run the following command from the root folder of the project.\n\n1. Run `docker-compose` to start it up (get a cup of coffee or tea while you wait)\n\n    ```bash\n    docker-compose build --no-cache\n    docker-compose up -d\n    ```\n\n    ```bash\n    set COMPOSE_CONVERT_WINDOWS_PATHS=1\n    ```\n\n    before running `docker-compose up`\n\n2. Access the site on http://localhost/\n\n## Run the instance in development mode\n\n### Use dedicated docker-compose files while developing\n\n**NOTE**: In this example we are going to keep localhost as the target IP for GeoNode\n\n  ```bash\n  docker-compose -f docker-compose.development.yml -f docker-compose.development.override.yml up\n  ```\n\n## Run the instance on a public site\n\n### Preparation of the image (First time only)\n\n**NOTE**: In this example we are going to publish to the public IP http://123.456.789.111\n\n```bash\nvim .env\n  --\u003e replace localhost with 123.456.789.111 everywhere\n```\n\n### Startup the image\n\n```bash\ndocker-compose up --build -d\n```\n\n### Stop the Docker Images\n\n```bash\ndocker-compose stop\n```\n\n### Fully Wipe-out the Docker Images\n\n**WARNING**: This will wipe out all the repositories created until now.\n\n**NOTE**: The images must be stopped first\n\n```bash\ndocker system prune -a\n```\n\n## Backup and Restore from Docker Images\n\n### Run a Backup\n\n```bash\nSOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/backup.sh $BKP_FOLDER_NAME\n```\n\n- BKP_FOLDER_NAME:\n  Default value = backup_restore\n  Shared Backup Folder name.\n  The scripts assume it is located on \"root\" e.g.: /$BKP_FOLDER_NAME/\n\n- SOURCE_URL:\n  Source Server URL, the one generating the \"backup\" file.\n\n- TARGET_URL:\n  Target Server URL, the one which must be synched.\n\ne.g.:\n\n```bash\ndocker exec -it django4{{project_name}} sh -c 'SOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/backup.sh $BKP_FOLDER_NAME'\n```\n\n### Run a Restore\n\n```bash\nSOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/restore.sh $BKP_FOLDER_NAME\n```\n\n- BKP_FOLDER_NAME:\n  Default value = backup_restore\n  Shared Backup Folder name.\n  The scripts assume it is located on \"root\" e.g.: /$BKP_FOLDER_NAME/\n\n- SOURCE_URL:\n  Source Server URL, the one generating the \"backup\" file.\n\n- TARGET_URL:\n  Target Server URL, the one which must be synched.\n\ne.g.:\n\n```bash\ndocker exec -it django4{{project_name}} sh -c 'SOURCE_URL=$SOURCE_URL TARGET_URL=$TARGET_URL ./{{project_name}}/br/restore.sh $BKP_FOLDER_NAME'\n```\n\n## Recommended: Track your changes\n\nStep 1. Install Git (for Linux, Mac or Windows).\n\nStep 2. Init git locally and do the first commit:\n\n```bash\ngit init\ngit add *\ngit commit -m \"Initial Commit\"\n```\n\nStep 3. Set up a free account on github or bitbucket and make a copy of the repo there.\n\n## Hints: Configuring `requirements.txt`\n\nYou may want to configure your requirements.txt, if you are using additional or custom versions of python packages. For example\n\n```python\nDjango==3.2.16\ngit+git://github.com/\u003cyour organization\u003e/geonode.git@\u003cyour branch\u003e\n```\n\n## Increasing PostgreSQL Max connections\n\nIn case you need to increase the PostgreSQL Max Connections , you can modify\nthe **POSTGRESQL_MAX_CONNECTIONS** variable in **.env** file as below:\n\n```\nPOSTGRESQL_MAX_CONNECTIONS=200\n```\n\nIn this case PostgreSQL will run accepting 200 maximum connections.\n\n## Test project generation and docker-compose build Vagrant usage\n\nTesting with [vagrant](https://www.vagrantup.com/docs) works like this:\nWhat vagrant does:\n\nStarts a vm for test on docker swarm:\n    - configures a GeoNode project from template every time from your working directory (so you can develop directly on geonode-project).\n    - exposes service on localhost port 8888\n    - rebuilds everytime everything with cache [1] to avoid banning from docker hub with no login.\n    - starts, reboots to check if docker services come up correctly after reboot.\n\n```bash\nvagrant plugin install vagrant-reload\n#test things for docker-compose\nvagrant up\n# check services are up upon reboot\nvagrant ssh geonode-compose -c 'docker ps'\n```\n\nTest geonode on [http://localhost:8888/](http://localhost:8888/)\n\nTo clean up things and delete the vagrant box:\n\n```bash\nvagrant destroy -f\n```\n\n## Test project generation and Docker swarm build on vagrant\n\nWhat vagrant does:\n\nStarts a vm for test on docker swarm:\n    - configures a GeoNode project from template every time from your working directory (so you can develop directly on geonode-project).\n    - exposes service on localhost port 8888\n    - rebuilds everytime everything with cache [1] to avoid banning from docker hub with no login.\n    - starts, reboots to check if docker services come up correctly after reboot.\n\nTo test on a docker swarm enable vagrant box:\n\n```bash\nvagrant up\nVAGRANT_VAGRANTFILE=Vagrantfile.stack vagrant up\n# check services are up upon reboot\nVAGRANT_VAGRANTFILE=Vagrantfile.stack vagrant ssh geonode-compose -c 'docker service ls'\n```\n\nTest geonode on [http://localhost:8888/](http://localhost:8888/)\nAgain, to clean up things and delete the vagrant box:\n\n```bash\nVAGRANT_VAGRANTFILE=Vagrantfile.stack vagrant destroy -f\n```\n\nfor direct deveolpment on geonode-project after first `vagrant up` to rebuild after changes to project, you can do `vagrant reload` like this:\n\n```bash\nvagrant up\n```\n\nWhat vagrant does (swarm or comnpose cases):\n\nStarts a vm for test on plain docker service with docker-compose:\n    - configures a GeoNode project from template every time from your working directory (so you can develop directly on geonode-project).\n    - rebuilds everytime everything with cache [1] to avoid banning from docker hub with no login.\n    - starts, reboots.\n\n[1] to achieve `docker-compose build --no-cache` just destroy vagrant boxes `vagrant destroy -f`\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeonode%2Fgeonode-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeonode%2Fgeonode-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeonode%2Fgeonode-project/lists"}