mirror of
https://github.com/tjsga/website-2018.git
synced 2025-04-18 18:20:18 -04:00
make index work
This commit is contained in:
parent
a04caa12b8
commit
38358d14db
0
sgawebsite/__init__.py
Normal file
0
sgawebsite/__init__.py
Normal file
0
sgawebsite/apps/__init__.py
Normal file
0
sgawebsite/apps/__init__.py
Normal file
9
sgawebsite/apps/main/urls.py
Normal file
9
sgawebsite/apps/main/urls.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
from django.conf.urls import url
|
||||||
|
|
||||||
|
from .views import *
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
url(r'^$', index, name='index'),
|
||||||
|
url(r'about', about, name='about'),
|
||||||
|
|
||||||
|
]
|
|
@ -1,14 +1,7 @@
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
|
||||||
@app.route("/")
|
def index(request):
|
||||||
def index():
|
return render(request, "index.html")
|
||||||
announcements = Announcement.query.all()
|
|
||||||
return render_template(
|
|
||||||
"index.html",
|
|
||||||
prefix=ROOT_URL,
|
|
||||||
announcements=announcements)
|
|
||||||
|
|
||||||
# Create your views here.
|
def about(request):
|
||||||
|
return render(request, "about.html")
|
||||||
def index():
|
|
||||||
return
|
|
||||||
|
|
|
@ -37,6 +37,9 @@ INSTALLED_APPS = [
|
||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'sgawebsite',
|
||||||
|
'sgawebsite.apps',
|
||||||
|
'sgawebsite.apps.main'
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
Binary file not shown.
Binary file not shown.
|
@ -1,124 +0,0 @@
|
||||||
"""
|
|
||||||
Django settings for sgawebsite project.
|
|
||||||
|
|
||||||
Generated by 'django-admin startproject' using Django 1.11.5.
|
|
||||||
|
|
||||||
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 = '#6676vzm14drh2_a%yfywjd(k@p6btn(j#y9u1dyt9g-(8m-3-'
|
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
|
||||||
DEBUG = True
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = []
|
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
|
||||||
'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 = 'sgawebsite.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 = 'sgawebsite.wsgi.application'
|
|
||||||
|
|
||||||
|
|
||||||
# Database
|
|
||||||
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
|
|
||||||
|
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# 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/'
|
|
||||||
STATICFILES_DIRS = [
|
|
||||||
os.path.join(BASE_DIR, 'static'),
|
|
||||||
]
|
|
||||||
LOGIN_REDIRECT_URL = '/'
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{% load static %}
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta content="" name="description">
|
<meta content="" name="description">
|
||||||
<meta content="William Zhang" name="author">
|
<meta content="William Zhang" name="author">
|
||||||
|
@ -5,7 +6,7 @@
|
||||||
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0" />
|
||||||
<link href="icons/favicon.ico" rel="icon" type="image/ico">
|
<link href="icons/favicon.ico" rel="icon" type="image/ico">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet"/>
|
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet"/>
|
||||||
<link href="css/header.css" rel="stylesheet"/>
|
<link href="{% static 'css/header.css' %}" rel="stylesheet"/>
|
||||||
<link href="css/main.css" rel="stylesheet"/>
|
<link href="{% static 'css/main.css' %}" rel="stylesheet"/>
|
||||||
<link href="css/footer.css" rel="stylesheet"/>
|
<link href="{% static 'css/footer.css' %}" rel="stylesheet"/>
|
||||||
<link href="css/responsive.css" rel="stylesheet"/>
|
<link href="{% static 'css/responsive.css' %}" rel="stylesheet"/>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{% load static %}
|
||||||
<header>
|
<header>
|
||||||
<div id="banner">
|
<div id="banner">
|
||||||
<button id="menu-toggle">
|
<button id="menu-toggle">
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
{% load static %}
|
||||||
<head>
|
<head>
|
||||||
{% include head.html %}
|
{% include 'head.html' %}
|
||||||
<title>Home - TJSGA</title>
|
<title>Home - TJSGA</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% include header.html %}
|
{% include 'header.html' %}
|
||||||
<div id="wrapper" class="fluid">
|
<div id="wrapper" class="fluid">
|
||||||
<section id="intro">
|
<section id="intro">
|
||||||
<div id="intro-text" class="fluid">
|
<div id="intro-text" class="fluid">
|
||||||
|
@ -34,7 +35,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="intro-image" class="fluid">
|
<div id="intro-image" class="fluid">
|
||||||
<img src="img/group.jpg" alt="TJSGA Group Photo" />
|
<img src="{% static 'img/group.jpg' %}" alt="TJSGA Group Photo" />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<hr />
|
<hr />
|
||||||
|
@ -57,6 +58,6 @@
|
||||||
<iframe src="https://calendar.google.com/calendar/b/3/embed?showTitle=0&showPrint=0&height=600&wkst=1&bgcolor=%23ffffff&src=sga.tjhsst%40gmail.com&color=%23711616&ctz=America%2FNew_York" style="border-width:0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
|
<iframe src="https://calendar.google.com/calendar/b/3/embed?showTitle=0&showPrint=0&height=600&wkst=1&bgcolor=%23ffffff&src=sga.tjhsst%40gmail.com&color=%23711616&ctz=America%2FNew_York" style="border-width:0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
{% include footer.html %}
|
{% include 'footer.html' %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -13,9 +13,11 @@ Including another URLconf
|
||||||
1. Import the include() function: from django.conf.urls import url, include
|
1. Import the include() function: from django.conf.urls import url, include
|
||||||
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
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.contrib import admin
|
||||||
|
from .apps.main import urls as main
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^admin/', admin.site.urls),
|
url(r'^admin/', admin.site.urls),
|
||||||
|
url(r'^', include(main))
|
||||||
]
|
]
|
Loading…
Reference in New Issue
Block a user