This is the Django-based application for registering new attendees to GISMentors workshops and courses.
Django and basic geo-stuff
pip install -r requirements.txt
django-admin startproject gismentors
git clone https://github.com/opengeolabs/gismentors-registration.git registration
Now you have to adjust the settings.py
file
- Add
registration
to$PYTHONPATH
- Add registration apps to
INSTALLED_APPS
- Add
django.contrib.gis
toINSTALLED_APPS
- Adjust database engine for support of spatial models https://docs.djangoproject.com/en/1.11/ref/contrib/gis/tutorial/#configure-settings-py
- If using
spatialite
, useSPATIALITE_LIBRARY_PATH
settings option - Set
TEST_MAIL
,TEST_TITLE
andTEST_KEY
variables
In settings.py
:
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'leaflet',
'registration.apps.RegistrationConfig',
'django.contrib.gis',
'captcha'
]
...
SPATIALITE_LIBRARY_PATH = '/usr/lib/x86_64-linux-gnu/mod_spatialite.so'
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.spatialite',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
...
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static")
]
...
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
TEST_MAIL = 'madlen.testing@gmail.com'
TEST_KEY = '831239ad-3b93-4624-9529-6bc67970f541'
TEST_TITLE = 'Testing'
Do further settings modifications.
python manage.py makemigrations registration
python manage.py migrate
to gismentors/urls.py
add registration.urls
:
from django.conf.urls import url
from django.conf.urls.static import static
from django.conf import settings
from django.urls import include
urlpatterns = [
...
url(r'^courses/', include('registration.urls')),
url(r'^captcha/', include('captcha.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
python manage.py runserver