title: Page not found 404 Django?
body: <p>I followed <a href="http://blog.narenarya.in/right-way-django-authentication.html" rel="nofollow">http://blog.narenarya.in/right-way-django-authentication.html</a> in order to add a user authentication in my Django project but when I run it and go to <a href="http://127.0.0.1:8000/log" rel="nofollow">http://127.0.0.1:8000/log</a> it shows page not found404! the others applications still working normally 
  newsite/settings.py </p>
  
  <pre><code>import os
  
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  SECRET_KEY = 'k$1@+(lwis6$1e73$&amp;f3xzk##qfs%$zv#=5n^st+05)zk%*@8@'
  
  DEBUG = True
  
  ALLOWED_HOSTS = []
  
  INSTALLED_APPS = [
  'django.contrib.admin',
  'django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.messages',
  'django.contrib.staticfiles',
  'aps',
  'mail',
  'log',
  ]
  
  MIDDLEWARE_CLASSES = [
  'django.middleware.security.SecurityMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  
  ROOT_URLCONF = 'newsite.urls'
  
  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',
          ],
      },
  },
  ]
  
  WSGI_APPLICATION = 'newsite.wsgi.application'
  MEDIA_URL = '/media/'
  MEDIA_ROOT = BASE_DIR + '/media/'
  
  DATABASES = {
  'default': {
      'ENGINE': 'django.db.backends.sqlite3',
      'NAME': '/home/hanou/Bureau/malouka/db.sqlite3',  
      'USER': 'root',
      'PASSWORD': 'MOTDEPASSE',
      'HOST': '127.0.0.1',                     
      'PORT': '',
  }
  }
  
  AUTH_PASSWORD_VALIDATORS = [
  {
      'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  },
  {
      'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  },
  {
      'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  },
  {
      'NAME':   'django.contrib.auth.password_validation.NumericPasswordValidator',
  },
  ]
  
  LANGUAGE_CODE = 'fr-fr'
  
  TIME_ZONE = 'Europe/Paris'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  STATIC_URL = '/static/'
  STATICFILES_DIRS = (
  BASE_DIR + '/static/',
  )
  EMAIL_HOST='smtp.gmail.com'
  EMAIL_PORT=587
  EMAIL_HOST_USER='*********@gmail.com'  
  EMAIL_HOST_PASSWORD='*********'
  EMAIL_USE_TLS = True
  LOGIN_REDIRECT_URL = '/' 
  </code></pre>
  
  <p>newsite/urls.py </p>
  
  <pre><code>from django.conf.urls import include, url
  from django.contrib import admin
  from aps import views
  from mail import views
  from log import views
  from django.contrib.auth import views
  from log.forms import LoginForm
  
  urlpatterns = [
  url(r'^admin/', admin.site.urls),    
  url(r'^aps/', include('aps.urls')),
  url(r'^mail/', include('mail.urls')),
  url(r'^log/', include('log.urls')),
  url(r'^login/$',views.login, {'template_name': 'login.html', 'authentication_form': LoginForm}),
  url(r'^logout/$', views.logout, {'next_page': '/login'}),
  ]
  </code></pre>
  
  <p>newsite/log/views </p>
  
  <pre><code>from django.shortcuts import render
  from django.contrib.auth.decorators import login_required
  
  @login_required(login_url="login/")
  def home(request):
      return render(request,"home.html")
  </code></pre>
  
  <p>newsite/log/urls.py   </p>
  
  <pre><code>from django.conf.urls import url
  from . import views
  
  urlpatterns = [
      url(r'^$', views.home, name='home'),
  ]
  </code></pre>