Skip to content

Commit

Permalink
Update readme, fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
manti-by committed Feb 12, 2024
1 parent 6025cc4 commit 6fbeca6
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 77 deletions.
60 changes: 33 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,57 @@
# Semkov Gorodok blog
# Semkov Gorodok blog

## About
## About

[![Wagtail 2.12](https://img.shields.io/badge/wagtail-2.12-green.svg)](https://pypi.org/project/wagtail/)
[![Wagtail 5.2.2](https://img.shields.io/badge/wagtail-5.2.2-green.svg)](https://pypi.org/project/wagtail/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://bitbucket.org/manti_by/semkov/raw/c61190bd891b532908a64fdbdb1cd53a7f259c87/LICENSE)

Author: Alexander Chaika <manti.by@gmail.com>

Source link: https://github.com/manti-by/semkov

Requirements: Docker, Python 3.9, SQLite
Requirements: Docker, Python 3.11, PostgreSQL


## Setup development environment
## Setup development environment

1. Install virtualenv and sqlite3
1. Create and activate virtualenv

$ sudo apt install virtualenv sqlite3
```shell
virtualenv .venv
source .venv/bin/activate
```

2. Install, create and activate virtualenv
2. Clone sources and install pip packages

$ pip install virtualenv
$ virtualenv -p python3 --no-site-packages --prompt=smk- venv
$ source venv/bin/activate
```shell
git clone git@github.com:manti-by/semkov.git .
pip install -r requirements.txt
```

3. Clone sources and install pip packages

$ git clone git@github.com:manti-by/semkov.git && cd semkov/
$ pip install -r requirements/dev.txt
3. Run migration and local dev server

4. Run migration and local dev server
```shell
python manage.py migrate
python manage.py runserver
```

$ python manage.py migrate
$ python manage.py runserver


**NOTICE**: Before pushing your changes, run next commands

$ make check
**NOTICE**: Before pushing your changes, run the next commands

```shell
make django-check
make check
make test
```

## Run in production

To run app in production mode, clone repo, build image and run it

$ git clone git@github.com:manti-by/semkov.git && cd semkov/
$ make build
$ docker-compose up -d
$ make migrate static
```shell
git clone git@github.com:manti-by/semkov.git .
make build
docker compose up -d
make migrate
make static
```
29 changes: 6 additions & 23 deletions config/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
server {
if ($host = www.semkov-gorodok.by) {
return 301 https://$host$request_uri;
} # managed by Certbot


if ($host = semkov-gorodok.by) {
return 301 https://$host$request_uri;
} # managed by Certbot


listen 80;
http2 on;
server_name semkov-gorodok.by www.semkov-gorodok.by;
return 301 https://semkov-gorodok.by$request_uri;




}

server {
listen 443 ssl;
http2 on;
server_name www.semkov-gorodok.by;
return 404;
return 301 https://semkov-gorodok.by$request_uri;

include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
ssl_certificate /etc/letsencrypt/live/semkov-gorodok.by/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/semkov-gorodok.by/privkey.pem; # managed by Certbot

return 301 https://semkov-gorodok.by$request_uri;

ssl_certificate /etc/letsencrypt/live/semkov-gorodok.by/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/semkov-gorodok.by/privkey.pem;
}

server {
listen 443 ssl;
http2 on;
server_name semkov-gorodok.by;

charset utf-8;
client_max_body_size 10M;

Expand Down Expand Up @@ -111,8 +95,7 @@ server {

include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
ssl_certificate /etc/letsencrypt/live/semkov-gorodok.by/fullchain.pem; # managed by Certbot

ssl_certificate /etc/letsencrypt/live/semkov-gorodok.by/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/semkov-gorodok.by/privkey.pem;
# managed by Certbot
}

2 changes: 1 addition & 1 deletion config/proxy-params.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Authorization '';

proxy_buffering off;
proxy_redirect off;
proxy_redirect off;
2 changes: 1 addition & 1 deletion semkov/static/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ main.home .main-menu li li a {

main.home .main-menu li li a:hover {
color: #bf4b31;
}
}
6 changes: 3 additions & 3 deletions semkov/static/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ button.secondary:hover {
background-color: #9F9F9F;
}

button.primary.focus,
button.primary.focus,
button.outline.primary:focus {
box-shadow: 0 0 0 0.2rem rgba(255, 111, 97, .5);
}
Expand Down Expand Up @@ -488,7 +488,7 @@ article .read-more {
article .info .left,
article .info .right {
width: 50%;
}
}

article .info .left,
article .info .right {
Expand Down Expand Up @@ -629,4 +629,4 @@ article .map {
display: block;
opacity: .5;
transition: all .15s;
}
}
4 changes: 2 additions & 2 deletions semkov/static/css/responsive.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
max-width: initial;
font-size: 2.5rem;
}

main.home h1 {
padding: 1rem 0 1.25rem;
}
Expand Down Expand Up @@ -261,4 +261,4 @@
main.home .main-menu li li:first-child:before {
display: none;
}
}
}
2 changes: 1 addition & 1 deletion semkov/static/css/schedule.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@

.position tr:hover {
background-color: #c6e0c5;
}
}
30 changes: 15 additions & 15 deletions semkov/static/manifest.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
{
"name": "Semkov Gorodok",
"short_name": "Semkov Gorodok",
"start_url": "https://semkov-gorodok.by/",
"display": "standalone",
"background_color": "#FFFFFF",
"theme_color": "#ff6f61",
"display": "standalone",
"icons": [
{
"src": "/static/img/appicon/18x18.png",
"sizes": "18x18",
"src": "/static/img/appicon/18x18.png",
"type": "image/png"
},
{
"src": "/static/img/appicon/24x24.png",
"sizes": "24x24",
"src": "/static/img/appicon/24x24.png",
"type": "image/png"
},
{
"src": "/static/img/appicon/36x36.png",
"sizes": "36x36",
"src": "/static/img/appicon/36x36.png",
"type": "image/png"
},
{
"src": "/static/img/appicon/48x48.png",
"sizes": "48x48",
"src": "/static/img/appicon/48x48.png",
"type": "image/png"
},
{
"src": "/static/img/appicon/72x72.png",
"sizes": "72x72",
"src": "/static/img/appicon/72x72.png",
"type": "image/png"
},
{
"src": "/static/img/appicon/96x96.png",
"sizes": "96x96",
"src": "/static/img/appicon/96x96.png",
"type": "image/png"
},
{
"src": "/static/img/appicon/144x144.png",
"sizes": "144x144",
"src": "/static/img/appicon/144x144.png",
"type": "image/png"
},
{
"src": "/static/img/appicon/192x192.png",
"sizes": "192x192",
"src": "/static/img/appicon/192x192.png",
"type": "image/png"
}
]
}
],
"name": "Semkov Gorodok",
"short_name": "Semkov Gorodok",
"start_url": "https://semkov-gorodok.by/",
"theme_color": "#ff6f61"
}
2 changes: 1 addition & 1 deletion semkov/static/robots.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
User-agent: *
User-agent: *
2 changes: 1 addition & 1 deletion semkov/static/svg/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion semkov/static/svg/menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion semkov/templates/ads/ads_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ <h3 class="title">
<button type="submit" class="primary">{% trans 'Submit' %}</button>
</form>
</div>
</div>
</div>

0 comments on commit 6fbeca6

Please sign in to comment.