diff --git a/.gitignore b/.gitignore index d9005f2..5927d70 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +keys/ # PyInstaller # Usually these files are written by a python script from a template @@ -113,6 +114,7 @@ celerybeat.pid # Environments .env +.env.key .venv env/ venv/ diff --git a/doab_check/settings/__init__.py b/doab_check/settings/__init__.py new file mode 100644 index 0000000..72ec578 --- /dev/null +++ b/doab_check/settings/__init__.py @@ -0,0 +1,2 @@ +from .common import * +from .local_settings import * \ No newline at end of file diff --git a/doab_check/settings.py b/doab_check/settings/common.py similarity index 81% rename from doab_check/settings.py rename to doab_check/settings/common.py index 1ccfabe..3b6b0b1 100644 --- a/doab_check/settings.py +++ b/doab_check/settings/common.py @@ -14,20 +14,10 @@ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-$@5jch%4&#^6%r0t!p#n+24mfb)+f#*=s8c7hqbn&htu&pd4ej' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +print(BASE_DIR) ALLOWED_HOSTS = [] - # Application definition INSTALLED_APPS = [ @@ -71,18 +61,6 @@ TEMPLATES = [ WSGI_APPLICATION = 'doab_check.wsgi.application' -# Database -# https://docs.djangoproject.com/en/4.1/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': 'doabcheck', - 'USER': 'postgres', - 'HOST': '127.0.0.1', - 'PORT': '5433', } -} - # Password validation # https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators diff --git a/doab_check/templates/index.html b/doab_check/templates/index.html new file mode 100644 index 0000000..6bb74d2 --- /dev/null +++ b/doab_check/templates/index.html @@ -0,0 +1,11 @@ + + +DOAB Check + + +

+Welcome to DOAB Check! +

+ + + \ No newline at end of file diff --git a/doab_check/urls.py b/doab_check/urls.py index 0ab3fed..a268cdc 100644 --- a/doab_check/urls.py +++ b/doab_check/urls.py @@ -2,10 +2,12 @@ """ from django.contrib import admin from django.urls import path +from django.views.generic.base import TemplateView from . import views urlpatterns = [ + path('', TemplateView.as_view(template_name='index.html')), path('admin/', admin.site.urls), path('providers/', views.ProvidersView.as_view(), name='providers'), path('providers//', views.ProviderView.as_view(), name='provider'), diff --git a/doab_check/views.py b/doab_check/views.py index 406446b..3df28d3 100644 --- a/doab_check/views.py +++ b/doab_check/views.py @@ -25,7 +25,7 @@ class ProviderView(generic.TemplateView): def get_context_data(self, **kwargs): prov = kwargs['provider'] provider = {'provider': prov} - provider_links = Link.objects.filter(provider=prov) + provider_links = Link.objects.filter(provider=prov, active=True) provider['link_count'] = provider_links.count() return {'provider': provider, 'links': provider_links} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..65782a9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ['setuptools>=40.8.0', 'wheel'] +build-backend = 'setuptools.build_meta:__legacy__' \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..d21e7a7 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,32 @@ +[metadata] +name = doab-check +version = 0.1 +description = A Django app to check links at DOAB. +long_description = file: README.rst +url = https://www.example.com/ +author = Your Name +author_email = yourname@example.com +license = BSD-3-Clause # Example license +classifiers = + Environment :: Web Environment + Framework :: Django + Framework :: Django :: 4.1 + License :: OSI Approved :: BSD License + Operating System :: OS Independent + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Topic :: Internet :: WWW/HTTP + Topic :: Internet :: WWW/HTTP :: Dynamic Content + +[options] +include_package_data = true +packages = find: +python_requires = >=3.8 +install_requires = + Django == 4.1.7 + psycopg2 == 2.9.5 + pyoai == 2.5.0 + requests == 2.28.2 \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..fc1f76c --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup() \ No newline at end of file