Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add example projects #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

chore: Add example projects #91

wants to merge 1 commit into from

Conversation

sondrelg
Copy link
Member

@sondrelg sondrelg commented Nov 23, 2022

I like the idea of small runnable examples. This sets up the starting point for that by adding

  • examples/sync-views
  • examples/async-views

The goal here has been to remove anything that isn't relevant to the very narrow functionality the examples are meant to show. The sync-views example now has a regular view and an ignored view, and we might actually go one step further and make a dedicated example out of the ignored view.

If you agree, we can do something like:

  • examples/async-view
  • examples/sync-view
  • examples/ignore-url
  • examples/celery-integration
  • examples/sentry-integration
  • examples/celery-and-sentry-integration

For now, I just wanted to open this as a first WIP proof of concept


Update: Added examples for the 6 things I consider important. We might be missing something though 🙂

@sondrelg sondrelg changed the title chore: Add two example projects chore: Add example projects Nov 26, 2022
@JonasKs
Copy link
Member

JonasKs commented Nov 27, 2022

I like the examples like these in frameworks such as Django, FastAPI and bigger "frameworks", but I think it is a bit much to have 5 folders for a tiny package like this? 🤔 In other words, I don't really think it adds much more than the single demo project. Maybe it will make more sense when packages are split up and tests have to be rewritten in isolation, but right now I don't really see what it adds, except rewriting a bunch of tests?

@sondrelg
Copy link
Member Author

These wouldn't be used for tests at all. It's more a case of, if you need to know how to implement working celery integration filters, then you look at the celery example. If you need to ignore an URL, then look at the ignore URL example. The async-view example only contains the bare minimum configuration you need to set up the middleware.

A full demo project is less useful IMO, because it includes a lot of bloat. If you want to just set up a basic configuration without integrations, then it's a shame if the logging configuration sets up the celery logging and vice versa.

I think using the demo project for testing is something we should get rid of if that's still a thing 🙂

@JonasKs
Copy link
Member

JonasKs commented Nov 28, 2022

I think using the demo project for testing is something we should get rid of if that's still a thing 🙂

I don't think this makes as much sense for Django as it does for starlette-based projects tbh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants