-
-
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.
Merge pull request #18 from RustamovAkrom/main
Main
- Loading branch information
Showing
60 changed files
with
852 additions
and
335 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
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,68 @@ | ||
name: Lint Code | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "master" | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "master" | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9] | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install OpenSSL | ||
run: sudo apt-get install -y openssl | ||
|
||
- name: Generate private and public keys | ||
run: | | ||
rm -rf security | ||
mkdir -p security | ||
openssl genpkey -algorithm RSA -out security/private_key.pem -pkeyopt rsa_keygen_bits:2048 | ||
openssl rsa -pubout -in security/private_key.pem -out security/public_key.pem | ||
echo "Private key saved as security/private_key.pem" | ||
echo "Public key saved as security/public_key.pem" | ||
- name: Create .env file | ||
run: | | ||
touch .env | ||
echo PRIVATE_KEY_PATH=$(pwd)/security/private_key.pem >> .env | ||
echo PUBLIC_KEY_PATH=$(pwd)/security/public_key.pem >> .env | ||
DJANGO_SETTINGS_MODULE=core.settings.development >> .env | ||
echo DATABASE_ENVIRON=sqlite3 >> .env | ||
- name: Check if .env has been updated | ||
run: cat .env | ||
|
||
- name: Install Dependencies | ||
run: | | ||
pip install flake8 | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Lint Code | ||
run: flake8 . | ||
|
||
- name: Clean up keys (Optional) | ||
run: | | ||
rm -rf security | ||
echo "Keys removed after use." |
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,16 +1,18 @@ | ||
from rest_framework import routers | ||
|
||
from .blog import ( | ||
PostViewSet, | ||
PostCommentViewSet, | ||
PostViewSet, | ||
PostCommentViewSet, | ||
PostCommentLikeViewSet, | ||
PostLikeViewSet, | ||
PostDislikeViewSet | ||
PostDislikeViewSet, | ||
) | ||
|
||
router = routers.DefaultRouter() | ||
router.register("post", PostViewSet, basename="post") | ||
router.register("post_comment", PostCommentViewSet, basename="post-comment") | ||
router.register("post_comment_like", PostCommentLikeViewSet, basename="post-comment-like") | ||
router.register( | ||
"post_comment_like", PostCommentLikeViewSet, basename="post-comment-like" | ||
) | ||
router.register("post_like", PostLikeViewSet, basename="post-like") | ||
router.register("post_dislike", PostDislikeViewSet, basename="post-dislike") |
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 +1 @@ | ||
from .views import * # noqa | ||
from .views import * # noqa |
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 +1 @@ | ||
from .views import * # noqa | ||
from .views import * # noqa |
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 +1 @@ | ||
from .views import * # noqa | ||
from .views import * # noqa |
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 +1 @@ | ||
from .views import * # noqa | ||
from .views import * # noqa |
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 +1 @@ | ||
from .views import * # noqa | ||
from .views import * # noqa |
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,5 +1,5 @@ | ||
from .Post import * # noqa | ||
from .PostComment import * # noqa | ||
from .PostCommentLike import * # noqa | ||
from .PostDislike import * # noqa | ||
from .PostLike import * # noqa | ||
from .Post import * # noqa | ||
from .PostComment import * # noqa | ||
from .PostCommentLike import * # noqa | ||
from .PostDislike import * # noqa | ||
from .PostLike import * # noqa |
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
Oops, something went wrong.