Project for the UPV to develop an app like BlaBlaCar but only for UPV people.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'develop'

+27 -17
+10 -4
.travis.yml
··· 1 1 # Config file for automatic testing at travis-ci.org 2 + sudo: true 3 + 4 + before_install: 5 + - sudo apt-get update -qq 6 + - sudo apt-get install -qq libsqlite3-0 libspatialite3 7 + - pip install --quiet coveralls 8 + - pip install codecov 9 + 2 10 3 11 language: python 4 12 5 13 python: 6 14 - "3.5" 7 15 8 - before_install: 9 - - pip install --quiet coveralls 10 - - pip install codecov 11 - 16 + env: 17 + - SPATIALITE_LIBRARY_PATH="/usr/lib/libspatialite.so.3" 12 18 13 19 install: 14 20 - pip install -r requirements/test.txt
+1 -1
requirements/base.txt
··· 5 5 django-extensions==1.6.7 6 6 logutils==0.3.3 7 7 django-model-utils==2.5 8 - djangorestframework==3.3.3 8 + djangorestframework==3.5.1 9 9 djangorestframework-gis==0.10.1 10 10 sphinx==1.4.1 11 11 sphinx-rtd-theme==0.1.9
+1 -1
requirements/local.txt
··· 1 1 -r base.txt 2 2 coverage==4.0.3 3 - django-test-plus==1.0.12 3 + django-test-plus==1.0.16 4 4 factory_boy==2.7.0 5 5 django-debug-toolbar==1.4
+1 -1
requirements/test.txt
··· 1 1 -r base.txt 2 2 coverage==4.0.3 3 - django-test-plus==1.0.12 3 + django-test-plus==1.0.16 4 4 factory_boy==2.7.0
+4 -4
upvcarshare/config/settings/base.py
··· 83 83 84 84 # MIDDLEWARE CONFIGURATION 85 85 # ------------------------------------------------------------------------------ 86 - # https://docs.djangoproject.com/en/dev/ref/settings/#middleware-classes 87 - MIDDLEWARE_CLASSES = ( 86 + # See: https://docs.djangoproject.com/en/dev/ref/settings/#middleware-classes 87 + MIDDLEWARE = [ 88 88 'django.middleware.gzip.GZipMiddleware', 89 89 'django.contrib.sessions.middleware.SessionMiddleware', 90 90 'django.middleware.common.CommonMiddleware', ··· 94 94 'django.contrib.messages.middleware.MessageMiddleware', 95 95 'django.middleware.clickjacking.XFrameOptionsMiddleware', 96 96 'core.middleware.TimezoneMiddleware', 97 - ) 97 + ] 98 98 99 99 # EMAIL 100 100 # ------------------------------------------------------------------------------ 101 101 # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend 102 - DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL', default='{} <noreply@example.com>'.format(PROJECT_NAME)) 102 + DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL', default='{} <noreply@{}>'.format(PROJECT_NAME, PROJECT_DOMAIN)) 103 103 EMAIL_SUBJECT_PREFIX = env('DJANGO_EMAIL_SUBJECT_PREFIX', default='[{}] '.format(PROJECT_NAME)) 104 104 SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', default=DEFAULT_FROM_EMAIL) 105 105
+3 -4
upvcarshare/config/settings/production.py
··· 6 6 # ------------------------------------------------------------------------------ 7 7 # Hosts/domain names that are valid for this site 8 8 # See https://docs.djangoproject.com/en/1.6/ref/settings/#allowed-hosts 9 - ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=['example.com']) 9 + ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=[PROJECT_DOMAIN]) 10 10 11 11 # SECRET CONFIGURATION 12 12 # ------------------------------------------------------------------------------ ··· 19 19 # See: https://docs.djangoproject.com/en/dev/ref/settings/#databases 20 20 DATABASES = { 21 21 # Raises ImproperlyConfigured exception if DATABASE_URL not in os.environ 22 - 'default': env.db( 23 - 'DATABASE_URL', default='spatialite://{}'.format(str(APPS_DIR.path('{}.db'.format(PROJECT_NAME.lower())))) 24 - ), 22 + # Sample: oraclegis://USER:PASSWORD@HOST:PORT/NAME 23 + 'default': env.db('DATABASE_URL'), 25 24 } 26 25 DATABASES['default']['ATOMIC_REQUESTS'] = True
+6 -1
upvcarshare/core/middleware.py
··· 11 11 """ 12 12 default_tzname = "Europe/Madrid" 13 13 14 - def process_request(self, request): 14 + def __init__(self, get_response): 15 + self.get_response = get_response 16 + 17 + def __call__(self, request): 15 18 tzname = request.session.get('django_timezone') 16 19 if tzname: 17 20 timezone.activate(pytz.timezone(tzname)) 18 21 else: 19 22 timezone.activate(pytz.timezone(self.default_tzname)) 23 + response = self.get_response(request) 24 + return response
+1 -1
upvcarshare/users/tests/test_api.py
··· 36 36 self.assertEqual(response.status_code, status.HTTP_200_OK) 37 37 user = User.objects.get(pk=self.user.pk) 38 38 self.assertEquals( 39 - "SRID=4326;POINT (-0.3767699999989399 39.46913999999703)", 39 + "SRID=4326;POINT (-0.3767699999989411 39.46913999999702)", 40 40 six.text_type(user.get_default_position_wgs84()) 41 41 ) 42 42 self.assertEquals("foo", user.default_address)