-
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
24 changed files
with
63 additions
and
56 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 |
---|---|---|
|
@@ -12,4 +12,6 @@ __pycache__ | |
coverage.xml | ||
*.sqlite3 | ||
db.sqlite3 | ||
|
||
/myenv | ||
users/__pycache__/ | ||
posts/__pycache__/ |
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,14 +1,10 @@ | ||
FROM python:3.9-alpine3.18 | ||
|
||
COPY requirements.txt /temp/requirements.txt | ||
COPY space-app /space-app | ||
WORKDIR /space-app | ||
COPY . /space_app/ | ||
WORKDIR /space_app/ | ||
EXPOSE 8000 | ||
|
||
RUN apk add postgresql-client build-base postgresql-dev | ||
|
||
RUN pip install -r /temp/requirements.txt | ||
|
||
RUN adduser --disabled-password gagarin | ||
|
||
USER gagarin | ||
RUN pip install --upgrade pip -r /temp/requirements.txt |
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,13 +1,13 @@ | ||
python==">=3.8.1,<4.0" | ||
django=="^4.2.7" | ||
python-dotenv=="^1.0.0" | ||
django-bootstrap5=="^23.3" | ||
aiohttp=="^3.9.1" | ||
requests=="^2.31.0" | ||
celery=="^5.3.6" | ||
redis=="^5.0.1" | ||
flake8=="^6.1.0" | ||
coverage=="^7.3.2" | ||
django-redis=="^5.4.0" | ||
django-debug-toolbar=="^4.2.0" | ||
gunicorn=="^21.2.0" | ||
django==4.2.7 | ||
python-dotenv==1.0.0 | ||
django-bootstrap5==23.3 | ||
aiohttp==3.9.1 | ||
requests==2.31.0 | ||
flake8==6.1.0 | ||
coverage==7.3.2 | ||
django-redis==5.4.0 | ||
django-debug-toolbar==4.2.0 | ||
gunicorn==21.2.0 | ||
psycopg2-binary==2.9.9 | ||
celery[redis]==5.2.7 | ||
celery==5.2.7 |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
File renamed without changes.
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
from .celery import app as celery_app | ||
|
||
__all__ = ('celery_app',) |
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,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class PostsConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'space_app' |
File renamed without changes.
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,17 +1,20 @@ | ||
import os | ||
from celery import Celery | ||
from celery.schedules import crontab | ||
from django.conf import settings | ||
|
||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'space_app.settings') | ||
app = Celery('space_app') | ||
app.config_from_object('django.conf:settings', namespace='CELERY') | ||
app.conf.broker_url = settings.CELERY_BROKER_URL | ||
app.autodiscover_tasks() | ||
|
||
|
||
'''Sending letters every Monday at 8:30''' | ||
app.conf.beat_schedule = { | ||
'send-report-every-single-minute': { | ||
'task': 'space_app.posts.tasks.send_view_count_report', | ||
'task': 'posts.tasks.send_view_count_report', | ||
'schedule': crontab(hour=8, minute=30, day_of_week=1) | ||
}, | ||
} |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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