organize settings, setup
parent
ca3c0e4fe5
commit
5defebdd88
|
@ -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/
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
from .common import *
|
||||
from .local_settings import *
|
|
@ -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
|
|
@ -0,0 +1,11 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>DOAB Check</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>
|
||||
Welcome to DOAB Check!
|
||||
</h1>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -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/<str:provider>/', views.ProviderView.as_view(), name='provider'),
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[build-system]
|
||||
requires = ['setuptools>=40.8.0', 'wheel']
|
||||
build-backend = 'setuptools.build_meta:__legacy__'
|
|
@ -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
|
Loading…
Reference in New Issue