This is a personal portfolio web application built with Python 3.12 and Django 5. The app is designed to showcase your skills and projects as a web developer, with a user-friendly interface and responsive design. It includes a dedicated section for listing skills and projects, where users can explore the various skills you've mastered and the projects you've worked on.
The app leverages a many-to-many relationship between skills and projects, allowing for flexible representation of how your expertise applies to different projects. Additionally, the application includes a contact form with responsive frontend validation as well as robust backend validation to ensure secure and effective communication.
- Two Django models: Skill and Project.
- Many-to-many relationship between Skill and Project.
- Separate sections for displaying skills and projects.
- Responsive Contact Form:
- Includes frontend validation using JavaScript for a smooth user experience.
- Backend validation ensures that the form submissions are secure and meet the required criteria.
- Database:
- Uses PostgreSQL for data storage.
- Fully integrated with Docker Compose for development, allowing for an isolated and consistent development environment.
- Dockerized Development:
- The application uses Docker Compose to manage the development environment.
- Easily deploy and manage the app and its dependencies using Docker.
- Management Commands:
- Custom Django management commands are provided to populate the Skill and Project tables with dummy data.
- Important: The Skill table must be populated before the Project table due to the many-to-many relationship.
- Figma Design File:
- An associated Figma design file for the portfolio can be found here.
- Python 3.12
- Django 5.0.7
- Docker & Docker Compose
- PostgreSQL
- Clone the repository
git clone https://github.com/jakegodsall/portfolio_site cd portfolio_site
- Set up the environment.
- Create a
.env
file in the project root (you can copy from.env.example
) and fill in the necessary environment variables.
- Create a
- Build and run the application with Docker compose
docker-compose up --build
- Run migrations
docker-compose exec web python manage.py migrate
- Populate the database with the dummy data
docker-compose exec web python manage.py load_skill_data.py docker-compose exec web python manage.py load_project_data.py
- Set up npm to watch the changes in the Sass stylesheets:
npm install npm run sass
- Access the application at
http://localhost:8000
.
This section explains how to deploy using Heroku, including adding a PostgreSQL addon, and general configuration.
- Create a new Heroku app.
heroku create portfolio_site
- Add the PostgreSQL addon.
heroku addons:create heroku-postgresql:essential-0
- Configure the environment variables
Note that this
heroku config:set DJANGO_ENV=production
DJANGO_ENV
environment variable is used to choose the appropriate settings file:You may also need to set other environment variables such as# manage.py # Determine the environment env = os.getenv('DJANGO_ENV', 'development') # Default to development # Set the settings module if env == 'development': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portfolio_site.settings.development') elif env == 'production': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portfolio_site.settings.production') else: raise ValueError(f"Unknown DJANGO_ENV: {env}")
SECRET_KEY
,ALLOWED_HOSTS
, etc., according to your project’s needs:heroku config:set SECRET_KEY=your-secret-key heroku config:set ALLOWED_HOSTS=your-app-name.herokuapp.com
- Create a
Procfile
in the root of the project (already included in this repository)web: gunicorn portfolio_site.wsgi --log-file -
- Deploy the application
git add . git commit -m "Deploying to Heroku" git push heroku main
This project is licensed under the MIT License. See the LICENSE for more details.