diff --git a/.gitignore b/.gitignore
index af89a1a..63312cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+.idea/
+.Trash-1000/
*.pyc
# Byte-compiled / optimized / DLL files
__pycache__/
diff --git a/admincp/admin.py b/admincp/admin.py
index 8c38f3f..14e5cf3 100644
--- a/admincp/admin.py
+++ b/admincp/admin.py
@@ -1,3 +1,19 @@
from django.contrib import admin
+from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
+from django.contrib.auth.models import User
-# Register your models here.
+from user_profile.models import Profile
+
+
+class ProfileInline(admin.StackedInline):
+ model = Profile
+ can_delete = False
+ verbose_name_plural = 'profiles'
+
+
+class UserAdmin(BaseUserAdmin):
+ inlines = (ProfileInline, )
+
+
+admin.site.unregister(User)
+admin.site.register(User, UserAdmin)
diff --git a/dash_stack/__init__.py b/authcp/forms.py
similarity index 100%
rename from dash_stack/__init__.py
rename to authcp/forms.py
diff --git a/authcp/urls.py b/authcp/urls.py
new file mode 100644
index 0000000..9b9e052
--- /dev/null
+++ b/authcp/urls.py
@@ -0,0 +1,11 @@
+from django.conf.urls import url
+from django.contrib import admin
+from django.contrib.auth import views as auth_views
+
+from . import views
+
+urlpatterns = [
+ url(r'^$', views.index, name='index'),
+ url(r'^login/$', auth_views.login, {'template_name': 'authcp/login.html'}, name='login'),
+ url(r'^logout/$', auth_views.logout, name='logout'),
+]
diff --git a/authcp/views.py b/authcp/views.py
index 91ea44a..3e6d569 100644
--- a/authcp/views.py
+++ b/authcp/views.py
@@ -1,3 +1,6 @@
from django.shortcuts import render
-# Create your views here.
+
+def index(request):
+ return render(request, "authcp/index.html", {})
+
diff --git a/dash_stack_dashboard/__init__.py b/dash_stack_dashboard/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/dash_stack/settings.py b/dash_stack_dashboard/settings.py
similarity index 89%
rename from dash_stack/settings.py
rename to dash_stack_dashboard/settings.py
index 1290da8..b9a0fdc 100644
--- a/dash_stack/settings.py
+++ b/dash_stack_dashboard/settings.py
@@ -25,7 +25,18 @@ SECRET_KEY = '@b*)c#tfs%382t87hojq!1pou#f_3557kf(w@a++y$j5)+$rmd'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
-ALLOWED_HOSTS = ['dash-stack',]
+ALLOWED_HOSTS = [
+ 'dash-stack',
+ '198.211.127.189',
+]
+
+# login url
+LOGIN_URL = '/auth/login/'
+
+LOGIN_REDIRECT_URL = '/'
+
+# logout redirect
+LOGOUT_REDIRECT_URL = '/auth/login/'
# Application definition
@@ -57,12 +68,12 @@ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
]
-ROOT_URLCONF = 'dash_stack.urls'
+ROOT_URLCONF = 'dash_stack_dashboard.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [],
+ 'DIRS': ['templates',],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@@ -75,7 +86,7 @@ TEMPLATES = [
},
]
-WSGI_APPLICATION = 'dash_stack.wsgi.application'
+WSGI_APPLICATION = 'dash_stack_dashboard.wsgi.application'
# Database
@@ -136,4 +147,8 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/
+STATICFILES_DIRS = [
+ os.path.join(BASE_DIR, "static"),
+]
+
STATIC_URL = '/static/'
\ No newline at end of file
diff --git a/dash_stack/urls.py b/dash_stack_dashboard/urls.py
similarity index 83%
rename from dash_stack/urls.py
rename to dash_stack_dashboard/urls.py
index 736e3df..984d3b5 100644
--- a/dash_stack/urls.py
+++ b/dash_stack_dashboard/urls.py
@@ -13,10 +13,13 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
-from django.conf.urls import url
+from django.conf.urls import include,url
from django.contrib import admin
-from django.views.generic.base import TemplateView
+
+from . import views
urlpatterns = [
url(r'^admindj/', admin.site.urls),
+ url(r'^$', views.index, name='index'),
+ url(r'^auth/', include('authcp.urls')),
]
diff --git a/dash_stack_dashboard/views.py b/dash_stack_dashboard/views.py
new file mode 100644
index 0000000..e8c00a9
--- /dev/null
+++ b/dash_stack_dashboard/views.py
@@ -0,0 +1,8 @@
+import datetime
+
+from django.contrib.auth.decorators import login_required
+from django.shortcuts import render
+
+@login_required
+def index(request):
+ return render(request, "base.html", {'time' : datetime.datetime.now()})
\ No newline at end of file
diff --git a/dash_stack/wsgi.py b/dash_stack_dashboard/wsgi.py
similarity index 80%
rename from dash_stack/wsgi.py
rename to dash_stack_dashboard/wsgi.py
index f0632ad..09357ad 100644
--- a/dash_stack/wsgi.py
+++ b/dash_stack_dashboard/wsgi.py
@@ -11,6 +11,6 @@ import os
from django.core.wsgi import get_wsgi_application
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dash_stack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dash_stack_dashboard.settings")
application = get_wsgi_application()
diff --git a/manage.py b/manage.py
index 54f49f3..cc94a6f 100755
--- a/manage.py
+++ b/manage.py
@@ -3,7 +3,7 @@ import os
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dash_stack.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dash_stack_dashboard.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
diff --git a/static/avatar/2016-11-27/nobody_m.original.jpg b/static/avatar/2016-11-27/nobody_m.original.jpg
new file mode 100644
index 0000000..bed17c9
Binary files /dev/null and b/static/avatar/2016-11-27/nobody_m.original.jpg differ
diff --git a/static/avatar/2016-11-27/nobody_m.original_Zt62Q5i.jpg b/static/avatar/2016-11-27/nobody_m.original_Zt62Q5i.jpg
new file mode 100644
index 0000000..bed17c9
Binary files /dev/null and b/static/avatar/2016-11-27/nobody_m.original_Zt62Q5i.jpg differ
diff --git a/templates/authcp/index.html b/templates/authcp/index.html
new file mode 100644
index 0000000..5357175
--- /dev/null
+++ b/templates/authcp/index.html
@@ -0,0 +1 @@
+Go to login please...
\ No newline at end of file
diff --git a/templates/authcp/login.html b/templates/authcp/login.html
new file mode 100644
index 0000000..97e7e65
--- /dev/null
+++ b/templates/authcp/login.html
@@ -0,0 +1,55 @@
+{% extends "base_headless.html" %}
+
+{% block auth %}
+
+
+
+
+{% endblock auth %}
\ No newline at end of file
diff --git a/templates/base.html b/templates/base.html
index e69de29..f41f51a 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -0,0 +1,464 @@
+
+
+
+
+
+ {% block title %}dashStack Dashboard{% endblock %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% block header %}
+
+{% endblock header %}
+{% block sidebar %}
+
+
+{% endblock sidebar %}
+
+
+ {% block content-header %}
+
+
+ {% endblock content-header %}
+ {% block content %}
+
+
+
+ {% endblock content %}
+
+
+ {% block footer %}
+
+
+ Version 2.3.8
+
+ Copyright © 2014-2016 dash-stack . All rights
+ reserved.
+
+ {% endblock footer %}
+ {% block control-sidebar %}
+
+
+
+
+
+ {% endblock control-sidebar %}
+
+
+{% block java-scripts %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% endblock java-scripts %}
+
+
\ No newline at end of file
diff --git a/templates/base_headless.html b/templates/base_headless.html
new file mode 100644
index 0000000..00580ad
--- /dev/null
+++ b/templates/base_headless.html
@@ -0,0 +1,47 @@
+
+
+
+
+
+ AdminLTE 2 | Log in
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% block auth %}
+
+{% endblock auth %}
+
+
+
+
+
+
+
+
+
+
diff --git a/templates/index.html b/templates/index.html
index e69de29..08384b1 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -0,0 +1,1266 @@
+
+
+
+
+
+ {% block title %}dashStack Dashboard{% endblock %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% block header %}
+
+{% endblock header %}
+{% block sidebar %}
+
+
+{% endblock sidebar %}
+
+
+ {% block content-header %}
+
+
+ {% endblock content-header %}
+ {% block content %}
+
+
+
+
+
+
+
+
+
+
+
+
+
44
+
+
User Registrations
+
+
+
+
+
+
+
+
+
+
+
+
+
65
+
+
Unique Visitors
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2:15
+ Mike Doe
+
+ I would like to meet you to discuss the latest news about
+ the arrival of the new theme. They say it is going to be one the
+ best themes on the market
+
+
+
Attachments:
+
+
+ Theme-thumbnail-image.jpg
+
+
+
+ Open
+
+
+
+
+
+
+
+
+
+
+
+ 5:15
+ Alexander Pierce
+
+ I would like to meet you to discuss the latest news about
+ the arrival of the new theme. They say it is going to be one the
+ best themes on the market
+
+
+
+
+
+
+
+
+
+ 5:30
+ Susan Doe
+
+ I would like to meet you to discuss the latest news about
+ the arrival of the new theme. They say it is going to be one the
+ best themes on the market
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% endblock content %}
+
+
+ {% block footer %}
+
+
+ Version 2.3.8
+
+ Copyright © 2014-2016 Almsaeed Studio . All rights
+ reserved.
+
+ {% endblock footer %}
+ {% block control-sidebar %}
+
+
+
+
+
+ {% endblock control-sidebar %}
+
+
+{% block java-scripts %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% endblock java-scripts %}
+
+
\ No newline at end of file
diff --git a/user_profile/admin.py b/user_profile/admin.py
index 8c38f3f..1888ed5 100644
--- a/user_profile/admin.py
+++ b/user_profile/admin.py
@@ -1,3 +1,4 @@
from django.contrib import admin
-# Register your models here.
+from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
+from django.contrib.auth.models import User
\ No newline at end of file
diff --git a/user_profile/migrations/0001_initial.py b/user_profile/migrations/0001_initial.py
new file mode 100644
index 0000000..5b4821b
--- /dev/null
+++ b/user_profile/migrations/0001_initial.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.3 on 2016-11-22 20:26
+from __future__ import unicode_literals
+
+from django.conf import settings
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Profile',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('avatar', models.TextField(blank=True, max_length=500)),
+ ('provider_password', models.CharField(max_length=50)),
+ ('selected_provider', models.IntegerField()),
+ ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
+ ],
+ ),
+ ]
diff --git a/user_profile/models.py b/user_profile/models.py
index bd4b2ab..383b793 100644
--- a/user_profile/models.py
+++ b/user_profile/models.py
@@ -1,5 +1,11 @@
from __future__ import unicode_literals
from django.db import models
+from django.contrib.auth.models import User
-# Create your models here.
+
+class Profile(models.Model):
+ user = models.OneToOneField(User, on_delete=models.CASCADE)
+ avatar = models.FileField(upload_to='static/avatar/%Y-%m-%d')
+ provider_password = models.CharField(max_length=50)
+ selected_provider = models.IntegerField()
\ No newline at end of file