-
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
7 changed files
with
142 additions
and
1 deletion.
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 |
---|---|---|
@@ -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 |
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 @@ | ||
web: python manage.py runserver 0.0.0.0:\$PORT |
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,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/ |
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,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 | ||
)/ | ||
''' |
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 @@ | ||
python-3.9.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
exclude = .git,.tox,*/migrations/* | ||
max-line-length = 119 |