Skip to main content

Geospatial region support for Rescape projects

Project description

===== Rescape-Region

A Django app to support limiting users by geographic region

Quick start

  1. Add "region-app" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [ ... 'rescape-region', ]

  2. Include the polls URLconf in your project urls.py like this::

    path('rescape-region/', include('regional.urls')),

  3. Run python manage.py migrate to create the rescape-region models.

Installation

Create a virtual environment using

mkdir ~/.virtualenvs
python3 -m venv ~/.virtualenvs/rescape-region
Activate it
source ~/.virtualenvs/rescape-region/bin/activate

Install requirements

Install requirements with latest versions

pur -r requirements.txt && $VIRTUAL_ENV/bin/pip install --no-cache-dir  --upgrade -r requirements.txt

Add the following to the bottom $VIRTUAL_ENV/bin/activate to setup the PYTHONPATH. Replace the path with your code directory

export RESCAPE_REGION_BASE_DIR=/Users/andy/code/rescape-graphene
export RESCAPE_REGION_PROJECT_DIR=$RESCAPE_REGION_BASE_DIR/urbinsight
export PYTHONPATH=.:$RESCAPE_REGION_BASE_DIR:$RESCAPE_REGION_PROJECT_DIR

Build

Update the version in setup.py Run to generate build: Update the version with bumpversion, which can't seem to look it up itself but updates setup.py

git commit . -m "Version update" && git push
bumpversion --current-version {look in setup.py} patch setup.py
python3 setup.py clean sdist bdist_wheel

To distribute to pypi site: Upload package:

twine upload dist/*

All at once:

git commit . -m "Version update" && git push && bumpversion --current-version {look in setup.py} patch setup.py && python3 setup.py clean sdist bdist_wheel && twine upload dist/*
# Without commit
bumpversion --current-version {look in setup.py} patch setup.py && python3 setup.py clean sdist bdist_wheel && twine upload dist/*

For setup of testpypi see ~/.pypirc or create one according to the testpypi docs: e.g.: [distutils] index-servers= pypi testpypi

[testpypi] repository: https://test.pypi.org/legacy/ username: your username for pypi.org

Running tests

Create a postgres database rescape_region

Login to psql:

CREATE DATABASE rescape_region; CREATE USER test_user WITH PASSWORD 'test'; GRANT ALL PRIVILEGES ON DATABASE rescape_region to test_user;

Give Superuser permission to create test databasees

ALTER ROLE test_user SUPERUSER;

Migrate the database

./manage migrate

Create a Django user test with pw testpass

./manage.py createsuperuser

or echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('test', 'test@nowhere.man', 'testpass')" | ./manage.py shell

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rescape-region-0.0.37.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rescape_region-0.0.37-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file rescape-region-0.0.37.tar.gz.

File metadata

  • Download URL: rescape-region-0.0.37.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for rescape-region-0.0.37.tar.gz
Algorithm Hash digest
SHA256 7514904aab44907a0ea6737b2b24228e4a55a0727fec182add997243d8d4e7c3
MD5 0b9144bc2925a9fd97da22f3837807b4
BLAKE2b-256 29c5e586c6c243f531a715981c421573c80c280a54407691c764d797844cfff9

See more details on using hashes here.

File details

Details for the file rescape_region-0.0.37-py3-none-any.whl.

File metadata

  • Download URL: rescape_region-0.0.37-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for rescape_region-0.0.37-py3-none-any.whl
Algorithm Hash digest
SHA256 e3c0e7437dcba7811f382ee7c69f9c5a6523f31a7050868f032725bc1025d1b4
MD5 d7131e86d824e02ad9731852fa0e165e
BLAKE2b-256 af16c891e2de0951644e0ceb9e4c6166aacedf8dd828c52ea427d27dadcb9c41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page