Skip to content

Commit

Permalink
Base Menu Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
hardlyhuman committed Aug 24, 2017
1 parent 01e5ca5 commit 8c49f9f
Show file tree
Hide file tree
Showing 90 changed files with 18,297 additions and 0 deletions.
Empty file added SE2017/__init__.py
Empty file.
145 changes: 145 additions & 0 deletions SE2017/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
"""
Django settings for SE2017 project.
Generated by 'django-admin startproject' using Django 1.11.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_qj^6v3g@mpc%dg40^a4(_d=_%d0yedf$+-i3@#s6mbgn*%m%b'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'home.apps.HomeConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'SE2017.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'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 = 'SE2017.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases

if os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine'):
# Running on production App Engine, so connect to Google Cloud SQL using
# the unix socket at /cloudsql/<your-cloudsql-connection string>
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'HOST': '/cloudsql/se2017-177706:asia-east1:se2017',
'NAME': 'se2017',
'USER': 'root',
'PASSWORD': 'se2017dr.chs',
}
}
else:
# Running locally so connect to either a local MySQL instance or connect to
# Cloud SQL via the proxy. To start the proxy via command line:
#
# $ cloud_sql_proxy -instances=[INSTANCE_CONNECTION_NAME]=tcp:3306
#
# See https://cloud.google.com/sql/docs/mysql-connect-proxy
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'HOST': '127.0.0.1',
'PORT': '8080',
'NAME': 'se2017',
'USER': 'root',
'PASSWORD': 'se2017dr.chs',
}
}

# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators

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',
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

22 changes: 22 additions & 0 deletions SE2017/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""SE2017 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
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, include
from django.contrib import admin

urlpatterns = [
url(r'^home/', include('home.urls')),
url(r'^admin/', admin.site.urls),
]
16 changes: 16 additions & 0 deletions SE2017/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for SE2017 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "SE2017.settings")

application = get_wsgi_application()
31 changes: 31 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# [START django_app]
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /static
static_dir: static/
- url: .*
script: SE2017.wsgi.application

# Only pure Python libraries can be vendored
# Python libraries that use C extensions can
# only be included if they are part of the App Engine SDK
# Using Third Party Libraries: https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27
libraries:
- name: MySQLdb
version: 1.2.5
# [END django_app]

# Google App Engine limits application deployments to 10,000 uploaded files per
# version. The skip_files section allows us to skip virtual environment files
# to meet this requirement. The first 5 are the default regular expressions to
# skip, while the last one is for all env/ files.
skip_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
- ^env/.*$
19 changes: 19 additions & 0 deletions appengine_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START vendor]
from google.appengine.ext import vendor

vendor.add('lib')
# [END vendor]
Binary file added cloud_sql_proxy
Binary file not shown.
Binary file added db.sqlite3
Binary file not shown.
Empty file added home/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions home/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
7 changes: 7 additions & 0 deletions home/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import unicode_literals

from django.apps import AppConfig


class HomeConfig(AppConfig):
name = 'home'
Empty file added home/migrations/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions home/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from __future__ import unicode_literals

from django.db import models

# Create your models here.
110 changes: 110 additions & 0 deletions home/static/home/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
.wrapper{
float:left;
width:100%;
min-height:250px;
}
.navigation{
float: left;
width: 100%;
text-align: center;
}
.navigation ul{
margin: 0;
padding: 0;
float: none;
width: auto;
list-style: none;
display: inline-block;
}
.navigation ul li{
float: left;
width: auto;
margin-right: 60px;
position: relative;
}
.navigation ul li:last-child{
margin: 0;
}
.navigation ul li a{
float: left;
width: 100%;
color: #333;
padding: 16px 0;
font-size: 16px;
line-height: normal;
text-decoration:none;
box-sizing:border-box;
text-transform: uppercase;
font-family: 'Montserrat', sans-serif; -webkit-transition:color 0.3s ease;
transition:color 0.3s ease;
}
.navigation .children {
position: absolute;
top: 100%;
z-index: 1000;
margin: 0;
padding: 0;
left: 0;
min-width: 240px;
background-color: #fff;
border: solid 1px #dbdbdb;
opacity: 0;
-webkit-transform-origin: 0% 0%;
transform-origin: 0% 0%;
-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
transition: opacity 0.3s, -webkit-transform 0.3s;
transition: transform 0.3s, opacity 0.3s;
transition: transform 0.3s, opacity 0.3s, -webkit-transform 0.3s;
}
.navigation ul li .children {
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform: rotateX(-75deg);
transform: rotateX(-75deg);
visibility: hidden;
}
.navigation ul li:hover > .children {
-webkit-transform: rotateX(0deg);
transform: rotateX(0deg);
opacity: 1;
visibility: visible;
}
.navigation ul li .children .children{
left: 100%;
top: 0;
}
.navigation ul li.last .children{
right: 0;
left: auto;
}
.navigation ul li.last .children .children{
right: 100%;
left: auto;
}
.navigation ul li .children li{
float: left;
width: 100%;
margin:0;
}
.navigation ul li .children a {
display: block;
font-family: "Montserrat", sans-serif;
text-transform: uppercase;
font-weight: 700;
font-size: 11px;
color: #333;
text-align: left;
line-height: 1.5em;
padding: 16px 30px;
letter-spacing: normal;
border-bottom: 1px solid #dbdbdb;
-webkit-transition: background-color 0.3s ease;
transition: background-color 0.3s ease;
}
.navigation ul li .children a:hover{
color: #fff;
background-color:goldenrod;
}
.navigation ul li a:hover{
color:goldenrod;
}
Loading

0 comments on commit 8c49f9f

Please sign in to comment.