A Django-based web application for managing student portfolios and projects. This system allows students to showcase their work and enables administrators to manage student profiles, portfolios, and projects.
- User Authentication: Complete login/logout system with user registration
- Role-Based Permissions: Model-level permissions for create, edit, and delete operations
- Automated User Setup: New users automatically assigned to 'student' group with appropriate permissions
- Portfolio Management: Create, update, and display student portfolios
- Project Showcase: Add and manage projects within portfolios
- Student Profiles: Maintain student information with major selections
- Search Functionality: Search through portfolios, projects, and students
- Permission-Based UI: Action buttons shown/hidden based on user permissions
- Responsive Design: Bootstrap 5 integration with dark mode support
- Media Support: Upload and manage project images and files
- Pagination: Organized display of large datasets
- Backend: Django 5.2.6
- Frontend: Django Templates with Bootstrap 5
- Database: SQLite3 (development)
- Python Version: 3.12
- Additional Libraries:
- django-bootstrap5 (25.2)
- asgiref (3.9.1)
- sqlparse (0.5.3)
git clone https://github.com/KennethPyron/portfolio.git
cd portfoliopython -m venv djvenv
source djvenv/bin/activate # On Windows: djvenv\Scripts\activatepip install -r requirment.txtpython manage.py migratepython manage.py setup_permissionsThis command creates the 'student' group and assigns appropriate permissions for portfolio and project management.
python manage.py createsuperuserpython manage.py runserver- Application: http://127.0.0.1:8000/
- Admin Panel: http://127.0.0.1:8000/admin/
portfolio/
├── django_project/ # Main project settings
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── portfolio_app/ # Main application
│ ├── models.py # Database models
│ ├── views.py # View logic
│ ├── forms.py # Form definitions
│ ├── urls.py # URL routing
│ ├── management/ # Custom management commands
│ │ └── commands/
│ │ └── setup_permissions.py # Sets up groups and permissions
│ ├── templates/ # HTML templates
│ │ ├── portfolio_app/ # App templates
│ │ └── registration/ # Auth templates (login, register, etc.)
│ └── static/ # CSS, JS, images
├── media/ # User-uploaded files
├── static/ # Static files
├── db.sqlite3 # Database file
├── manage.py # Django management script
└── requirment.txt # Project dependencies
- Name, email, and major information
- Supported majors: Computer Science (BS/BA/BI), Computer Engineering, Game Design, Computer Security, Data Analytics
- One-to-one relationship with Portfolio
- Title, about section, and contact email
- Active/inactive status for display control
- One-to-one relationship with Student
- One-to-many relationship with Projects
- Title and description
- Belongs to a Portfolio
- Support for project details and media
- New users can register at
/accounts/register - Upon registration, users are automatically:
- Assigned to the 'student' group
- Given a Student profile
- Provided with an initial Portfolio
- Can: Create, edit, delete portfolios and projects
- Can: View and edit their own student profile
- Cannot: Create or delete student records
- Full access to all operations
- Can create and delete student records
- Access to Django admin panel
- Login:
/accounts/login/ - Logout:
/accounts/logout/ - Password Reset: Available via login page
- Register at
/accounts/register - Login with your credentials
- Your portfolio is automatically created
- Add projects to showcase your work
- Edit your portfolio to make it active for public display
- Login to your account
- Create and manage portfolios
- Add projects with descriptions
- Keep your portfolio active to display on the public homepage
- Edit your profile information
- Access the admin panel at
/admin - Manage students, portfolios, and projects
- Review and approve content
- Create or delete student records (staff-only)
- Homepage: Displays all active portfolios with search capability
- Portfolio Detail: View comprehensive portfolio information and associated projects
- Project Management: Full CRUD operations for projects (permission-based)
- Student Directory: Browse and search all registered students
- Authentication: Secure login system with role-based permissions
- Permission-Based UI: Buttons and actions appear only if user has required permissions
- Automated Setup: Custom management command for setting up groups and permissions
Key settings in django_project/settings.py:
MEDIA_ROOT: User-uploaded files storageSTATIC_ROOT: Static files locationLOGIN_REDIRECT_URL: Redirect after successful login (/)LOGOUT_REDIRECT_URL: Redirect after logout (/)LOGIN_URL: URL for login page (/accounts/login/)DEBUG: Set toFalsein production
Sets up the 'student' group with appropriate permissions:
python manage.py setup_permissionsThis command:
- Creates the 'student' group if it doesn't exist
- Assigns permissions for Portfolio (add, change, delete, view)
- Assigns permissions for Project (add, change, delete, view)
- Assigns permissions for Student (change, view only)
- Displays all configured permissions
When to run:
- After initial setup (before first registration)
- After database reset
- When permission structure changes
- Change
SECRET_KEYin settings.py - Set
DEBUG = False - Configure
ALLOWED_HOSTS - Use a production-grade database (PostgreSQL, MySQL)
- Set up proper static file serving
- Implement HTTPS
- Configure email backend for password resets
- Review and adjust permission structure as needed
- All passwords are hashed using Django's PBKDF2 algorithm
- CSRF protection enabled on all forms
- Permission decorators enforce model-level access control
@login_requiredon all create/edit/delete views@permission_requiredchecks specific permissions withraise_exception=True
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request