-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
192 changed files
with
57,861 additions
and
1,066 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
fly.toml | ||
.git/ | ||
venv/ | ||
__pycache__/ | ||
.github/ | ||
.gitignore | ||
.hooks/ | ||
.pytest_cache/ | ||
.__pycache__ | ||
.ruff_cache | ||
.uv_cache | ||
.vscode/ | ||
.test/ | ||
.pytest_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
option_settings: | ||
aws:elasticbeanstalk:container:python: | ||
WSGIPath: portfolio.wsgi:application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Resources: | ||
AWSEBAutoScalingGroup: | ||
Type: AWS::AutoScaling::AutoScalingGroup | ||
Properties: | ||
LaunchTemplate: | ||
LaunchTemplateId: "lt-05d56f3471ff59142" | ||
Version: "$Latest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,3 +165,4 @@ cython_debug/ | |
.elasticbeanstalk/* | ||
!.elasticbeanstalk/*.cfg.yml | ||
!.elasticbeanstalk/*.global.yml | ||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
version: "3.12" | ||
|
||
services: | ||
web: | ||
image: portfolio | ||
build: . | ||
ports: | ||
- "8000:8000" | ||
command: gunicorn --bind 0.0.0.0:8000 portfolio.wsgi:application | ||
volumes: | ||
- .:/app | ||
expose: | ||
- "8000" | ||
env_file: | ||
- .env | ||
environment: | ||
DJANGO_SETTINGS_MODULE: portfolio.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Generated by Django 5.1.2 on 2024-10-25 20:46 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('home', '0010_remove_project_technologies_used'), | ||
] | ||
|
||
operations = [ | ||
migrations.DeleteModel( | ||
name='Contact', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,65 @@ | ||
from django.db import models | ||
from django.db.models import ( | ||
Model, | ||
CharField, | ||
TextField, | ||
URLField, | ||
ForeignKey, | ||
ManyToManyField, | ||
IntegerField, | ||
AutoField, | ||
CASCADE, | ||
) | ||
from django.core.validators import MinValueValidator, MaxValueValidator | ||
|
||
# Create your models here. | ||
|
||
class Category(models.Model): | ||
name = models.CharField(max_length=100) | ||
tag = models.CharField(max_length=100) | ||
rank = models.IntegerField(validators=[MinValueValidator(0), MaxValueValidator(10)]) | ||
def __str__(self): | ||
return self.name | ||
|
||
class Project(models.Model): | ||
id = models.AutoField(primary_key=True) | ||
name = models.CharField(max_length=200) | ||
short_description = models.CharField(max_length=300) | ||
description = models.TextField() | ||
category = models.ForeignKey(Category, on_delete=models.CASCADE) | ||
github_link = models.URLField(blank=True, null=True) | ||
demo_link = models.URLField(blank=True, null=True) | ||
img = models.CharField(max_length=200) | ||
skills = models.ManyToManyField('Skill') | ||
rank = models.IntegerField(validators=[MinValueValidator(0), MaxValueValidator(10)]) | ||
class Category(Model): | ||
name: CharField = CharField(max_length=100) | ||
tag: CharField = CharField(max_length=100) | ||
rank: IntegerField = IntegerField( | ||
validators=[MinValueValidator(0), MaxValueValidator(10)] | ||
) | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
|
||
class Contact(models.Model): | ||
name = models.CharField(max_length=30) | ||
email = models.EmailField() | ||
subject = models.CharField(max_length=20) | ||
message = models.TextField(max_length=40) | ||
|
||
|
||
|
||
class Project(Model): | ||
id: AutoField = AutoField(primary_key=True) | ||
name: CharField = CharField(max_length=200) | ||
short_description: CharField = CharField(max_length=300) | ||
description: TextField = TextField() | ||
category: ForeignKey = ForeignKey(Category, on_delete=CASCADE) | ||
github_link: URLField = URLField(blank=True, null=True) | ||
demo_link: URLField = URLField(blank=True, null=True) | ||
img: CharField = CharField(max_length=200) | ||
skills: ManyToManyField = ManyToManyField('Skill') | ||
rank: IntegerField = IntegerField( | ||
validators=[MinValueValidator(0), MaxValueValidator(10)] | ||
) | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
class SkillCategory(models.Model): | ||
name = models.CharField(max_length=100) | ||
tag = models.CharField(max_length=100) | ||
rank = models.IntegerField(validators=[MinValueValidator(0), MaxValueValidator(10)]) | ||
|
||
|
||
class SkillCategory(Model): | ||
name: CharField = CharField(max_length=100) | ||
tag: CharField = CharField(max_length=100) | ||
rank: IntegerField = IntegerField( | ||
validators=[MinValueValidator(0), MaxValueValidator(10)] | ||
) | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
class Skill(models.Model): | ||
name = models.CharField(max_length=100) | ||
category = models.ForeignKey(SkillCategory, on_delete=models.CASCADE) | ||
level = models.IntegerField(validators=[MinValueValidator(0), MaxValueValidator(100)]) | ||
|
||
class Skill(Model): | ||
name: CharField = CharField(max_length=100) | ||
category: ForeignKey = ForeignKey(SkillCategory, on_delete=CASCADE) | ||
level: IntegerField = IntegerField( | ||
validators=[MinValueValidator(0), MaxValueValidator(100)] | ||
) | ||
|
||
def __str__(self): | ||
return self.name | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
from django.shortcuts import render | ||
from home import models | ||
# Create your views here. | ||
from home.models import ( | ||
Project, | ||
Category, | ||
SkillCategory, | ||
Skill, | ||
) | ||
from django.http import ( | ||
HttpRequest, | ||
HttpResponse, | ||
) | ||
|
||
def home(request): | ||
projects = models.Project.objects.order_by('rank', 'name') | ||
categories = models.Category.objects.order_by('rank', 'name') | ||
skill_categories = models.SkillCategory.objects.order_by('rank', 'name') | ||
skills = models.Skill.objects.order_by('-level', ) | ||
return render(request, 'home.html', {'projects': projects, 'categories': categories, 'skill_categories': skill_categories, 'skills': skills}) | ||
|
||
def contact(request): | ||
if request.method == 'POST': | ||
name = request.POST['name'] | ||
email = request.POST['email'] | ||
subject = request.POST['subject'] | ||
message = request.POST['message'] | ||
contact = models.Contact(name=name, email=email, subject=subject, message=message) | ||
contact.save() | ||
return render(request, 'contact.html') | ||
def home(request: HttpRequest) -> HttpResponse: | ||
projects = Project.objects.order_by('rank', 'name') | ||
categories = Category.objects.order_by('rank', 'name') | ||
skill_categories = SkillCategory.objects.order_by('rank', 'name') | ||
skills = Skill.objects.order_by( | ||
'-level', | ||
) | ||
return render( | ||
request, | ||
'home.html', | ||
{ | ||
'projects': projects, | ||
'categories': categories, | ||
'skill_categories': skill_categories, | ||
'skills': skills, | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
worker_processes 1; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
upstream django { | ||
server web:8000; # This connects to the Gunicorn container named 'web' running on port 8000 | ||
} | ||
|
||
server { | ||
listen 80; | ||
|
||
# Serve static files directly | ||
location /static/ { | ||
alias /app/staticfiles/; # This is the directory where Django collects static files | ||
} | ||
|
||
# Serve media files directly | ||
location /media/ { | ||
alias /app/media/; # This is the directory where media files are stored | ||
} | ||
|
||
# All other requests will be proxied to the Django application | ||
location / { | ||
proxy_pass http://django; # Passes all requests to Gunicorn | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
} |
Oops, something went wrong.