Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
linbossdegithub committed Mar 5, 2019
0 parents commit 3963a30
Show file tree
Hide file tree
Showing 35 changed files with 990 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .idea/care_test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

383 changes: 383 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Empty file added care_test/__init__.py
Empty file.
Binary file added care_test/__init__.pyc
Binary file not shown.
126 changes: 126 additions & 0 deletions care_test/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
"""
Django settings for care_test project.
Generated by 'django-admin startproject' using Django 1.11.16.
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 = '%)!m$_6h@u^1ot1cxl7)sfmpn+flleon!5%dez8x^4br$-c-*q'

# 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',
'test_test',
'bootstrap3',
]

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 = 'care_test.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 = 'care_test.wsgi.application'


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

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'test_test', #
'USER': 'root', #
'PASSWORD': '1416520104', #
'HOST': '127.0.0.1', #IP
'PORT': '5555',
}
}


# 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/'
Binary file added care_test/settings.pyc
Binary file not shown.
28 changes: 28 additions & 0 deletions care_test/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""care_test 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
from test_test import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^index/$',views.index),
url(r'^login_action/$',views.login_action),
url(r'^event_manage/$',views.event_manage),
url(r'^search_name/$',views.search_name),
url(r'^guest_manage/$',views.guest_manage),
url(r'^logout/$',views.logout),
url(r'^api/',include('test_test.urls',namespace="sign")),
]
Binary file added care_test/urls.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions care_test/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for care_test 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", "care_test.settings")

application = get_wsgi_application()
Binary file added care_test/wsgi.pyc
Binary file not shown.
Binary file added db.sqlite3
Binary file not shown.
22 changes: 22 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "care_test.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
execute_from_command_line(sys.argv)
Empty file added test_test/__init__.py
Empty file.
Binary file added test_test/__init__.pyc
Binary file not shown.
9 changes: 9 additions & 0 deletions test_test/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.contrib import admin
from test_test.models import Event,Guest
# Register your models here.
admin.site.register(Event)
admin.site.register(Guest)

Binary file added test_test/admin.pyc
Binary file not shown.
8 changes: 8 additions & 0 deletions test_test/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.apps import AppConfig


class TestTestConfig(AppConfig):
name = 'test_test'
40 changes: 40 additions & 0 deletions test_test/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-02-12 08:55
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Event',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('limit', models.IntegerField()),
('status', models.BooleanField()),
('address', models.CharField(max_length=200)),
('start_time', models.DateTimeField(verbose_name='events time')),
('create_time', models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name='Guest',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('realname', models.CharField(max_length=64)),
('phone', models.CharField(max_length=16)),
('email', models.EmailField(max_length=254)),
('sign', models.BooleanField()),
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='test_test.Event')),
],
),
]
Binary file added test_test/migrations/0001_initial.pyc
Binary file not shown.
Empty file.
Binary file added test_test/migrations/__init__.pyc
Binary file not shown.
28 changes: 28 additions & 0 deletions test_test/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
class Event(models.Model):
name = models.CharField(max_length=100)
limit = models.IntegerField()
status = models.BooleanField()
address =models.CharField(max_length=200)
start_time = models.DateTimeField('events time')
create_time = models.DateTimeField(auto_now=True)
def ___str___(self):
return self.name


class Guest(models.Model):
event = models.ForeignKey(Event)
realname = models.CharField(max_length=64)
phone = models.CharField(max_length=16)
email = models.EmailField()
sign = models.BooleanField()
create_time = models.DateTimeField(auto_now=True)

class Meta:
unique_together = ("event","phone")

def ___str___(self):
return self.realname
Binary file added test_test/models.pyc
Binary file not shown.
72 changes: 72 additions & 0 deletions test_test/templates/event_manage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<html lang="zh-CN">
<head>
{% load bootstrap3 %}
{% bootstrap_css %}
{% bootstrap_javascript %}
<title>Event Manage Page </title>
</head>
<body role="document">
<!--导航栏-->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/event_manage/">Guest Manage System</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active">
<a href="#">发布会</a>
</li>
<li><a href="/guest_manage/">嘉宾</a></li>

</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="/logout/">退出</a></li>
</ul>
</div>
</div>


</nav>

<!--发布会搜索表单-->
<div class="page-header" style="padding-top: 60px;">
<div id="navbar" class="navbar-collapse collapse">
<form class="navbar-form" method="get" action="/search_name/">
<div class="form-group">
<input type="text" name="name" placeholder="名称" class="form-control">
</div>
</form>
</div>

</div>
<!--发布会列表-->
<div class="row" style="padding-top: 80px;">
<div class="col-md-6">
<table class="table table-striped">
<thead>
<tr>
<th>id</th><th>名称</th><th>状态</th><th>地址</th><th>时间</th>
</tr>
</thead>
<tbody>
{% for event in events %}
<tr>
<td>{{event.id}}</td>
<td>{{event.name}}</td>
<td>{{event.status}}</td>
<td>{{event.address}}</td>
<td>{{event.start_time}}</td>

</tr>
{% endfor %}
</tbody>


</table>
</div>
</div>


</body>
</html>
Loading

0 comments on commit 3963a30

Please sign in to comment.