提交源码

pull/7/head
陈家儒 1 year ago
parent e57d404db9
commit 608b51facf

@ -74,10 +74,20 @@ WSGI_APPLICATION = 'FoodSpace.wsgi.application'
# Database # Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases # https://docs.djangoproject.com/en/4.2/ref/settings/#databases
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': BASE_DIR / 'db.sqlite3',
# }
# }
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.mysql',
'NAME': BASE_DIR / 'db.sqlite3', 'NAME': 'menu',
'USER': 'root',
'PASSWORD': "123456cjR.sT",
'HOST': 'localhost',
'PORT': '3306',
} }
} }

@ -16,18 +16,32 @@ Including another URLconf
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path
from index import views from index import views
urlpatterns = [ urlpatterns = [
# path('admin/', admin.site.urls), path('',views.login),
path('',views.index),
path('login/', views.login), path('login/', views.login),
# path('/login/',views.login_success)
path('register/', views.register, name='register'), path('register/', views.register, name='register'),
path('mainpage/',views.index), path('mine/', views.mine, name='mine'),
path('mypape/', views.mypage_view, name='mypage'), path('mainpage/', views.mainpage, name='mainpage'),
path('page1/', views.page1_view, name='page1'), path('like_dish/<int:dish_id>/', views.like_dish, name='like_dish'),
path('page2/', views.page2_view, name='page2'), path('collect_dish/<int:dish_id>/', views.collect_dish, name='collect_dish'),
path('page3/', views.page3_view, name='page3'), path('userDefind/', views.userDefind),
path('page4/', views.page4_view, name='page4'), path('admin/',views.admin),
# path('recommend/',views.recommend_dishes_for_user),
path('admin/getDishes', views.get_dishes_list, name='get_dishes_list'),
path('admin/getDish/<int:dish_id>', views.get_dish, name='get_dish'),
path('admin/deleteDish', views.delete_dish, name='delete_dish'),
path('recommendations/',views.recommendations),
path('search/', views.search_results, name='search_results'),
path('mycollect/', views.mycollection),
path('setting/',views.setting),
path('help/',views.help),
path('about/',views.about),
path('admin/getUsers', views.get_users_list, name='get_users_list'),
path('admin/getUser/<int:user_id>', views.get_user, name='get_user'),
path('admin/deleteDish', views.delete_dish, name='delete_dish'),
path('admin/deleteUser', views.delete_user, name='delete_user'),
] ]

@ -1,4 +1,53 @@
from django.db import models from django.db import models
# Create your models here. class UserList(models.Model):
UserID = models.AutoField(primary_key=True) # 自动增长主键
UserName = models.CharField(max_length=50)
PassWord = models.CharField(max_length=50)
Role = models.CharField(max_length=50)
class Meta:
db_table = 'UserList' # 数据库表名称
class UserDishList(models.Model):
DishID = models.AutoField(primary_key=True) # 自动增长主键
DishName = models.CharField(max_length=50)
DishDescription = models.CharField(max_length=255)
UserID = models.ForeignKey('UserList', on_delete=models.CASCADE, db_column='UserID')
class Meta:
db_table = 'UserDishList' # 数据库表名称
class PopularDishList(models.Model):
DishID = models.IntegerField(primary_key=True)
DishName = models.CharField(max_length=50)
CollectNumber = models.IntegerField()
LikeNumber = models.IntegerField()
WebLink = models.CharField(max_length=255)
class Meta:
db_table = 'PopularDishList'
class MainDishList(models.Model):
DishID = models.IntegerField(primary_key=True)
DishName = models.CharField(max_length=50)
CollectNumber = models.IntegerField()
LikeNumber = models.IntegerField()
WebLink = models.CharField(max_length=255)
stuff = models.CharField(max_length=255)
difficulty = models.CharField(max_length=255)
tags = models.CharField(max_length=255)
tools = models.CharField(max_length=255)
class Meta:
db_table = 'maindishlist'
class CollectDishList(models.Model):
DishID = models.IntegerField(primary_key=True)
DishName = models.CharField(max_length=50)
CollectNumber = models.IntegerField()
LikeNumber = models.IntegerField()
WebLink = models.CharField(max_length=255)
UserID = models.ForeignKey('UserList', on_delete=models.CASCADE, db_column='UserID')
class Meta:
db_table = 'CollectDishList'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save