Changeset 8666 for mauRepo/dj_security


Ignore:
Timestamp:
06/11/12 09:44:42 (7 years ago)
Author:
mnagni
Message:

FIxes uncorrect context_processor definition

Location:
mauRepo/dj_security/trunk/dj_security
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/dj_security/trunk/dj_security/context_processors.py

    r8665 r8666  
    3333from django.conf import settings 
    3434 
    35 def settings(request): 
     35def url_root(request): 
    3636    return {'URL_ROOT': getattr(settings, 'URL_ROOT', '127.0.0.1')} 
  • mauRepo/dj_security/trunk/dj_security/dev_settings.py

    r8662 r8666  
    3131@author: mnagni 
    3232''' 
    33 from dj_security.settings import decodeRelativePath 
     33from dj_security.settings import decode_relative_path 
    3434''' 
    3535DATABASES = { 
    3636    'default': { 
    3737        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 
    38         'NAME': decodeRelativePath('.') + '/sqlite.db',                      # Or path to database file if using sqlite3. 
     38        'NAME': decode_relative_path('.') + '/sqlite.db',                      # Or path to database file if using sqlite3. 
    3939        'USER': '',                      # Not used with sqlite3. 
    4040        'PASSWORD': '',                  # Not used with sqlite3. 
  • mauRepo/dj_security/trunk/dj_security/settings.py

    r8665 r8666  
    22import os 
    33 
    4 def decodeRelativePath(relPath): 
     4def decode_relative_path(relPath): 
    55    return os.path.join(os.path.dirname(__file__), relPath).replace('\\', '/')   
    66 
     
    1414 
    1515DATABASES = { 
    16     # This parameters are usually set during the deployment configuration process 
     16    # This parameters are usually set during  
     17    # the deployment configuration process 
    1718    'default': { 
    18         'ENGINE': 'DB_ENGINE', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 
    19         'NAME': 'DB_NAME',                      # Or path to database file if using sqlite3. 
    20         'USER': 'DB_USER',                      # Not used with sqlite3. 
    21         'PASSWORD': 'DB_PASSWORD',                  # Not used with sqlite3. 
    22         'HOST': 'DB_HOST',                      # Set to empty string for localhost. Not used with sqlite3. 
    23         'PORT': 'DB_PORT',                      # Set to empty string for default. Not used with sqlite3. 
     19        # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.                 
     20        'ENGINE': 'DB_ENGINE',  
     21        # Or path to database file if using sqlite3. 
     22        'NAME': 'DB_NAME', 
     23        # Not used with sqlite3.                       
     24        'USER': 'DB_USER', 
     25        # Not used with sqlite3.                       
     26        'PASSWORD': 'DB_PASSWORD', 
     27        # Set to empty string for localhost. Not used with sqlite3.         
     28        'HOST': 'DB_HOST',                       
     29        # Set to empty string for default. Not used with sqlite3.         
     30        'PORT': 'DB_PORT',                       
    2431    }  
    2532} 
     
    109116 
    110117TEMPLATE_DIRS = ( 
    111     decodeRelativePath('static/templates')  
     118    decode_relative_path('static/templates')  
    112119    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". 
    113120    # Always use forward slashes, even on Windows. 
     
    136143if APPLICATION_ROOT.startswith('PROJECT_NAME_'): 
    137144    APPLICATION_ROOT = '' 
    138 ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value. 
     145     
     146# One-week activation window; you may, of course, use a different value.     
     147ACCOUNT_ACTIVATION_DAYS = 7  
    139148import socket 
    140149try: 
    141150    HOSTNAME = socket.gethostname() 
    142 except: 
     151except Exception: 
    143152    HOSTNAME = 'localhost' 
    144153URL_ROOT = 'http://' + HOSTNAME + '/' + APPLICATION_ROOT 
     
    181190} 
    182191 
    183 import dev_settings 
     192import dj_security.dev_settings 
  • mauRepo/dj_security/trunk/dj_security/static/templates/registration/activation_email.txt

    r8664 r8666  
    22Someone, hopefully you, signed up for a new account at djangoproject.com using this email address. If it was you, and you'd like to activate and use your account, click the link below or copy and paste it into your web browser's address bar: 
    33 
    4 {{ URL_ROOT }}/accounts/activate/{{ activation_key }}/ 
     4{{ url_root }}/accounts/activate/{{ activation_key }}/ 
    55 
    66If you didn't request this, you don't need to do anything; you won't receive any more email from us, and the account will expire automatically in {{ expiration_days|apnumber }} days. 
  • mauRepo/dj_security/trunk/dj_security/views/my_profile.py

    r8665 r8666  
    44@author: mnagni 
    55''' 
    6 from dj_security.views.my_view import errorHandle 
     6from dj_security.views.my_view import error_handle 
    77from dj_security.models import UserProfile 
    88from django.shortcuts import render_to_response 
     
    4141            pass 
    4242         
    43     return errorHandle(request, context) 
     43    return error_handle(request, context) 
  • mauRepo/dj_security/trunk/dj_security/views/my_view.py

    r8665 r8666  
    1212from django.conf import settings 
    1313 
    14 def errorHandle(request, context): 
     14def error_handle(request, context): 
    1515    form = LoginForm() 
    1616    context['form'] = form 
     
    4545                    # Return a 'disabled account' error message 
    4646                    context['error'] = u'account disabled' 
    47                     return errorHandle(request, context) 
     47                    return error_handle(request, context) 
    4848            else: 
    4949                 # Return an 'invalid login' error message. 
    5050                context['error'] = u'invalid login'                 
    51                 return errorHandle(request, context) 
     51                return error_handle(request, context) 
    5252        else: 
    5353            context['error'] = u'form is invalid' 
    54             return errorHandle(request, context) 
     54            return error_handle(request, context) 
    5555    else: 
    5656        form = LoginForm() # An unbound form 
Note: See TracChangeset for help on using the changeset viewer.