科研管理系统




# models.py
from django.db import models
class Project(models.Model):
title = models.CharField(max_length=200)
description = models.TextField()
start_date = models.DateField()
end_date = models.DateField()
class Researcher(models.Model):
name = models.CharField(max_length=100)
department = models.CharField(max_length=100)
# views.py
from django.shortcuts import render
from .models import Project, Researcher
def project_list(request):
projects = Project.objects.all()
return render(request, 'project_list.html', {'projects': projects})
# urls.py
from django.urls import path
from . import views
urlpatterns = [
path('projects/', views.project_list, name='project_list'),
]