Skip to content
Snippets Groups Projects
Commit f4a74ab1 authored by Lihuan Zhang's avatar Lihuan Zhang
Browse files

test

parent 8639426c
Branches
No related tags found
No related merge requests found
Showing
with 337 additions and 102 deletions
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" /> <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component> </component>
</project> </project>
\ No newline at end of file
This diff is collapsed.
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -25,7 +25,7 @@ SECRET_KEY = '84rci9)9prwn$cd!gv2g3^7s0)^a9_o30!k6iwy=wdav9+p7g#' ...@@ -25,7 +25,7 @@ SECRET_KEY = '84rci9)9prwn$cd!gv2g3^7s0)^a9_o30!k6iwy=wdav9+p7g#'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
ALLOWED_HOSTS = [] ALLOWED_HOSTS = ['10.13.105.80']
# Application definition # Application definition
...@@ -37,13 +37,15 @@ INSTALLED_APPS = [ ...@@ -37,13 +37,15 @@ INSTALLED_APPS = [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'rest_framework',
'cargo',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', #'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
...@@ -70,14 +72,18 @@ TEMPLATES = [ ...@@ -70,14 +72,18 @@ TEMPLATES = [
WSGI_APPLICATION = 'PMPBackend.wsgi.application' WSGI_APPLICATION = 'PMPBackend.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
DATABASES = { DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.mysql',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 'NAME': 'lihuanz',
'USER': 'lihuanz',
'HOST': 'info20003db.eng.unimelb.edu.au',
'PASSWORD': 'zlh2005zlh',
'PORT': 3306,
} }
} }
......
...@@ -16,18 +16,17 @@ Including another URLconf ...@@ -16,18 +16,17 @@ Including another URLconf
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path
from PMPBackend import views from cargo import views as cargoViews
urlpatterns = [ urlpatterns = [
path('', views.homepage), path('api/user/profile', cargoViews.profile),
path('user/login', views.signin), path('api/user/update', cargoViews.updateprofile),
path('user/signup', views.signup), path('api/user/signin', cargoViews.signIn),
path('user/profile', views.userprofile), path('api/user/signup', cargoViews.signUp),
path('user/updateprofile', views.userprofile), path('api/booking/check', cargoViews.displaybook),
path('booking/booklookup', views.lookupbook), path('api/booking/create', cargoViews.newbook),
path('booking/makebooking', views.newbook), path('api/booking/update', cargoViews.updatebook),
path('booking/updatebooking', views.updatebook), path('api/shipInfo', cargoViews.shipInfo),
path('admin/', admin.site.urls),
] ]
File added
File added
File added
File added
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class CargoConfig(AppConfig):
name = 'cargo'
# Generated by Django 2.1.1 on 2018-10-05 05:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='request',
fields=[
('bookID', models.AutoField(primary_key=True, serialize=False)),
('boxNumber', models.IntegerField()),
('destination', models.CharField(max_length=150)),
('pickup', models.CharField(max_length=150)),
('customerMessage', models.TextField(null=True)),
('status', models.IntegerField(default=0, max_length=1)),
('cost', models.IntegerField(null=True)),
('pickupDate', models.DateTimeField(null=True)),
('HBL', models.CharField(max_length=30, null=True)),
('shiperMessage', models.TextField(null=True)),
],
),
migrations.CreateModel(
name='shipment',
fields=[
('shipmentID', models.AutoField(primary_key=True, serialize=False)),
('leaveDate', models.DateField()),
('arriveDate', models.DateField()),
],
),
migrations.CreateModel(
name='user',
fields=[
('userID', models.AutoField(primary_key=True, serialize=False)),
('email', models.CharField(max_length=50)),
('password', models.CharField(max_length=20)),
('userType', models.IntegerField(default=0, max_length=1)),
('userName', models.CharField(max_length=30)),
('phoneNumber', models.CharField(max_length=20)),
('homeAddress', models.CharField(max_length=150)),
],
),
migrations.AddField(
model_name='request',
name='shipmentID',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cargo.shipment'),
),
migrations.AddField(
model_name='request',
name='userID',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cargo.user'),
),
]
# Generated by Django 2.1.1 on 2018-10-05 06:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cargo', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='request',
name='status',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='user',
name='userType',
field=models.IntegerField(default=0),
),
]
# Generated by Django 2.1.1 on 2018-10-05 09:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cargo', '0002_auto_20181005_0611'),
]
operations = [
migrations.RenameModel(
old_name='request',
new_name='requestbook',
),
]
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment