status-checker 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
File without changes
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: status_checker
3
+ Version: 0.1.0
4
+ Summary: Un petit package Django qui ckeck a disponibilite des pages web
5
+ Author: ynaffit_aes
6
+ Author-email: aramsamb02@gmail.com
7
+ License: MIT
8
+ Classifier: Environment :: Web Environment
9
+ Classifier: Framework :: Django
10
+ Classifier: Framework :: Django :: 4.0
11
+ Classifier: Framework :: Django :: 5.0
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Internet :: WWW/HTTP
17
+ Description-Content-Type: text/markdown
18
+ Requires-Dist: django>=4.0
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: classifier
22
+ Dynamic: description-content-type
23
+ Dynamic: license
24
+ Dynamic: requires-dist
25
+ Dynamic: summary
File without changes
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,28 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name='status_checker',
5
+ version='0.1.0',
6
+ packages=find_packages(),
7
+ include_package_data=True,
8
+ license='MIT',
9
+ description='Un petit package Django qui ckeck a disponibilite des pages web ',
10
+ long_description=open('README.md', encoding='utf-8').read(),
11
+ long_description_content_type='text/markdown',
12
+ author='ynaffit_aes',
13
+ author_email='aramsamb02@gmail.com',
14
+ classifiers=[
15
+ 'Environment :: Web Environment',
16
+ 'Framework :: Django',
17
+ 'Framework :: Django :: 4.0',
18
+ 'Framework :: Django :: 5.0',
19
+ 'Intended Audience :: Developers',
20
+ 'License :: OSI Approved :: MIT License',
21
+ 'Programming Language :: Python',
22
+ 'Programming Language :: Python :: 3',
23
+ 'Topic :: Internet :: WWW/HTTP',
24
+ ],
25
+ install_requires=[
26
+ 'django>=4.0',
27
+ ],
28
+ )
File without changes
@@ -0,0 +1,3 @@
1
+ from django.contrib import admin
2
+
3
+ # Register your models here.
@@ -0,0 +1,6 @@
1
+ from django.apps import AppConfig
2
+
3
+
4
+ class StatusCheckerConfig(AppConfig):
5
+ default_auto_field = 'django.db.models.BigAutoField'
6
+ name = 'status_checker'
@@ -0,0 +1,4 @@
1
+ from django import forms
2
+
3
+ class URLForm(forms.Form):
4
+ url = forms.URLField(label="Enter a website URL", widget=forms.URLInput(attrs={'placeholder': 'https://example.com'}))
@@ -0,0 +1,3 @@
1
+ from django.db import models
2
+
3
+ # Create your models here.
@@ -0,0 +1,3 @@
1
+ from django.test import TestCase
2
+
3
+ # Create your tests here.
@@ -0,0 +1,6 @@
1
+ from django.urls import path
2
+ from views import index
3
+
4
+ urlpatterns = [
5
+ path("", views.index, name="index"),
6
+ ]
@@ -0,0 +1,30 @@
1
+ from django.shortcuts import render
2
+ import requests
3
+ import time
4
+ from .forms import URLForm
5
+
6
+ def check_site_status(url):
7
+ try:
8
+ start = time.time()
9
+ response = requests.get(url, timeout=5)
10
+ duration = round((time.time() - start) * 1000) # ms
11
+ return {
12
+ "status_code": response.status_code,
13
+ "response_time": duration,
14
+ "online": response.status_code == 200
15
+ }
16
+ except requests.exceptions.RequestException:
17
+ return {
18
+ "status_code": None,
19
+ "response_time": None,
20
+ "online": False
21
+ }
22
+
23
+ def index(request):
24
+ result = None
25
+ form = URLForm(request.POST or None)
26
+ if form.is_valid():
27
+ url = form.cleaned_data["url"]
28
+ result = check_site_status(url)
29
+ result["url"] = url
30
+ return render(request, "site_status_checker/index.html", {"form": form, "result": result})
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: status_checker
3
+ Version: 0.1.0
4
+ Summary: Un petit package Django qui ckeck a disponibilite des pages web
5
+ Author: ynaffit_aes
6
+ Author-email: aramsamb02@gmail.com
7
+ License: MIT
8
+ Classifier: Environment :: Web Environment
9
+ Classifier: Framework :: Django
10
+ Classifier: Framework :: Django :: 4.0
11
+ Classifier: Framework :: Django :: 5.0
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Internet :: WWW/HTTP
17
+ Description-Content-Type: text/markdown
18
+ Requires-Dist: django>=4.0
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: classifier
22
+ Dynamic: description-content-type
23
+ Dynamic: license
24
+ Dynamic: requires-dist
25
+ Dynamic: summary
@@ -0,0 +1,17 @@
1
+ MANIFEST.in
2
+ README.md
3
+ setup.py
4
+ status_checker/__init__.py
5
+ status_checker/admin.py
6
+ status_checker/apps.py
7
+ status_checker/forms.py
8
+ status_checker/models.py
9
+ status_checker/tests.py
10
+ status_checker/urls.py
11
+ status_checker/views.py
12
+ status_checker.egg-info/PKG-INFO
13
+ status_checker.egg-info/SOURCES.txt
14
+ status_checker.egg-info/dependency_links.txt
15
+ status_checker.egg-info/requires.txt
16
+ status_checker.egg-info/top_level.txt
17
+ status_checker/migrations/__init__.py
@@ -0,0 +1 @@
1
+ django>=4.0
@@ -0,0 +1 @@
1
+ status_checker