Permalink
Browse files

begin integrating practicum apps into geocamShare

  • Loading branch information...
1 parent f188cf5 commit 2ff2bd1294a359f89423e158ec7c7db8be78c7ff @trey0 trey0 committed Apr 5, 2012
Showing with 96 additions and 40 deletions.
  1. +3 −0 .gitmodules
  2. +1 −0 apps/geocamCover
  3. +23 −24 siteSettings.py
  4. +1 −1 submodules/geocamCoreWeb
  5. +1 −0 submodules/geocamCoverWeb
  6. +1 −1 submodules/geocamMemoWeb
  7. +1 −1 submodules/geocamUtilWeb
  8. +65 −13 urls.py
View
@@ -21,3 +21,6 @@
[submodule "submodules/geocamMemoWeb"]
path = submodules/geocamMemoWeb
url = git://github.com/geocam/geocamMemoWeb.git
+[submodule "submodules/geocamCoverWeb"]
+ path = submodules/geocamCoverWeb
+ url = git://github.com/geocam/geocamCoverWeb.git
View
View
@@ -18,6 +18,7 @@
# importing baseSettings
DEFAULT_CHECKOUT_DIR = getSiteDir()
CHECKOUT_DIR = os.environ.get('CHECKOUT_DIR', DEFAULT_CHECKOUT_DIR)
+PROJ_ROOT = os.path.abspath(os.path.dirname(__file__))
SCRIPT_NAME = os.environ['DJANGO_SCRIPT_NAME']
if not SCRIPT_NAME.endswith('/'):
@@ -74,11 +75,6 @@
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = SCRIPT_NAME + 'media/'
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash. Must not be the same as MEDIA_URL!
-# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = SCRIPT_NAME + 'media/admin/'
-
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
@@ -113,23 +109,35 @@
)
INSTALLED_APPS = (
- 'geocamUtil',
- 'geocamFolder',
+ 'geocamAware',
+ 'geocamLens',
+ 'geocamTrack',
+ 'geocamMemo',
+ 'geocamTalk',
+ 'geocamCover',
+
'geocamCore',
+ 'geocamFolder',
+ 'geocamUtil',
+
+ 'tagging',
+ 'taggit',
+ 'django_digest',
+
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.comments',
- 'tagging',
- 'django_digest',
)
AUTH_PROFILE_MODULE = 'geocamCore.UserProfile'
LOGIN_URL = SCRIPT_NAME + 'accounts/login/'
+LOGOUT_URL = SCRIPT_NAME + 'accounts/logout/'
+LOGIN_DEFAULT_NEXT_URL = SCRIPT_NAME + 'geocamAware/'
CACHE_BACKEND = 'locmem://?timeout=30'
@@ -157,11 +165,6 @@
# 'HIDE_DJANGO_SQL': False,
#}
-######################################################################
-# The remaining settings are ones we define that are generically
-# useful across different geocam apps. See geocamCore/defaultSettings
-# for stuff that is more specific to geocamCore.
-
USE_STATIC_SERVE = USING_DJANGO_DEV_SERVER
GEOCAM_UTIL_SECURITY_ENABLED = not USING_DJANGO_DEV_SERVER
@@ -172,6 +175,10 @@
TMP_DIR = '%stmp/' % DATA_DIR
TMP_URL = '%stmp/' % DATA_URL
+STATIC_ROOT = os.path.join(PROJ_ROOT, 'build', 'static', '')
+STATIC_URL = SCRIPT_NAME + 'static/'
+ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
+
LOGIN_REDIRECT_URL = SCRIPT_NAME + 'geocamAware/'
USING_DJANGO_DEV_SERVER = ('runserver' in sys.argv)
@@ -181,16 +188,6 @@
)
MANAGERS = ADMINS
-# django settings overrides for geocamDisasterStyle
-INSTALLED_APPS = INSTALLED_APPS + (
- 'geocamAware',
- 'geocamLens',
- 'geocamTrack',
-
- 'geocamMemo',
- 'geocamTalk',
- )
-
# GEOCAM_LENS_VIEW_MODULE = 'xgds_k10.ViewK10'
ROOT_URLCONF = 'geocamShare.urls'
@@ -200,3 +197,5 @@
GEOCAM_AWARE_USE_MARKER_CLUSTERING = True
GEOCAM_AWARE_USE_LAYER_MANAGER = True
+
+GEOCAM_UTIL_INSTALLER_USE_SYMLINKS = True
Submodule geocamCoverWeb added at ff20bd
View
78 urls.py
@@ -6,24 +6,76 @@
from django.conf.urls.defaults import * # pylint: disable=W0401
from django.conf import settings
+from django.contrib import admin
-from geocamCore.baseUrls import urlpatterns as basePatterns
-from geocamCore.urls import urlpatterns as corePatterns
from geocamLens.ViewLensSimple import viewSingleton as lensViews
+from geocamCore import views
-urlpatterns = (basePatterns
- + corePatterns
- + patterns(
+urlpatterns = patterns(
'',
- (r'^geocamAware/', include('geocamAware.urls')),
- (r'^geocamLens/', include('geocamLens.urls')),
- (r'^geocamTrack/', include('geocamTrack.urls')),
- (r'^geocamMemo/', include('geocamMemo.urls')),
- (r'^geocamTalk/', include('geocamTalk.urls')),
+ url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
+ url(r'^admin/', include(admin.site.urls)),
+ url(r'^comments/', include('django.contrib.comments.urls')),
+
+ url(r'^$', views.welcome),
+
+ url(r'^accounts/register/$', views.register,
+ {'loginRequired': False},
+ name='register'),
+
+ # accounts
+ url(r'^accounts/login/$', views.welcome, # 'django.contrib.auth.views.login',
+ {'loginRequired': False, # avoid redirect loop
+ 'securityTags': ['loginRelated']
+ },
+ name='geocamCore_login'),
+ url(r'^accounts/logout/$', 'django.contrib.auth.views.logout',
+ # show logout page instead of redirecting to log in again
+ {'loginRequired': False,
+ 'securityTags': ['loginRelated']
+ }),
+
+ url(r'^m/checkLogin/$', views.checkLogin,
+ {'challenge': 'basic',
+ 'securityTags': ['dumbClient']},
+ name='geocamCore_checkLogin'),
+
+ url(r'^m/register/$', views.register,
+ {'loginRequired': False,
+ 'securityTags': ['loginRelated'],
+ 'useJson': True},
+ name='geocamCore_register'),
+
+ url(r'^geocamAware/', include('geocamAware.urls')),
+ url(r'^geocamLens/', include('geocamLens.urls')),
+ url(r'^geocamTrack/', include('geocamTrack.urls')),
+ url(r'^geocamMemo/', include('geocamMemo.urls')),
+ url(r'^geocamTalk/', include('geocamTalk.urls')),
# normally we would put this url in the geocamLens namespace, but
# the current version of GeoCam Mobile expects it at the top level
- (r'^upload-m/$', lensViews.uploadImageAuth,
- {'challenge': 'basic'}),
-))
+ url(r'^upload-m/$', lensViews.uploadImageAuth,
+ {'challenge': 'basic'}),
+)
+
+if settings.USE_STATIC_SERVE:
+ urlpatterns += patterns(
+ '',
+
+ url(r'^media/(?P<path>.*)$',
+ 'geocamUtil.views.staticServeWithExpires.staticServeWithExpires',
+ dict(document_root=settings.MEDIA_ROOT,
+ show_indexes=True,
+ readOnly=True)),
+
+ url(r'^data/(?P<path>.*)$',
+ 'geocamUtil.views.staticServeWithExpires.staticServeWithExpires',
+ {'document_root': settings.DATA_DIR,
+ 'show_indexes': True,
+ 'readOnly': True}),
+
+ url(r'^favicon.ico$', 'django.views.generic.simple.redirect_to',
+ {'url': settings.MEDIA_URL + 'geocamCore/icons/camera.ico',
+ 'readOnly': True}),
+ )

0 comments on commit 2ff2bd1

Please sign in to comment.