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'

+87 -4
+35 -3
README.rst
··· 3 3 4 4 Made with Python 3 and Django with :heart:. 5 5 6 - Install Spatialite 7 - ------------------ 6 + Install Spatialite (macOS) 7 + -------------------------- 8 8 9 - Install SpatiaLite with brew on Mac OS X:: 9 + Install SpatiaLite with brew on macOS:: 10 10 11 11 brew update 12 12 brew install spatialite-tools 13 13 brew install gdal 14 14 15 + Install Oracle client (macOS) 16 + ----------------------------- 17 + 18 + Download from `Oracle <http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html>`_ 19 + 20 + - instantclient-basic-macos.x64-12.1.0.2.0.zip 21 + - instantclient-sdk-macos.x64-12.1.0.2.0.zip 22 + 23 + Create a directory ``/usr/local/lib/oracle``:: 24 + 25 + export ORACLE_HOME=/usr/local/lib/oracle 26 + export VERSION=12.1.0.2.0 27 + export ARCH=x86_64 28 + 29 + mkdir -p $ORACLE_HOME 30 + 31 + Unpack both files to that directory, and create symlinks:: 32 + 33 + cd $ORACLE_HOME 34 + tar -xzf instantclient-basic-12.1.0.2.0-macosx-x64.zip 35 + tar -xzf instantclient-sdk-12.1.0.2.0-macosx-x64.zip 36 + mv instantclient_12_1/* $ORACLE_HOME 37 + rmdir instantclient_12_1 38 + 39 + cd /usr/local/lib/ 40 + ln -s $ORACLE_HOME/libclntsh.dylib.12.1 libclntsh.dylib.12.1 41 + ln -s $ORACLE_HOME/libocci.dylib.12.1 libocci.dylib.12.1 42 + ln -s $ORACLE_HOME/libnnz12.dylib libnnz12.dylib 43 + 44 + Install ``cx_Oracle`` from PIP:: 45 + 46 + env ARCHFLAGS="-arch $ARCH" pip install cx_Oracle 15 47 16 48 Static files 17 49 ------------
+1
requirements/base.txt
··· 12 12 sphinxcontrib-httpdomain==1.4.0 13 13 Pillow==3.2.0 14 14 django-recurrence==1.4.0 15 + django-allauth==0.28.0
+26 -1
upvcarshare/config/settings/base.py
··· 6 6 from django.core.urlresolvers import reverse_lazy 7 7 8 8 env = environ.Env() 9 + env.DB_SCHEMES.update({ 10 + 'oracle': 'django.db.backends.oracle', 11 + 'oraclegis': 'django.contrib.gis.db.backends.oracle', 12 + }) # Add support for Oracle and Oracle GIS to Django Environ 9 13 10 14 # PATH CONFIGURATION 11 15 # ------------------------------------------------------------------------------ ··· 159 163 'rest_framework_gis', 160 164 'rest_framework.authtoken', 161 165 'recurrence', 166 + 'allauth', 167 + 'allauth.account', 168 + 'allauth.socialaccount', 169 + 'allauth.socialaccount.providers.openid', 162 170 ) 163 171 164 172 PROJECT_APPS = ( ··· 215 223 ACCOUNT_AUTHENTICATION_METHOD = 'username' 216 224 ACCOUNT_EMAIL_REQUIRED = True 217 225 ACCOUNT_EMAIL_VERIFICATION = 'mandatory' 226 + ACCOUNT_ADAPTER = 'users.adapter.AccountAdapter' 218 227 219 228 # Custom user app defaults 220 229 # Select the correct user model 221 230 AUTH_USER_MODEL = 'users.User' 222 - LOGIN_REDIRECT_URL = 'users:redirect' 231 + LOGIN_REDIRECT_URL = reverse_lazy('home') 223 232 LOGIN_URL = reverse_lazy('users:sign-in') 224 233 225 234 # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators ··· 240 249 241 250 AUTHENTICATION_BACKENDS = ( 242 251 'django.contrib.auth.backends.ModelBackend', 252 + 'allauth.account.auth_backends.AuthenticationBackend', 243 253 ) 244 254 255 + SOCIALACCOUNT_PROVIDERS = { 256 + 'openid': { 257 + 'SERVERS': [ 258 + { 259 + "id": "upv", 260 + "name": "upv", 261 + "openid_url": "https://yo.rediris.es/soy/@upv.es" 262 + } 263 + ] 264 + } 265 + } 266 + 267 + 245 268 # TESTING CONFIGURATION 246 269 # ------------------------------------------------------------------------------ 247 270 TEST_RUNNER = 'django.test.runner.DiscoverRunner' ··· 333 356 # GOOGLE MAPS 334 357 # ------------------------------------------------------------------------------ 335 358 GOOGLE_MAPS_API_KEY = env('GOOGLE_MAPS_API_KEY', default="AIzaSyAUuXiJ-kthJMHdXerksxYbqIbrRFrVfG4") 359 + 360 +
+1
upvcarshare/config/settings/local.py
··· 21 21 'DATABASE_URL', default='spatialite:///{}'.format(str(ROOT_DIR.path('{}.db'.format(PROJECT_NAME.lower())))) 22 22 ), 23 23 } 24 + DATABASES['default']['PORT'] = str(DATABASES['default']['PORT']) # Fix a problem with Oracle connector 24 25 DATABASES['default']['ATOMIC_REQUESTS'] = True 25 26 SPATIALITE_LIBRARY_PATH = env('SPATIALITE_LIBRARY_PATH', default='/usr/local/lib/mod_spatialite.dylib') 26 27
+1
upvcarshare/config/settings/production.py
··· 22 22 # Sample: oraclegis://USER:PASSWORD@HOST:PORT/NAME 23 23 'default': env.db('DATABASE_URL'), 24 24 } 25 + DATABASES['default']['PORT'] = str(DATABASES['default']['PORT']) # Fix a problem with Oracle connector 25 26 DATABASES['default']['ATOMIC_REQUESTS'] = True
+8
upvcarshare/config/urls.py
··· 24 24 url(r'^partials/(?P<name>.+)\.html', PartialsTemplateView.as_view(), name="partials-template"), 25 25 ] 26 26 27 + # OpenID URLs 28 + urlpatterns += [ 29 + url(r"^accounts/signup/$", default_views.page_not_found, kwargs={'exception': Exception('Page not Found')}), 30 + url(r"^accounts/login/$", default_views.page_not_found, kwargs={'exception': Exception('Page not Found')}), 31 + url(r"^accounts/logout/$", default_views.page_not_found, kwargs={'exception': Exception('Page not Found')}), 32 + url(r'^accounts/', include('allauth.urls')), 33 + ] 34 + 27 35 # Admin URLs 28 36 admin.site.site_header = _('UPV Car Share Admin') 29 37 urlpatterns += [
+6
upvcarshare/templates/users/sign_in.html
··· 1 1 {% extends "header.html" %} 2 2 {% load i18n %} 3 + {% load socialaccount %} 3 4 4 5 {% block section_title %} 5 6 <div class="row"> ··· 30 31 </div> 31 32 </div> 32 33 </form> 34 + 35 + <a href="{% provider_login_url "openid" openid="https://yo.rediris.es/soy/@upv.es" next=next %}" class="btn btn-primary"> 36 + {% trans "Acceso con credenciales UPV" %} 37 + </a> 38 + 33 39 </div> 34 40 </div> 35 41 {% endblock content %}
+9
upvcarshare/users/adapter.py
··· 1 + # -*- coding: utf-8 -*- 2 + from __future__ import unicode_literals, print_function, division 3 + 4 + from allauth.account.adapter import DefaultAccountAdapter 5 + 6 + 7 + class AccountAdapter(DefaultAccountAdapter): 8 + pass 9 +