Skip to content

Commit e23c119

Browse files
authored
Merge pull request #246 from classy-python/rewrite-readme
Rewrite the README to be clear and succinct
2 parents c6b7c9e + daa65cf commit e23c119

File tree

3 files changed

+55
-111
lines changed

3 files changed

+55
-111
lines changed

CONTRIBUTING.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Contributing
2+
We maintain tags on [our issues](https://github.com/classy-python/ccbv/issues/) to make it easy to find ones that might suit newcomers to the project.
3+
The [Low-hanging fruit tag](https://github.com/classy-python/ccbv/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Low-hanging%20fruit%22) is a good place to start if you're unfamiliar with the project.
4+
5+
> [!NOTE]
6+
> TLDR: The project is currently undergoing an overhaul behind the scenes with the goal of removing the need to use Django to serve pages.
7+
> Check that your changes are still relevant with that in mind!
8+
>
9+
> CCBV runs as a Django site, pulling data from a database.
10+
> This made it very fast to get up and running, and easy to maintain for the Django-using developers, but it has been a thorn in the side of the project for years.
11+
> The dataset is entirely fixed.
12+
> Any changes to Django's generic class based views (GCBVs) only happen when Django makes a new release.
13+
> We do not need to dynamically construct templates from the data on every request.
14+
> We can write out some HTML and never touch it again (unless we feel like changing the site's styles!)
15+
> The inspection code is tightly coupled to Django's GCBVs.
16+
> There have been sites for other Django-specific class hierarchies using forks of CCBV for years.
17+
> Other class hierarchies exist in Python.
18+
> Work has been ongoing to reduce the coupling of the site to Django, with the goal of eventually completely removing it.
19+
> This will help both this project and any related ones to more quickly update after Django or library releases, and also open up opportunities for other projects to grow.
20+
21+
## Installation
22+
Set up a virtualenv and run:
23+
24+
make build
25+
26+
This will install the requirements, collect static files, migrate the database, and finally load all the existing fixtures into your database.
27+
28+
## Updating requirements
29+
Add or remove the dependency from either `requirements.prod.in` or `requirements.dev.in` as appropriate.
30+
31+
Run `make compile` and appropriate txt file will be updated.
32+
33+
## Add data for new versions of Django
34+
1. Update the `requirements.prod.in` file to pin the new version of Django, eg `django==5.1`
35+
1. Run `make compile` to compile this change to `requirements.prod.txt`
36+
1. Run `python manage.py populate_cbv` to introspect the installed Django and populate the required objects in the database
37+
1. Run `python manage.py fetch_docs_urls` to update the records in the database with the latest links to the Django documentation, this will fail at 1.9, this is expected
38+
1. Export the new Django version into a fixture with `python manage.py cbv_dumpversion x.xx > cbv/fixtures/x.xx.json`
39+
1. Remove the empty Generic module from the generated JSON
40+
1. Add the fixture to git with `git add cbv/fixtures/<version>.git`
41+
1. Restore the requirements files with `git restore requirements.*`
42+
1. Commit and push your changes, they will be deployed once your PR is merged to main
43+
44+
## Testing
45+
Run `make test` to run the full test suite with coverage.

README.markdown

Lines changed: 0 additions & 111 deletions
This file was deleted.

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# [Classy Class Based Views](https://ccbv.co.uk)
2+
3+
Django's Generic class-based views provide a lot of common functionality to users.
4+
However, they are made up of up to twelve parent classes or mixins, at the time of writing.
5+
Knowing what functionality comes from which parent class/mixin is a tricky proposition.
6+
7+
CCBV provides a breakdown of each view's inheritance hierarchy, methods, and attributes.
8+
This allows you to find this information without tracing through every file and base class.
9+
10+
Interested in helping out? Check out our [contributor docs](CONTRIBUTING.md)!

0 commit comments

Comments
 (0)