Giter Club home page Giter Club logo

sidewinder's Issues

{% blocktranslate %}

Password reset template has a bug.

blocktranslate doesn't allow other block tags (seen the_url) inside it.

<p>{% blocktranslate %}The password reset link was invalid. Perhaps it has already been used?  Please request a <a href="{% the_url %}">new password reset</a>.{% endblocktranslate %}</p>```

Python version 3.10

Is version 3.10 of python required? Is it okay to update the pyproject.toml to drop back to 3.9?

Add Makefile for shortcuts

Mainly for shorthand control, like creating virtual envs, installing requirements, migrations etc:

running dev env should be as simple as :

git clone [email protected]:stribny/sidewinder.git
cd sidewinder
make

example Makefile:

#!make

# Make sure you have .env file in root directory
include .env
export

all: install lint run

shell:
	poetry shell

install:
	#poetry lock
	poetry install --with dev,test,docs --no-root
	poetry run pre-commit install

migrate:
	poetry run python manage.py migrate

run:
	poetry run python manage.py runserver

lint:
	poetry run black .
	poetry run isort .

test:
	poetry run pytest -s

docs:
	poetry run mkdocs serve

clean:
	rm -rf .pytest_cache
	rm -rf poetry.lock
	find . -type f -name '*.pyc' -delete

.PHONY: all lint test clean docs

also suggestion fot those who are using PyCharm instead of VsCode:

add to .gitignore:

.idea

Add code coverage

Coverage.py is a tool for measuring code coverage of Python programs. It monitors your program, noting which parts of the code have been executed, then analyzes the source to identify code that could have been executed but was not.

coverage run -m pytest
coverage html --skip-empty

A sample [configuration]( a sample configuration file) file (can be added to pyproject.toml) :

[tool.coverage.run]
branch = true

[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_also = [
    # Don't complain about missing debug-only code:
    "def __repr__",
    "if self\\.debug",

    # Don't complain if tests don't hit defensive assertion code:
    "raise AssertionError",
    "raise NotImplementedError",

    # Don't complain if non-runnable code isn't run:
    "if 0:",
    "if __name__ == .__main__.:",

    # Don't complain about abstract methods, they aren't run:
    "@(abc\\.)?abstractmethod",
    ]

ignore_errors = true

[tool.coverage.html]
directory = "coverage_html_report"

Improve UserFactory

@register
class UserFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = User

    email = factory.Faker("email")
    username = email
    password = make_password(DEFAULT_PASSWORD)

License

Hi there!

Nice work! Just wanted to check and see if there is a license for this project. I didn't see anything and am thinking about using it at work but didn't want to use any unlicensed code. If there isn't one could one be added? Ideally it'd be something MIT/BSD but it's your work so whatever works best for you.

Jazzmin for more attractive Admin UI

Regular Django admin UI is a bit dull. Jazzmin is a drop-in app to make django admin site more attractive.

https://django-jazzmin.readthedocs.io/

Sometimes the Jazzmin UI changes the position of the widgets, search and filter fields etc (some may not prefer that). So I think I'd be a good idea to make it optional.

I would add to the .env file:

JAZZMIN_ADMIN_UI=0

JAZZMIN_ADMIN_UI = env.bool("JAZZMIN_ADMIN_UI")

INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "django.contrib.sites",
    "django.contrib.flatpages",
    "django.forms",
    "django_extensions",
    "allauth",
    "allauth.account",
    "rest_framework",
    "rest_framework.authtoken",
    "drf_spectacular",
    "drf_spectacular_sidecar",
    "drf_standardized_errors",
    "corsheaders",
    "django_htmx",
    "huey.contrib.djhuey",
    "bx_django_utils",
    "huey_monitor",
    "tennisbuddy.core",
]

if JAZZMIN_ADMIN_UI:
    INSTALLED_APPS.insert(0, "jazzmin")

Add Ruff as Python linter and code formatter

Ruff is an extremely fast Python linter and code formatter, written in Rust. ⚡
Drop-in parity with Flake8, isort, and Black

The pre-commit-config.yml file would look like below:

# Run the Ruff formatter.
- repo: https://github.com/astral-sh/ruff-pre-commit
  # Ruff version.
  rev: v0.0.291
  hooks:
    - id: ruff-format
# Run the Ruff linter.
- repo: https://github.com/astral-sh/ruff-pre-commit
  # Ruff version.
  rev: v0.0.291
  hooks:
    - id: ruff
      args: [ --fix, --exit-non-zero-on-fix ]

Also there would be no need for .flake8, .isort.cfg.
Ruff can replace black, isort, and black as a dependency.

Use IPython debugger when a test fails

Django’s test framework has the --pdb flag to open the debugger when a test fails. This flag will automatically use ipdb when it’s installed.

pytest has a similar --pdb flag. You can configure --pdb to use the IPython debugger by setting the --pdbcls flag. This is most conveniently done in the addopts setting in your pytest.ini:

[pytest]
addopts = --pdbcls=IPython.terminal.debugger:TerminalPdb

Add MailHog for email testing

Hey @stribny I love your work here. I think adding an email testing tool for developers would be a great addition.

If you wish I can contribute this snippet inside the docker-compose.yml

  mailhog: 
    image: mailhog/mailhog:latest 
    restart: always 
    ports: 
      -1025:1025 
      -8025:8025 

Use github "template repository" feature

ISTM that this would be cool for sidewinder though I don't know if there are any blocking problems:

https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository

Then there'd be a "Use as template" button and folks could use sidewinder as a template for starting a repository that is NOT a fork. A person's new repository would not start with history ( though I know that's something you can wipe when cloning). Also unlike forking it would not be setup to contribute changes back to sidewinder which is presumably a good thing when folks are going to take things in a whole new-project direction.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.