From d2123f0bcb7baba6eddf8f928802fb90ec46d477 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 10 Apr 2023 13:50:52 +0300 Subject: [PATCH 1/9] Created `README.md` file --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..208f8d4 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# FOSSDB + +[![License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) +![Tests](https://github.com/kristoferssolo/FOSSDB-Web/actions/workflows/test.yml/badge.svg) + + +FOSSDB is an open-source web application that helps users find, contribute, and collaborate on free and open-source software (FOSS) projects. + +## Table of Contents +- [Installation](#installation) +- [Usage](#usage) +- [Contributing](#contributing) +- [License](#license) + +## Installation +1. Clone the repository and `cd` into it. +2. Install dependencies: +```sh +pip install -r requirements.txt +``` +3. Enter your `SECRET_KEY` and database information into `config.json` file. +4. Run database migrations: +```sh +python manage.py migrate +``` +5. Create a superuser: +```sh +python manage.py createsuperuser +``` +6. Run the development server: +```sh +python manage.py runserver +``` + +## Usage +After following the installation steps, you can access the application at [https://localhost:8000](https://localhost:8000). +Here are some of the features: +- Browse projects by programming language, license, or search term +- View project details, including programming languages, licenses, and descriptions +- Create a new project and add programming languages and licenses +- Edit and delete existing projects + +## Contributing +Contributions are always welcome! Here are some ways to get started: +1. Fork the repository and make your changes. +2. Submit a pull request. +3. Respond to open issues or submit new ones. +4. Improve documentation. + +## License +This project is licensed under the [GPL3 License](https://www.gnu.org/licenses/gpl-3.0.en.html). See the [LICENSE](./LICENSE) file for details. From 5d39796e7058b72011d3320d2c59842bb72930d8 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 10 Apr 2023 14:02:42 +0300 Subject: [PATCH 2/9] Fix tests --- .github/workflows/lint.yml | 23 ----------------------- .github/workflows/test.yml | 8 ++++---- FOSSDB_web/apps/fossdb/admin.py | 2 +- FOSSDB_web/apps/fossdb/models.py | 2 +- FOSSDB_web/apps/fossdb/tests.py | 2 +- FOSSDB_web/apps/fossdb/views.py | 2 +- setup.cfg | 2 +- tox.ini | 11 ++--------- 8 files changed, 11 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 776c8ea..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Lint -on: - - push - - pull_request -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - python-version: ["3.10"] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox tox-gh-actions - - name: Lint with tox - run: tox diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81c4998..b1a1554 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] python-version: ["3.10"] steps: - uses: actions/checkout@v2 @@ -18,6 +18,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install django - - name: Lint with tox - run: python manage.py test + pip install tox tox-gh-actions + - name: Test with tox + run: tox diff --git a/FOSSDB_web/apps/fossdb/admin.py b/FOSSDB_web/apps/fossdb/admin.py index 8c38f3f..4185d36 100644 --- a/FOSSDB_web/apps/fossdb/admin.py +++ b/FOSSDB_web/apps/fossdb/admin.py @@ -1,3 +1,3 @@ -from django.contrib import admin +# from django.contrib import admin # Register your models here. diff --git a/FOSSDB_web/apps/fossdb/models.py b/FOSSDB_web/apps/fossdb/models.py index 71a8362..0b4331b 100644 --- a/FOSSDB_web/apps/fossdb/models.py +++ b/FOSSDB_web/apps/fossdb/models.py @@ -1,3 +1,3 @@ -from django.db import models +# from django.db import models # Create your models here. diff --git a/FOSSDB_web/apps/fossdb/tests.py b/FOSSDB_web/apps/fossdb/tests.py index 7ce503c..a79ca8b 100644 --- a/FOSSDB_web/apps/fossdb/tests.py +++ b/FOSSDB_web/apps/fossdb/tests.py @@ -1,3 +1,3 @@ -from django.test import TestCase +# from django.test import TestCase # Create your tests here. diff --git a/FOSSDB_web/apps/fossdb/views.py b/FOSSDB_web/apps/fossdb/views.py index 91ea44a..fd0e044 100644 --- a/FOSSDB_web/apps/fossdb/views.py +++ b/FOSSDB_web/apps/fossdb/views.py @@ -1,3 +1,3 @@ -from django.shortcuts import render +# from django.shortcuts import render # Create your views here. diff --git a/setup.cfg b/setup.cfg index 069d76d..e918694 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = FOSSDB-Web -description = Open-Source Software Database Website +description = Free and Open-Source Software Database Website author = Kristofers Solo license = GPL3 license_files = LICENSE diff --git a/tox.ini b/tox.ini index da224ca..9f12258 100644 --- a/tox.ini +++ b/tox.ini @@ -1,20 +1,13 @@ [tox] minversion = 3.8.0 -envlist = py310, flake8, mypy +envlist = django, flake8, mypy isolated_build = true [gh-actions] python = 3.10: py310, mypy, flake8 -; [testenv] -; setenv = -; PYTHONPATH = {toxinidir} -; deps = -; -r{toxinidir}/requirements_dev.txt - - -[testenv] +[testenv:django] basepython = python3.10 deps = django commands = python manage.py test From d4d11c7bbfd30f119e1820196332c69b11515d38 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 10 Apr 2023 14:21:28 +0300 Subject: [PATCH 3/9] Fix `README.md` --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 208f8d4..0967403 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # FOSSDB -[![License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) -![Tests](https://github.com/kristoferssolo/FOSSDB-Web/actions/workflows/test.yml/badge.svg) +![Tests](https://github.com/kristoferssolo/FOSSDB-Web/actions/workflows/test.yml/badge.svg) +[![License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) FOSSDB is an open-source web application that helps users find, contribute, and collaborate on free and open-source software (FOSS) projects. @@ -33,7 +33,7 @@ python manage.py runserver ``` ## Usage -After following the installation steps, you can access the application at [https://localhost:8000](https://localhost:8000). +After following the installation steps, you can access the application at [localhost:8000](localhost:8000). Here are some of the features: - Browse projects by programming language, license, or search term - View project details, including programming languages, licenses, and descriptions From 1e7abae2d7462cd63bdbb42230711246a006ec15 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 10 Apr 2023 14:30:02 +0300 Subject: [PATCH 4/9] Fix url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0967403..7f0e479 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ python manage.py runserver ``` ## Usage -After following the installation steps, you can access the application at [localhost:8000](localhost:8000). +After following the installation steps, you can access the application at [localhost:8000](http://localhost:8000). Here are some of the features: - Browse projects by programming language, license, or search term - View project details, including programming languages, licenses, and descriptions From 4560df8804943585c25cf93100ee250aafe39bb2 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 29 Jun 2023 02:56:54 +0000 Subject: [PATCH 5/9] removed browser reloads --- src/FOSSDB/settings.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/FOSSDB/settings.py b/src/FOSSDB/settings.py index 76e80da..060c0c0 100644 --- a/src/FOSSDB/settings.py +++ b/src/FOSSDB/settings.py @@ -42,7 +42,6 @@ INSTALLED_APPS = [ "tailwind", "tokyonight_night", "crispy_forms", - "django_browser_reload", "fontawesomefree", "django.contrib.admin", "django.contrib.auth", @@ -60,7 +59,6 @@ MIDDLEWARE = [ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", - "django_browser_reload.middleware.BrowserReloadMiddleware", ] ROOT_URLCONF = "FOSSDB.urls" From 2fa971a19bf20576e88b6c5497f9ec7a3027fe09 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 29 Jun 2023 02:57:33 +0000 Subject: [PATCH 6/9] fix --- src/FOSSDB/urls.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/FOSSDB/urls.py b/src/FOSSDB/urls.py index d575c7c..7a48efe 100644 --- a/src/FOSSDB/urls.py +++ b/src/FOSSDB/urls.py @@ -23,7 +23,6 @@ urlpatterns = [ path("", include("main.urls")), path("", include("account.urls")), path("", include("django.contrib.auth.urls")), - path("__reload__/", include("django_browser_reload.urls")), ] if settings.DEBUG: from django.conf.urls.static import static From 38c1d0a12796cf9ad1b6c3f67584c8ee6e7d8262 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 29 Jun 2023 02:59:41 +0000 Subject: [PATCH 7/9] Fixed ruff errors --- pyproject.toml | 2 ++ src/apps/main/admin.py | 3 --- src/apps/main/models.py | 3 --- src/apps/main/tests.py | 3 --- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7c136c2..f7a8176 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,8 @@ warn_unused_configs = true [tool.ruff] line-length = 160 +exclude = ["**/**/migrations"] + [tool.black] line-length = 160 diff --git a/src/apps/main/admin.py b/src/apps/main/admin.py index 8c38f3f..e69de29 100644 --- a/src/apps/main/admin.py +++ b/src/apps/main/admin.py @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/src/apps/main/models.py b/src/apps/main/models.py index 71a8362..e69de29 100644 --- a/src/apps/main/models.py +++ b/src/apps/main/models.py @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/src/apps/main/tests.py b/src/apps/main/tests.py index 7ce503c..e69de29 100644 --- a/src/apps/main/tests.py +++ b/src/apps/main/tests.py @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. From 4509954b5bfbdd8bdc94d809af647d130074ef38 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 29 Jun 2023 03:01:12 +0000 Subject: [PATCH 8/9] Fix test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f575616..299b649 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,4 +15,4 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt - name: Run tests - run: python manage.py test + run: python src/manage.py test From b8234fa9e55c1a86319a5bf170beb117703516bc Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Thu, 29 Jun 2023 09:45:40 +0000 Subject: [PATCH 9/9] Update requirements --- FOSSDB_web/apps/fossdb/admin.py | 3 --- FOSSDB_web/apps/fossdb/models.py | 3 --- FOSSDB_web/apps/fossdb/tests.py | 3 --- FOSSDB_web/apps/fossdb/views.py | 3 --- requirements.txt | 1 + setup.cfg | 34 -------------------------------- tox.ini | 24 ---------------------- 7 files changed, 1 insertion(+), 70 deletions(-) delete mode 100644 FOSSDB_web/apps/fossdb/admin.py delete mode 100644 FOSSDB_web/apps/fossdb/models.py delete mode 100644 FOSSDB_web/apps/fossdb/tests.py delete mode 100644 FOSSDB_web/apps/fossdb/views.py delete mode 100644 setup.cfg delete mode 100644 tox.ini diff --git a/FOSSDB_web/apps/fossdb/admin.py b/FOSSDB_web/apps/fossdb/admin.py deleted file mode 100644 index 4185d36..0000000 --- a/FOSSDB_web/apps/fossdb/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -# from django.contrib import admin - -# Register your models here. diff --git a/FOSSDB_web/apps/fossdb/models.py b/FOSSDB_web/apps/fossdb/models.py deleted file mode 100644 index 0b4331b..0000000 --- a/FOSSDB_web/apps/fossdb/models.py +++ /dev/null @@ -1,3 +0,0 @@ -# from django.db import models - -# Create your models here. diff --git a/FOSSDB_web/apps/fossdb/tests.py b/FOSSDB_web/apps/fossdb/tests.py deleted file mode 100644 index a79ca8b..0000000 --- a/FOSSDB_web/apps/fossdb/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -# from django.test import TestCase - -# Create your tests here. diff --git a/FOSSDB_web/apps/fossdb/views.py b/FOSSDB_web/apps/fossdb/views.py deleted file mode 100644 index fd0e044..0000000 --- a/FOSSDB_web/apps/fossdb/views.py +++ /dev/null @@ -1,3 +0,0 @@ -# from django.shortcuts import render - -# Create your views here. diff --git a/requirements.txt b/requirements.txt index fc6e18e..d988313 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ fontawesomefree==6.4.0 mysqlclient==2.1.1 django-filter==23.2 django-tailwind==3.6.0 +django-crispy-forms==2.0 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e918694..0000000 --- a/setup.cfg +++ /dev/null @@ -1,34 +0,0 @@ -[metadata] -name = FOSSDB-Web -description = Free and Open-Source Software Database Website -author = Kristofers Solo -license = GPL3 -license_files = LICENSE -platforms = unix, linux, osx, cygwin, win32 -classifiers = - Programming Language :: Python :: 3.10 - -[options] -packages = FOSSDB_web -install_requires = - Django>=4.1 - fontawesomefree>=6.2.1 - mysqlclient>=2.1.1 - -python_requires = >=3.10 -package_dir = =. -zip_safe = no - -[options.extras_require] -testing = - flake8>=6.0.0 - mypy>=0.991 - pytest-cov>=4.0.0 - pytest>=7.2.0 - tox>=3.27.1 - -[options.package_data] -detector = py.typed - -[flake8] -max-line-length = 160 diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 9f12258..0000000 --- a/tox.ini +++ /dev/null @@ -1,24 +0,0 @@ -[tox] -minversion = 3.8.0 -envlist = django, flake8, mypy -isolated_build = true - -[gh-actions] -python = - 3.10: py310, mypy, flake8 - -[testenv:django] -basepython = python3.10 -deps = django -commands = python manage.py test - -[testenv:flake8] -basepython = python3.10 -deps = flake8 -commands = flake8 FOSSDB_web - -[testenv:mypy] -basepython = python3.10 -deps = - -r{toxinidir}/requirements_dev.txt -commands = mypy FOSSDB_web