Mostrando postagens com marcador PYTHON. Mostrar todas as postagens
Mostrando postagens com marcador PYTHON. Mostrar todas as postagens

sexta-feira, 14 de setembro de 2018

TemplateDoesNotExist at /accounts/login/

Verify the attribute DIRS

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ['./templates',],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]


TemplateDoesNotExist at /accounts/login/

registration/login.html
Request Method:GET
Request URL:http://127.0.0.1:8000/accounts/login/?next=/versioning/
Django Version:2.1.1
Exception Type:TemplateDoesNotExist
Exception Value:
registration/login.html
Exception Location:C:\ci_database_lawoffice\ci\lib\site-packages\django\template\loader.py in select_template, line 47
Python Executable:C:\ci_database_lawoffice\ci\Scripts\python.exe
Python  

segunda-feira, 27 de agosto de 2018

domingo, 6 de agosto de 2017

The Zen of Python - Factorial

def calculate_factorial(n):
    def nfatorial(current,currentfactorial):
        if current < 2:
            return currentfactorial
        else:
            current = current - 1
            currentfactorial = currentfactorial * (current)
            return nfatorial(current,currentfactorial)
    return nfatorial(n+1,1)

The Zen of Python - Fibonacci

# Type your code here
def calculate_fibonacci(n):

    def iterativex(max1, previous, current,contador):
        newcurrent = current + previous
        contador = contador + 1
        if contador > max1:
           return current
        else:
           return iterativex(max1,current,newcurrent,contador)  

    return iterativex(n,0,1,1)

sexta-feira, 28 de julho de 2017

The Zen of Python - Bubble Sort

def return_sorted_list(unsorted_list):
    sorted_list = unsorted_list[:]
    for i in range(0,len(sorted_list)):
        for i in range(0,len(sorted_list)):
                if i < (len(sorted_list) - 1):
                    current_item = sorted_list[i]
                    next_item = sorted_list[i+1]
                    if current_item > next_item:
                            sorted_list[i] = next_item
                            sorted_list[i+1] = current_item
    return sorted_list

print(return_sorted_list([3,4,2,6,7]))


sábado, 23 de janeiro de 2016