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.

integrated with openid

+46 -1
+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
+22 -1
upvcarshare/config/settings/base.py
··· 163 163 'rest_framework_gis', 164 164 'rest_framework.authtoken', 165 165 'recurrence', 166 + 'allauth', 167 + 'allauth.account', 168 + 'allauth.socialaccount', 169 + 'allauth.socialaccount.providers.openid', 166 170 ) 167 171 168 172 PROJECT_APPS = ( ··· 219 223 ACCOUNT_AUTHENTICATION_METHOD = 'username' 220 224 ACCOUNT_EMAIL_REQUIRED = True 221 225 ACCOUNT_EMAIL_VERIFICATION = 'mandatory' 226 + ACCOUNT_ADAPTER = 'users.adapter.AccountAdapter' 222 227 223 228 # Custom user app defaults 224 229 # Select the correct user model 225 230 AUTH_USER_MODEL = 'users.User' 226 - LOGIN_REDIRECT_URL = 'users:redirect' 231 + LOGIN_REDIRECT_URL = reverse_lazy('home') 227 232 LOGIN_URL = reverse_lazy('users:sign-in') 228 233 229 234 # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators ··· 244 249 245 250 AUTHENTICATION_BACKENDS = ( 246 251 'django.contrib.auth.backends.ModelBackend', 252 + 'allauth.account.auth_backends.AuthenticationBackend', 247 253 ) 248 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 + 249 268 # TESTING CONFIGURATION 250 269 # ------------------------------------------------------------------------------ 251 270 TEST_RUNNER = 'django.test.runner.DiscoverRunner' ··· 337 356 # GOOGLE MAPS 338 357 # ------------------------------------------------------------------------------ 339 358 GOOGLE_MAPS_API_KEY = env('GOOGLE_MAPS_API_KEY', default="AIzaSyAUuXiJ-kthJMHdXerksxYbqIbrRFrVfG4") 359 + 360 +
+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 +