Skip to content

Commit

Permalink
files added
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronik22 committed Jul 24, 2022
1 parent c37f6ba commit 8948360
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# https://editorconfig.org/

root = true

[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

# Docstrings and comments use max_line_length = 79
[*.py]
max_line_length = 119

# Use 4 spaces for the HTML files
[*.html]
indent_size = 4

# The JSON files contain newlines inconsistently
[*.json]
indent_size = 2
insert_final_newline = ignore

[**/admin/js/vendor/**]
indent_style = ignore
indent_size = ignore

# Minified JavaScript files shouldn't be changed
[**.min.js]
indent_style = ignore
insert_final_newline = ignore

# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab

# Batch files use tabs for indentation
[*.bat]
indent_style = tab

[docs/**.txt]
max_line_length = 79

[*.yml]
indent_size = 2
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: python manage.py runserver 0.0.0.0:\$PORT
52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,52 @@
# website-change-detector
Detects website changes (full/part of) using image/html/text comparisons
- Detects website changes (full/part of) using image / html / text comparisons and emails the user a file with the changes highlighted.

- User can set a threshold value (default = 1.0).

- For tracking a part of webpage use XPath of the element.

## Adding env variables

- Add env variables to ".env.test" and rename it to ".env"

## Installation

```bash
$ python -m venv venv
$ source venv/Scripts/activate
(venv) pip install -r requirements.txt
(venv) cd website-change-detector
(venv) python manage.py makemigrations
(venv) python manage.py migrate
(venv) python manage.py createsuperuser
(venv) python manage.py runserver
```

## Celery run command

Run both commands on separate terminals

```bash
celery -A website_change_detector.celery worker --pool=solo -l info
celery -A website_change_detector beat -l info
```

If you want to run in background
```bash
celery -A website_change_detector.celery worker --pool=solo -l info --logfile=celery.log --detach
celery -A website_change_detector beat -l info --logfile=celery.beat.log --detach
```

## Running Tests

To run tests, run the following command

```bash
python manage.py test
```

## Deploy to Heroku

https://devcenter.heroku.com/articles/getting-started-with-python

https://realpython.com/django-hosting-on-heroku/
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tool.black]
line-length = 119
target-version = ['py38']
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| migrations
)/
'''
20 changes: 20 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ amqp==5.1.1
asgiref==3.5.2
async-timeout==4.0.2
billiard==3.6.4.0
black==22.6.0
celery==5.2.7
certifi==2022.6.15
charset-normalizer==2.1.0
click==8.1.3
click-didyoumean==0.3.0
click-plugins==1.1.1
Expand All @@ -12,28 +15,45 @@ Deprecated==1.2.13
Django==4.0.5
django-celery-beat==2.3.0
django-celery-results==2.4.0
django-crispy-forms==1.14.0
django-environ==0.9.0
django-timezone-field==5.0
flake8==4.0.1
idna==3.3
imageio==2.19.3
jarowinkler==1.2.0
kombu==5.2.4
loguru==0.6.0
lxml==4.9.1
mccabe==0.6.1
mypy-extensions==0.4.3
networkx==2.8.4
numpy==1.23.0
opencv-python==4.6.0.66
packaging==21.3
pathspec==0.9.0
Pillow==9.1.1
platformdirs==2.5.2
prompt-toolkit==3.0.30
pycodestyle==2.8.0
pyflakes==2.4.0
pyparsing==3.0.9
python-crontab==2.6.0
python-dateutil==2.8.2
pytz==2022.1
PyWavelets==1.3.0
rapidfuzz==2.2.0
redis==4.3.4
requests==2.28.1
scikit-image==0.19.3
scipy==1.8.1
six==1.16.0
sqlparse==0.4.2
tifffile==2022.5.4
tomli==2.0.1
typing-extensions==4.3.0
tzdata==2022.1
urllib3==1.26.10
vine==5.0.0
wcwidth==0.2.5
win32-setctime==1.1.0
Expand Down
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.9.1
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
exclude = .git,.tox,*/migrations/*
max-line-length = 119

0 comments on commit 8948360

Please sign in to comment.