Test against Django 3.2

This commit is contained in:
Artur Barseghyan 2022-06-18 00:58:21 +02:00
parent 108be3ee3c
commit b9ec460daf
32 changed files with 433 additions and 340 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
tmp/

View file

@ -12,7 +12,7 @@ jobs:
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_PASSWORD: test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
@ -87,6 +87,7 @@ jobs:
with:
# Optional: do not specify to match Chrome's version
chromedriver-version: '88.0.4324.96'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
@ -95,7 +96,6 @@ jobs:
pip install -r examples/requirements/${{ matrix.requirements }}.txt
pip-compile examples/requirements/test.in
pip install -r examples/requirements/test.txt
psql -c 'create database fobi_test;' -U postgres
- name: Run Tests
run: tox -e ${{ matrix.tox_env }}
- name: Coveralls

50
docker-compose.yml Normal file
View file

@ -0,0 +1,50 @@
version: '3'
services:
postgresql:
image: postgres
restart: always
# network_mode: "host"
volumes:
- ./tmp/postgresql_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=test
- DJANGO_SETTINGS_MODULE=settings.docker
ports:
- "5432:5432"
healthcheck:
test: ["CMD", "pg_isready", "--timeout", "5s"]
tty: true
stdin_open: true
backend:
container_name: django_fobi_backend
image: django_fobi_backend:latest
build:
context: .
dockerfile: ./docker/backend/Dockerfile
volumes:
- .:/backend
- ./docker/backend:/docker/backend
# network_mode: "host"
ports:
- "8000:8000"
depends_on:
- postgresql
links:
- postgresql:postgresql
entrypoint:
- /backend/docker/backend/entrypoint.sh
environment:
- POSTGRES_NAME=fobi
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=test
- DJANGO_SETTINGS_MODULE=settings.docker
tty: true
stdin_open: true
volumes:
postgresql_data:
driver: local

26
docker/backend/Dockerfile Normal file
View file

@ -0,0 +1,26 @@
FROM docker.io/python:3.9
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED 1
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y cmake
RUN apt-get install -y libpq-dev
RUN apt-get install -y mc
RUN apt-get install -y graphviz
RUN apt-get install -y gettext
RUN apt-get install -y nano
RUN apt-get install -y chromium
#RUN apt-get install -y firefox
RUN pip install pip --upgrade
RUN pip install virtualenv
RUN mkdir /backend
WORKDIR /backend
ADD examples/requirements/ /backend/requirements/
RUN pip install -r /backend/requirements/django_3_2.in
#RUN python -c "import geckodriver_autoinstaller; print(geckodriver_autoinstaller.install())"
RUN python -c "from chromedriver_py import binary_path; print(binary_path)"
COPY . /backend/
RUN python /backend/setup.py develop

View file

@ -0,0 +1,7 @@
Common commands
---------------
Connect to backend
~~~~~~~~~~~~~~~~~~
.. code-block::
docker exec -ti django_elasticsearch_dsl_drf_backend /bin/bash

17
docker/backend/entrypoint.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
# Create dirs if necessary
echo "Creating dirs"
./scripts/create_dirs.sh
# Apply database migrations
echo "Apply database migrations"
./examples/simple/manage.py migrate --noinput --settings=settings.docker
## Create test data
#echo "Create test data"
#./examples/simple/manage.py fobi_create_test_data --settings=settings.docker
# Start server
echo "Starting server"
python ./examples/simple/manage.py runserver 0.0.0.0:8000 --settings=settings.docker --traceback -v 3

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile captcha.in
@ -18,9 +18,5 @@ pillow==8.2.0
# via django-simple-captcha
pytz==2021.1
# via django
six==1.16.0
# via django-simple-captcha
sqlparse==0.4.1
# via django
typing-extensions==3.10.0.0
# via asgiref

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile common.in
@ -41,13 +41,6 @@ idna==2.10
# via requests
imagesize==1.2.0
# via sphinx
importlib-metadata==4.5.0
# via
# markdown
# pluggy
# virtualenv
importlib-resources==5.1.4
# via virtualenv
ipython-genutils==0.2.0
# via traitlets
jinja2==3.0.1
@ -69,8 +62,8 @@ packaging==20.9
# bleach
# sphinx
path==16.0.0
# via path.py
path.py==12.5.0
# via path-py
path-py==12.5.0
# via -r common.in
pexpect==4.8.0
# via -r common.in
@ -132,8 +125,6 @@ sphinxcontrib-serializinghtml==1.1.5
# via sphinx
traitlets==4.3.3
# via -r common.in
typing-extensions==3.10.0.0
# via importlib-metadata
urllib3==1.26.5
# via requests
virtualenv==20.4.7
@ -142,10 +133,6 @@ webencodings==0.5.1
# via bleach
wheel==0.36.2
# via -r common.in
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile demo.in
@ -40,8 +40,6 @@ coverage==5.5
# via
# -r test.in
# pytest-cov
dataclasses==0.8
# via black
decorator==5.0.9
# via
# -r common.in
@ -117,20 +115,6 @@ idna==2.10
# via requests
imagesize==1.2.0
# via sphinx
importlib-metadata==4.5.0
# via
# click
# flake8
# markdown
# pluggy
# pre-commit
# pytest
# tox
# virtualenv
importlib-resources==5.1.4
# via
# pre-commit
# virtualenv
iniconfig==1.1.1
# via pytest
ipython-genutils==0.2.0
@ -170,8 +154,8 @@ packaging==20.9
# sphinx
# tox
path==16.0.0
# via path.py
path.py==12.5.0
# via path-py
path-py==12.5.0
# via -r common.in
pathspec==0.8.1
# via black
@ -258,7 +242,6 @@ six==1.16.0
# via
# -r common.in
# bleach
# django-simple-captcha
# feincms
# python-dateutil
# tox
@ -305,15 +288,6 @@ tox==3.23.1
# via -r test.in
traitlets==4.3.3
# via -r common.in
typed-ast==1.4.3
# via
# astroid
# black
typing-extensions==3.10.0.0
# via
# asgiref
# black
# importlib-metadata
urllib3==1.26.5
# via
# requests
@ -329,10 +303,6 @@ wheel==0.36.2
# via -r common.in
wrapt==1.12.1
# via astroid
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile deployment.in
@ -24,9 +24,7 @@ idna==2.10
# via requests
importlib-metadata==4.5.0
# via
# click
# keyring
# pep517
# twine
jeepney==0.6.0
# via
@ -70,16 +68,12 @@ tqdm==4.61.1
# via twine
twine==3.4.1
# via -r deployment.in
typing-extensions==3.10.0.0
# via importlib-metadata
urllib3==1.26.5
# via requests
webencodings==0.5.1
# via bleach
zipp==3.4.1
# via
# importlib-metadata
# pep517
# via importlib-metadata
# The following packages are considered to be unsafe in a requirements file:
# pip

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile django_2_2.in
@ -36,8 +36,6 @@ coverage==5.5
# via
# -r test.in
# pytest-cov
dataclasses==0.8
# via black
decorator==5.0.9
# via
# -r common.in
@ -111,20 +109,6 @@ idna==2.10
# via requests
imagesize==1.2.0
# via sphinx
importlib-metadata==4.5.0
# via
# click
# flake8
# markdown
# pluggy
# pre-commit
# pytest
# tox
# virtualenv
importlib-resources==5.1.4
# via
# pre-commit
# virtualenv
iniconfig==1.1.1
# via pytest
ipython-genutils==0.2.0
@ -164,8 +148,8 @@ packaging==20.9
# sphinx
# tox
path==16.0.0
# via path.py
path.py==12.5.0
# via path-py
path-py==12.5.0
# via -r common.in
pathspec==0.8.1
# via black
@ -252,7 +236,6 @@ six==1.16.0
# via
# -r common.in
# bleach
# django-simple-captcha
# feincms
# python-dateutil
# tox
@ -299,14 +282,6 @@ tox==3.23.1
# via -r test.in
traitlets==4.3.3
# via -r common.in
typed-ast==1.4.3
# via
# astroid
# black
typing-extensions==3.10.0.0
# via
# black
# importlib-metadata
urllib3==1.26.5
# via
# requests
@ -322,10 +297,6 @@ wheel==0.36.2
# via -r common.in
wrapt==1.12.1
# via astroid
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile django_3_0.in
@ -40,8 +40,6 @@ coverage==5.5
# via
# -r test.in
# pytest-cov
dataclasses==0.8
# via black
decorator==5.0.9
# via
# -r common.in
@ -117,20 +115,6 @@ idna==2.10
# via requests
imagesize==1.2.0
# via sphinx
importlib-metadata==4.5.0
# via
# click
# flake8
# markdown
# pluggy
# pre-commit
# pytest
# tox
# virtualenv
importlib-resources==5.1.4
# via
# pre-commit
# virtualenv
iniconfig==1.1.1
# via pytest
ipython-genutils==0.2.0
@ -170,8 +154,8 @@ packaging==20.9
# sphinx
# tox
path==16.0.0
# via path.py
path.py==12.5.0
# via path-py
path-py==12.5.0
# via -r common.in
pathspec==0.8.1
# via black
@ -258,7 +242,6 @@ six==1.16.0
# via
# -r common.in
# bleach
# django-simple-captcha
# feincms
# python-dateutil
# tox
@ -305,15 +288,6 @@ tox==3.23.1
# via -r test.in
traitlets==4.3.3
# via -r common.in
typed-ast==1.4.3
# via
# astroid
# black
typing-extensions==3.10.0.0
# via
# asgiref
# black
# importlib-metadata
urllib3==1.26.5
# via
# requests
@ -329,10 +303,6 @@ wheel==0.36.2
# via -r common.in
wrapt==1.12.1
# via astroid
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile django_3_1.in
@ -40,8 +40,6 @@ coverage==5.5
# via
# -r test.in
# pytest-cov
dataclasses==0.8
# via black
decorator==5.0.9
# via
# -r common.in
@ -117,20 +115,6 @@ idna==2.10
# via requests
imagesize==1.2.0
# via sphinx
importlib-metadata==4.5.0
# via
# click
# flake8
# markdown
# pluggy
# pre-commit
# pytest
# tox
# virtualenv
importlib-resources==5.1.4
# via
# pre-commit
# virtualenv
iniconfig==1.1.1
# via pytest
ipython-genutils==0.2.0
@ -170,8 +154,8 @@ packaging==20.9
# sphinx
# tox
path==16.0.0
# via path.py
path.py==12.5.0
# via path-py
path-py==12.5.0
# via -r common.in
pathspec==0.8.1
# via black
@ -258,7 +242,6 @@ six==1.16.0
# via
# -r common.in
# bleach
# django-simple-captcha
# feincms
# python-dateutil
# tox
@ -305,15 +288,6 @@ tox==3.23.1
# via -r test.in
traitlets==4.3.3
# via -r common.in
typed-ast==1.4.3
# via
# astroid
# black
typing-extensions==3.10.0.0
# via
# asgiref
# black
# importlib-metadata
urllib3==1.26.5
# via
# requests
@ -329,10 +303,6 @@ wheel==0.36.2
# via -r common.in
wrapt==1.12.1
# via astroid
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile django_3_2.in
@ -40,8 +40,6 @@ coverage==5.5
# via
# -r test.in
# pytest-cov
dataclasses==0.8
# via black
decorator==5.0.9
# via
# -r common.in
@ -117,20 +115,6 @@ idna==2.10
# via requests
imagesize==1.2.0
# via sphinx
importlib-metadata==4.5.0
# via
# click
# flake8
# markdown
# pluggy
# pre-commit
# pytest
# tox
# virtualenv
importlib-resources==5.1.4
# via
# pre-commit
# virtualenv
iniconfig==1.1.1
# via pytest
ipython-genutils==0.2.0
@ -170,8 +154,8 @@ packaging==20.9
# sphinx
# tox
path==16.0.0
# via path.py
path.py==12.5.0
# via path-py
path-py==12.5.0
# via -r common.in
pathspec==0.8.1
# via black
@ -258,7 +242,6 @@ six==1.16.0
# via
# -r common.in
# bleach
# django-simple-captcha
# feincms
# python-dateutil
# tox
@ -305,15 +288,6 @@ tox==3.23.1
# via -r test.in
traitlets==4.3.3
# via -r common.in
typed-ast==1.4.3
# via
# astroid
# black
typing-extensions==3.10.0.0
# via
# asgiref
# black
# importlib-metadata
urllib3==1.26.5
# via
# requests
@ -329,10 +303,6 @@ wheel==0.36.2
# via -r common.in
wrapt==1.12.1
# via astroid
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile djangocms_3_4_3.in

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile djangorestframework.in

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile docs.in
@ -38,8 +38,6 @@ coverage==5.5
# via
# -r test.in
# pytest-cov
dataclasses==0.8
# via black
decorator==5.0.9
# via
# -r common.in
@ -130,20 +128,7 @@ idna==2.10
imagesize==1.2.0
# via sphinx
importlib-metadata==4.5.0
# via
# click
# flake8
# markdown
# pluggy
# pre-commit
# pytest
# rst2pdf
# tox
# virtualenv
importlib-resources==5.1.4
# via
# pre-commit
# virtualenv
# via rst2pdf
iniconfig==1.1.1
# via pytest
ipython-genutils==0.2.0
@ -185,8 +170,8 @@ packaging==20.9
# sphinx
# tox
path==16.0.0
# via path.py
path.py==12.5.0
# via path-py
path-py==12.5.0
# via -r common.in
pathspec==0.8.1
# via black
@ -284,7 +269,6 @@ six==1.16.0
# -r common.in
# bleach
# django-fobi
# django-simple-captcha
# feincms
# python-dateutil
# tox
@ -334,14 +318,6 @@ tox==3.23.1
# via -r test.in
traitlets==4.3.3
# via -r common.in
typed-ast==1.4.3
# via
# astroid
# black
typing-extensions==3.10.0.0
# via
# black
# importlib-metadata
unidecode==1.2.0
# via django-fobi
urllib3==1.26.5
@ -362,9 +338,7 @@ wheel==0.36.2
wrapt==1.12.1
# via astroid
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources
# via importlib-metadata
# The following packages are considered to be unsafe in a requirements file:
# pip

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile feincms_1_17.in
@ -28,5 +28,3 @@ six==1.16.0
# via feincms
sqlparse==0.4.1
# via django
typing-extensions==3.10.0.0
# via asgiref

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile feincms_1_20.in
@ -28,5 +28,3 @@ six==1.16.0
# via feincms
sqlparse==0.4.1
# via django
typing-extensions==3.10.0.0
# via asgiref

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile latest.in
@ -68,13 +68,6 @@ idna==2.10
# via requests
imagesize==1.2.0
# via sphinx
importlib-metadata==4.5.0
# via
# markdown
# pluggy
# virtualenv
importlib-resources==5.1.4
# via virtualenv
ipython-genutils==0.2.0
# via traitlets
jinja2==3.0.1
@ -96,8 +89,8 @@ packaging==20.9
# bleach
# sphinx
path==16.0.0
# via path.py
path.py==12.5.0
# via path-py
path-py==12.5.0
# via -r common.in
pexpect==4.8.0
# via -r common.in
@ -167,10 +160,6 @@ sqlparse==0.4.1
# django-debug-toolbar
traitlets==4.3.3
# via -r common.in
typing-extensions==3.10.0.0
# via
# asgiref
# importlib-metadata
urllib3==1.26.5
# via requests
virtualenv==20.4.7
@ -181,10 +170,6 @@ webencodings==0.5.1
# via bleach
wheel==0.36.2
# via -r common.in
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile mptt.in
@ -16,5 +16,3 @@ pytz==2021.1
# via django
sqlparse==0.4.1
# via django
typing-extensions==3.10.0.0
# via asgiref

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile recaptcha.in
@ -14,5 +14,3 @@ pytz==2021.1
# via django
sqlparse==0.4.1
# via django
typing-extensions==3.10.0.0
# via asgiref

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile style_checkers.in
@ -16,8 +16,6 @@ cfgv==3.3.0
# via pre-commit
click==8.0.1
# via black
dataclasses==0.8
# via black
distlib==0.3.2
# via virtualenv
filelock==3.0.12
@ -26,16 +24,6 @@ flake8==3.9.2
# via -r style_checkers.in
identify==2.2.10
# via pre-commit
importlib-metadata==4.5.0
# via
# click
# flake8
# pre-commit
# virtualenv
importlib-resources==5.1.4
# via
# pre-commit
# virtualenv
isort==5.9.1
# via
# -r style_checkers.in
@ -77,19 +65,7 @@ toml==0.10.2
# black
# pre-commit
# pylint
typed-ast==1.4.3
# via
# astroid
# black
typing-extensions==3.10.0.0
# via
# black
# importlib-metadata
virtualenv==20.4.7
# via pre-commit
wrapt==1.12.1
# via astroid
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources

View file

@ -9,3 +9,5 @@ pytest-ordering
pytest-pythonpath
selenium
tox
chromedriver-py==102.0.5005.61
#geckodriver-autoinstaller

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile test.in
@ -24,14 +24,6 @@ filelock==3.0.12
# via
# tox
# virtualenv
importlib-metadata==4.5.0
# via
# pluggy
# pytest
# tox
# virtualenv
importlib-resources==5.1.4
# via virtualenv
iniconfig==1.1.1
# via pytest
packaging==20.9
@ -82,13 +74,7 @@ toml==0.10.2
# tox
tox==3.23.1
# via -r test.in
typing-extensions==3.10.0.0
# via importlib-metadata
urllib3==1.26.5
# via selenium
virtualenv==20.4.7
# via tox
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile testing.in
@ -40,8 +40,6 @@ coverage==5.5
# via
# -r test.in
# pytest-cov
dataclasses==0.8
# via black
decorator==5.0.9
# via
# -r common.in
@ -117,20 +115,6 @@ idna==2.10
# via requests
imagesize==1.2.0
# via sphinx
importlib-metadata==4.5.0
# via
# click
# flake8
# markdown
# pluggy
# pre-commit
# pytest
# tox
# virtualenv
importlib-resources==5.1.4
# via
# pre-commit
# virtualenv
iniconfig==1.1.1
# via pytest
ipython-genutils==0.2.0
@ -170,8 +154,8 @@ packaging==20.9
# sphinx
# tox
path==16.0.0
# via path.py
path.py==12.5.0
# via path-py
path-py==12.5.0
# via -r common.in
pathspec==0.8.1
# via black
@ -258,7 +242,6 @@ six==1.16.0
# via
# -r common.in
# bleach
# django-simple-captcha
# feincms
# python-dateutil
# tox
@ -305,15 +288,6 @@ tox==3.23.1
# via -r test.in
traitlets==4.3.3
# via -r common.in
typed-ast==1.4.3
# via
# astroid
# black
typing-extensions==3.10.0.0
# via
# asgiref
# black
# importlib-metadata
urllib3==1.26.5
# via
# requests
@ -329,10 +303,6 @@ wheel==0.36.2
# via -r common.in
wrapt==1.12.1
# via astroid
zipp==3.4.1
# via
# importlib-metadata
# importlib-resources
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View file

@ -233,7 +233,7 @@ INSTALLED_APPS = [
'fobi.contrib.plugins.form_elements.fields.file',
'fobi.contrib.plugins.form_elements.fields.float',
'fobi.contrib.plugins.form_elements.fields.hidden',
# 'fobi.contrib.plugins.form_elements.fields.hidden_model_object',
'fobi.contrib.plugins.form_elements.fields.hidden_model_object',
'fobi.contrib.plugins.form_elements.fields.input',
'fobi.contrib.plugins.form_elements.fields.integer',
'fobi.contrib.plugins.form_elements.fields.ip_address',

View file

@ -0,0 +1,272 @@
import os
from django_nine.versions import *
from .bootstrap3_theme import *
def project_dir(base):
return os.path.abspath(
os.path.join(os.path.dirname(__file__), base).replace('\\', '/')
)
# EMAIL_HOST = 'smtp.gmail.com'
# EMAIL_PORT = 587
# EMAIL_USE_TLS = True
#
# EMAIL_HOST_USER = 'artur.barseghyan.smtp.test@gmail.com'
# EMAIL_HOST_PASSWORD = 'FreeSMTPRulez999'
def gettext(s):
return s
PROJECT_DIR = project_dir
DEBUG = True
DEBUG_TOOLBAR = False
# TEMPLATE_DEBUG = True
DEV = True
# DATABASES = {
# 'default': {
# # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
# # 'ENGINE': 'django.db.backends.sqlite3',
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# # Or path to database file if using sqlite3.
# 'NAME': PROJECT_DIR('../../db/example.db'),
# # 'ENGINE': 'django.db.backends.mysql',
# # 'NAME': 'fobi',
# # 'TEST_NAME': 'fobi_test',
# # The following settings are not used with sqlite3:
# # 'USER': 'root',
# 'USER': 'postgres',
# 'PASSWORD': 'test',
# # Empty for localhost through domain sockets or '127.0.0.1' for
# # localhost through TCP.
# 'HOST': '',
# # Set to empty string for default.
# 'PORT': '',
# }
# }
# TEST_DATABASES = {
# 'default': {
# # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'fobi',
# 'USER': 'postgres',
# 'PASSWORD': 'test',
#
# # 'ENGINE': 'django.db.backends.sqlite3',
# # 'NAME': PROJECT_DIR('../../db/example.db'),
# # 'USER': '',
# # 'PASSWORD': '',
#
# # Empty for localhost through domain sockets or '127.0.0.1' for
# # localhost through TCP.
# 'HOST': '',
# # Set to empty string for default.
# 'PORT': '',
# }
# }
POSTGRES_ENGINE = 'django.db.backends.postgresql'
DATABASES = {
'default': {
'ENGINE': POSTGRES_ENGINE,
'HOST': 'postgresql',
'NAME': 'fobi',
'USER': 'postgres',
'PASSWORD': 'test',
}
}
TEST_DATABASES = {
'default': {
'ENGINE': POSTGRES_ENGINE,
'HOST': 'postgresql',
'NAME': 'fobi',
'USER': 'postgres',
'PASSWORD': 'test',
}
}
INTERNAL_IPS = ('127.0.0.1',)
ALLOWED_HOSTS = ['*']
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = PROJECT_DIR('../../tmp')
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'artur.barseghyan.smtp.test@gmail.com'
EMAIL_HOST_PASSWORD = 'FreeSMTPRulez999'
DEFAULT_FROM_EMAIL = '<no-reply@dev.django-fobi.mail.example.com>'
FOBI_DEBUG = True
FOBI_RESTRICT_PLUGIN_ACCESS = False
FOBI_RESTRICT_FIELDS_ACCESS = False
FOBI_FORM_ELEMENT_SELECT_MODEL_OBJECT_IGNORED_MODELS = ['auth.User']
FOBI_FAIL_ON_MISSING_FORM_ELEMENT_PLUGINS = True
# FOBI_FAIL_ON_MISSING_FORM_HANDLER_PLUGINS = False
FOBI_FAIL_ON_ERRORS_IN_FORM_HANDLER_PLUGINS = True
# FOBI_DEFAULT_THEME = 'foundation5'
FOBI_FAIL_ON_MISSING_FORM_HANDLER_PLUGINS = True
FOBI_FAIL_ON_MISSING_FORM_WIZARD_HANDLER_PLUGINS = True
FOBI_FAIL_ON_ERRORS_IN_FORM_ELEMENT_PLUGINS = False
# FOBI_FAIL_ON_ERRORS_IN_FORM_HANDLER_PLUGINS = True
FOBI_FAIL_ON_ERRORS_IN_FORM_WIZARD_HANDLER_PLUGINS = True
# WAIT_BETWEEN_TEST_STEPS = 0
# FOBI_WAIT_AT_TEST_END = 0
MAILCHIMP_API_KEY = '186eee04b7eae9b1d9bb61b402c37e52-us7'
ENABLE_CAPTCHA = True
# LANGUAGE_CODE = 'nl'
RECAPTCHA_PUBLIC_KEY = '6LdSp_8SAAAAAC1Q4ZvbvB9wOfCc92o9EGEcRMpp'
RECAPTCHA_PRIVATE_KEY = '6LdSp_8SAAAAAAxdzw2U6i3Q46jltXoiSEXAk5wL'
# from fobi.constants import (
# SUBMIT_VALUE_AS_VAL, SUBMIT_VALUE_AS_REPR, SUBMIT_VALUE_AS_MIX
# )
# SUBMIT_VALUE_AS = SUBMIT_VALUE_AS_MIX
#
# FOBI_FORM_ELEMENT_RADIO_SUBMIT_VALUE_AS = SUBMIT_VALUE_AS #'val'
# FOBI_FORM_ELEMENT_SELECT_SUBMIT_VALUE_AS = SUBMIT_VALUE_AS #'val'
# FOBI_FORM_ELEMENT_SELECT_MULTIPLE_SUBMIT_VALUE_AS = SUBMIT_VALUE_AS #'val'
# 'val'
# FOBI_FORM_ELEMENT_SELECT_MODEL_OBJECT_SUBMIT_VALUE_AS = SUBMIT_VALUE_AS
# FOBI_FORM_ELEMENT_SELECT_MULTIPLE_MODEL_OBJECTS_SUBMIT_VALUE_AS = \
# SUBMIT_VALUE_AS
from selenium import webdriver
CHROME_DRIVER_OPTIONS = webdriver.ChromeOptions()
CHROME_DRIVER_OPTIONS.add_argument('-headless')
CHROME_DRIVER_OPTIONS.add_argument('-no-sandbox')
CHROME_DRIVER_OPTIONS.set_capability('chrome.binary', "/usr/bin/google-chrome")
# CHROME_DRIVER_OPTIONS.add_argument('-single-process')
from chromedriver_py import binary_path
CHROME_DRIVER_EXECUTABLE_PATH = binary_path # '/usr/bin/chromedriver'
# CHROME_DRIVER_EXECUTABLE_PATH = None
FIREFOX_BIN_PATH = '/usr/lib/firefox/firefox'
FIREFOX_BIN_PATH = None
PHANTOM_JS_EXECUTABLE_PATH = ''
# PHANTOM_JS_EXECUTABLE_PATH = None
os.environ.setdefault(
'FOBI_SOURCE_PATH',
'/home/delusionalinsanity/bbrepos/django-fobi/src'
)
DEBUG_TEMPLATE = True
# DATABASES = {
# 'default': {
# 'ENGINE': 'djongo',
# 'NAME': 'your-db-name',
# }
# }
FOBI_PLUGIN_INVISIBLE_RECAPTCHA_SITE_KEY = \
'6Lcya0EUAAAAAHfpe9JSmvdy0Ie9SIOtX0Abdn_v'
FOBI_PLUGIN_INVISIBLE_RECAPTCHA_SITE_SECRET = \
'6Lcya0EUAAAAAJQKcPYlOQwghvwaRvShwCrgyU12'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'root': {
'level': 'INFO',
'handlers': ['all_log'],
},
'formatters': {
'verbose': {
'format': '\n%(levelname)s %(asctime)s [%(pathname)s:%(lineno)s] '
'%(message)s'
},
'simple': {
'format': '\n%(levelname)s %(message)s'
},
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
},
'all_log': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': PROJECT_DIR("../../logs/all.log"),
'maxBytes': 1048576,
'backupCount': 99,
'formatter': 'verbose',
},
'django_log': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': PROJECT_DIR("../../logs/django.log"),
'maxBytes': 1048576,
'backupCount': 99,
'formatter': 'verbose',
},
'django_request_log': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': PROJECT_DIR("../../logs/django_request.log"),
'maxBytes': 1048576,
'backupCount': 99,
'formatter': 'verbose',
},
'fobi_log': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': PROJECT_DIR("../../logs/fobi.log"),
'maxBytes': 1048576,
'backupCount': 99,
'formatter': 'verbose',
},
},
'loggers': {
'django.request': {
'handlers': ['django_request_log'],
'level': 'INFO',
'propagate': True,
},
'django': {
'handlers': ['django_log'],
'level': 'ERROR',
'propagate': False,
},
'fobi': {
'handlers': ['console', 'fobi_log'],
'level': 'DEBUG',
'propagate': True,
},
'django.db': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': False,
},
},
}

View file

@ -14,7 +14,7 @@ DEBUG_TOOLBAR = False
DATABASES = {
'default': {
# Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'fobi',
'USER': 'postgres',
'PASSWORD': 'test',
@ -26,19 +26,16 @@ DATABASES = {
# Empty for localhost through domain sockets or '127.0.0.1' for
# localhost through TCP.
'HOST': '',
# Set to empty string for default.
'PORT': '',
'HOST': 'localhost',
'TEST': {
'HOST': 'localhost',
'NAME': 'fobi_tests',
'USER': 'postgres',
'PASSWORD': '', # For travis
'PASSWORD': 'test',
}
}
}
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql'
# FeinCMS addons
INSTALLED_APPS += [

6
scripts/create_dirs.sh Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
mkdir -p examples/logs/
mkdir -p examples/db/
mkdir -p examples/tmp/
mkdir -p var/

3
scripts/create_superuser.sh Executable file
View file

@ -0,0 +1,3 @@
cd examples/simple/
./manage.py createsuperuser

View file

@ -3,7 +3,7 @@ import os
from distutils.version import LooseVersion
from setuptools import setup, find_packages
version = '0.17.1'
version = '0.18.1'
# ***************************************************************************
# ************************** Django version *********************************
@ -275,6 +275,7 @@ setup(
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Environment :: Web Environment",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"License :: OSI Approved :: GNU Lesser General Public License v2 or "