Skip to content

Commit f5bd03b

Browse files
Merge pull request #8 from RustamovAkrom/main
Main
2 parents d971dda + b1af258 commit f5bd03b

File tree

96 files changed

+3623
-3618
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3623
-3618
lines changed

.env-example

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
#!/bin/bash
2-
3-
#### Django secret key ####
4-
SECRET_KEY=SECRET_KEY
5-
6-
#### Django debug mode default True ####
7-
DEBUG=True
8-
9-
#### Django allowed hosts default localhost, 127.0.0.1 ####
10-
ALLOWED_HOSTS=localhost,127.0.0.1
11-
12-
#### JWT (RS256) private, public keys default ####
13-
PRIVATE_KEY_PATH=security_settings/private_key.pem
14-
PUBLIC_KEY_PATH=security_settings/public_key.pem
15-
16-
#### Django database environs sqlite, postgres ####
17-
DATABASE_ENVIRON=sqlite
18-
19-
#### PostgreSQL configurations ####
20-
POSTGRES_NAME=POSTGRES_NAME
21-
POSTGRES_USER=POSTGRES_USER
22-
POSTGRES_PASSWORD=POSTGRES_PASSWORD
23-
POSTGRES_HOST=localhost
24-
POSTGRES_PORT=5432
1+
#!/bin/bash
2+
3+
#### Django secret key ####
4+
SECRET_KEY=SECRET_KEY
5+
6+
#### Django debug mode default True ####
7+
DEBUG=True
8+
9+
#### Django allowed hosts default localhost, 127.0.0.1 ####
10+
ALLOWED_HOSTS=localhost,127.0.0.1
11+
12+
#### JWT (RS256) private, public keys default ####
13+
PRIVATE_KEY_PATH=security_settings/private_key.pem
14+
PUBLIC_KEY_PATH=security_settings/public_key.pem
15+
16+
#### Django database environs sqlite, postgres ####
17+
DATABASE_ENVIRON=sqlite
18+
19+
#### PostgreSQL configurations ####
20+
POSTGRES_NAME=POSTGRES_NAME
21+
POSTGRES_USER=POSTGRES_USER
22+
POSTGRES_PASSWORD=POSTGRES_PASSWORD
23+
POSTGRES_HOST=localhost
24+
POSTGRES_PORT=5432

.flake8

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
[flake8]
2-
# Maximum allowed line length (PEP8 recommends 79, but you can set 88 for flexibility)
3-
max-line-length = 88
4-
5-
# Ignore specific errors and warnings
6-
# E501: Line too long
7-
# W503: Line break occurred before a binary operator (preference to W504 in black formatting)
8-
# E231: Missing whitespace after ','
9-
# Customize based on your needs
10-
ignore = E501, W503, E231
11-
12-
# Exclude specific directories (e.g., migrations, static files, or virtual environments)
13-
exclude =
14-
.git,
15-
__pycache__,
16-
migrations,
17-
static,
18-
env, # your virtual environment directory
19-
20-
# Enable checking for complexity
21-
max-complexity = 10
22-
23-
# Show the source code that caused the issue
24-
show-source = True
25-
26-
# Format errors in a certain way (useful for linting tools integration)
27-
format = %(path)s:%(row)d:%(col)d: %(code)s %(text)s
1+
[flake8]
2+
# Maximum allowed line length (PEP8 recommends 79, but you can set 88 for flexibility)
3+
max-line-length = 88
4+
5+
# Ignore specific errors and warnings
6+
# E501: Line too long
7+
# W503: Line break occurred before a binary operator (preference to W504 in black formatting)
8+
# E231: Missing whitespace after ','
9+
# Customize based on your needs
10+
ignore = E501, W503, E231
11+
12+
# Exclude specific directories (e.g., migrations, static files, or virtual environments)
13+
exclude =
14+
.git,
15+
__pycache__,
16+
migrations,
17+
static,
18+
env, # your virtual environment directory
19+
20+
# Enable checking for complexity
21+
max-complexity = 10
22+
23+
# Show the source code that caused the issue
24+
show-source = True
25+
26+
# Format errors in a certain way (useful for linting tools integration)
27+
format = %(path)s:%(row)d:%(col)d: %(code)s %(text)s

.github/FUNDING.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# These are supported funding model platforms
2-
3-
github: [RustamovAkrom] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: AkromRustamov # Replace with a single Patreon username
5-
open_collective: # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12-
polar: # Replace with a single Polar username
13-
buy_me_a_coffee: akromjonru1 # Replace with a single Buy Me a Coffee username
14-
thanks_dev: rustamovakrom # Replace with a single thanks.dev username
15-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
1+
# These are supported funding model platforms
2+
3+
github: [RustamovAkrom] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: AkromRustamov # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: akromjonru1 # Replace with a single Buy Me a Coffee username
14+
thanks_dev: rustamovakrom # Replace with a single thanks.dev username
15+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
---
2-
name: Bug report
3-
about: Create a report to help us improve
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
8-
---
9-
10-
**Describe the bug**
11-
A clear and concise description of what the bug is.
12-
13-
**To Reproduce**
14-
Steps to reproduce the behavior:
15-
1. Go to '...'
16-
2. Click on '....'
17-
3. Scroll down to '....'
18-
4. See error
19-
20-
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
22-
23-
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
25-
26-
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
30-
31-
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
36-
37-
**Additional context**
38-
Add any other context about the problem here.
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.

.github/workflows/django.yml

Lines changed: 66 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,66 @@
1-
name: Django CI
2-
3-
on:
4-
push:
5-
branches: [ "master" ]
6-
pull_request:
7-
branches: [ "master" ]
8-
9-
jobs:
10-
build:
11-
12-
runs-on: ubuntu-latest
13-
strategy:
14-
max-parallel: 4
15-
matrix:
16-
python-version: [3.8, 3.9]
17-
18-
steps:
19-
- name: Check out the repository
20-
uses: actions/checkout@v4
21-
22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v3
24-
with:
25-
python-version: ${{ matrix.python-version }}
26-
- name: Install OpenSSl
27-
uses: sudo apt-get install openssl
28-
29-
- name: Generate private and public keys
30-
uses: |
31-
mkdir -p security
32-
33-
openssl rsa -pubout -in security/private_key.pem -out security/public_key.pem
34-
35-
echo "Private key saved as security/private_key.pem"
36-
echo "Public key saved as security/public_key.pem"
37-
38-
- name: Create .env file
39-
run: |
40-
touch .env
41-
echo PRIVATE_KEY_PATH=${{ secrets.PRIVATE_KEY_PATH }} >> .env
42-
echo PUBLIC_KEY_PATH=${{ secrets.PUBLIC_KEY_PATH }} >> .env
43-
44-
- name: Check if .env has been updated
45-
run: |
46-
cat .env
47-
48-
- name: Clean up keys (Optional)
49-
run: |
50-
rm -rf security
51-
echo "Keys removed after use."
52-
53-
- name: Install Dependencies
54-
run: |
55-
python -m pip install --upgrade pip
56-
pip install -r requirements.txt
57-
58-
- name: Run Tests
59-
run: |
60-
python manage.py test
1+
name: Django CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
- "master"
8+
pull_request:
9+
branches:
10+
- "main"
11+
- "master"
12+
13+
jobs:
14+
15+
build:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: [3.8, 3.9]
20+
21+
steps:
22+
- name: Check out the repository
23+
uses: actions/checkout@v4 # This is an action, so it uses 'uses'
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v3 # This is an action, so it uses 'uses'
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install OpenSSL
31+
run: sudo apt-get install -y openssl # This is a command, so it uses 'run'
32+
33+
- name: Generate private and public keys
34+
run: |
35+
# Очистка старых файлов перед созданием новых
36+
rm -rf security
37+
mkdir -p security
38+
39+
# Генерация приватного и публичного ключа
40+
openssl genpkey -algorithm RSA -out security/private_key.pem -pkeyopt rsa_keygen_bits:2048
41+
openssl rsa -pubout -in security/private_key.pem -out security/public_key.pem
42+
43+
echo "Private key saved as security/private_key.pem"
44+
echo "Public key saved as security/public_key.pem"
45+
46+
- name: Create .env file
47+
run: |
48+
touch .env
49+
echo PRIVATE_KEY_PATH=$(pwd)/security/private_key.pem >> .env
50+
echo PUBLIC_KEY_PATH=$(pwd)/security/public_key.pem >> .env
51+
52+
- name: Check if .env has been updated
53+
run: cat .env # This is a command, so it uses 'run'
54+
55+
- name: Install Dependencies
56+
run: |
57+
python -m pip install --upgrade pip
58+
pip install -r requirements.txt # This is a command, so it uses 'run'
59+
60+
- name: Run Tests
61+
run: python manage.py test # This is a command, so it uses 'run'
62+
63+
- name: Clean up keys (Optional)
64+
run: |
65+
rm -rf security
66+
echo "Keys removed after use." # This is a command, so it uses 'run'

0 commit comments

Comments
 (0)