-
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
1 parent
6549dfd
commit e996d4d
Showing
528 changed files
with
63,994 additions
and
34 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.venv/ | ||
__pycache__/ | ||
*.sqlite3 | ||
.git | ||
.env |
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,18 @@ | ||
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ | ||
|
||
name: Fly Deploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
deploy: | ||
name: Deploy app | ||
runs-on: ubuntu-latest | ||
concurrency: deploy-group # optional: ensure only one action runs at a time | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: superfly/flyctl-actions/setup-flyctl@master | ||
- run: flyctl deploy --remote-only | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |
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,3 +1,4 @@ | ||
.venv/ | ||
__pycache__ | ||
*.sqlite3 | ||
*.sqlite3 | ||
.env |
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,30 @@ | ||
ARG PYTHON_VERSION=3.12-slim | ||
|
||
FROM python:${PYTHON_VERSION} | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
# install psycopg2 dependencies. | ||
RUN apt-get update && apt-get install -y \ | ||
libpq-dev \ | ||
gcc \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir -p /code | ||
|
||
WORKDIR /code | ||
|
||
COPY requirements.txt /tmp/requirements.txt | ||
RUN set -ex && \ | ||
pip install --upgrade pip && \ | ||
pip install -r /tmp/requirements.txt && \ | ||
rm -rf /root/.cache/ | ||
COPY . /code | ||
|
||
ENV SECRET_KEY "sZMGco5qgqThLmYYHCucA47PLoIPySW2Mo1XEddufGfMjK8gpE" | ||
RUN python manage.py collectstatic --noinput | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["gunicorn","--bind",":8000","--workers","2","django_project.wsgi"] |
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,13 +1,21 @@ | ||
from django.contrib import admin | ||
from .models import Article | ||
from .models import Article, Comment | ||
|
||
# Register your models here. | ||
|
||
class CommentInLine(admin.TabularInline): | ||
model = Comment | ||
extra = 0 | ||
|
||
class ArticleAdmin(admin.ModelAdmin): | ||
inlines = [ | ||
CommentInLine, | ||
] | ||
list_display = [ | ||
"title", | ||
"body", | ||
"author", | ||
] | ||
|
||
admin.site.register(Article, ArticleAdmin) | ||
admin.site.register(Comment) |
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,9 @@ | ||
from django import forms | ||
|
||
from .models import Comment | ||
|
||
|
||
class CommentForm(forms.ModelForm): | ||
class Meta: | ||
model = Comment | ||
fields = ("comment",) |
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,45 @@ | ||
# Generated by Django 5.1.3 on 2024-11-29 12:23 | ||
|
||
import django.db.models.deletion | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("articles", "0001_initial"), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Comment", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("comment", models.CharField(max_length=140)), | ||
( | ||
"article", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="articles.article", | ||
), | ||
), | ||
( | ||
"author", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
], | ||
), | ||
] |
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# fly.toml app configuration file generated for newsbucket on 2024-11-29T20:11:32+06:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'newsbucket' | ||
primary_region = 'sin' | ||
console_command = '/code/manage.py shell' | ||
|
||
[build] | ||
|
||
[deploy] | ||
release_command = 'python manage.py migrate --noinput' | ||
|
||
[env] | ||
PORT = '8000' | ||
|
||
[http_service] | ||
internal_port = 8000 | ||
force_https = true | ||
auto_stop_machines = 'stop' | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
processes = ['app'] | ||
|
||
[[vm]] | ||
memory = '1gb' | ||
cpu_kind = 'shared' | ||
cpus = 1 | ||
|
||
[[statics]] | ||
guest_path = '/code/static' | ||
url_prefix = '/static/' |
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,24 @@ | ||
asgiref==3.8.1 | ||
black==24.10.0 | ||
click==8.1.7 | ||
colorama==0.4.6 | ||
crispy-bootstrap5==2024.10 | ||
dj-database-url==2.3.0 | ||
dj-email-url==1.0.6 | ||
Django==5.1.3 | ||
django-cache-url==3.4.5 | ||
django-crispy-forms==2.3 | ||
environs==11.2.1 | ||
gunicorn==23.0.0 | ||
marshmallow==3.23.1 | ||
mypy-extensions==1.0.0 | ||
packaging==24.2 | ||
pathspec==0.12.1 | ||
platformdirs==4.3.6 | ||
psycopg==3.2.3 | ||
psycopg-binary==3.2.3 | ||
python-dotenv==1.0.1 | ||
sqlparse==0.5.2 | ||
typing_extensions==4.12.2 | ||
tzdata==2024.2 | ||
whitenoise==6.8.2 |
Empty file.
Empty file.
Empty file.
Oops, something went wrong.