Changes between Initial Version and Version 1 of SummerOfCode2023


Ignore:
Timestamp:
Jan 17, 2023, 8:44:17 AM (2 years ago)
Author:
Carlton Gibson
Comment:

Begin page for GSoC 2023

Legend:

Unmodified
Added
Removed
Modified
  • SummerOfCode2023

    v1 v1  
     1[[PageOutline]]
     2= Google's Summer of Code 2023 =
     3
     4Django is a mentor organization for the 2023 Google Summer of Code. Read
     5​[https://summerofcode.withgoogle.com Google's page] for more information on
     6how the program works.
     7
     8Django's GSoC program is being coordinated by the current Django Fellows,
     9Carlton Gibson and Mariusz Felisiak.
     10
     11== Mentors ==
     12
     13If you're interested in mentoring -- supervising a student in work on Django-related activities -- let us know via the Mentoring topic on https://forum.djangoproject.com/.
     14
     15== Students ==
     16
     17Student application period runs until April 4, 2023.
     18
     19If you'd like to get started on your proposal early, we'll be looking for a few things.
     20
     21  * You'll need to have a concrete task in mind (some ideas are below) along with
     22    a solid idea of what will constitute "success" (you tell us).
     23  * If your proposal is a single large feature, library or site, you'll need to present
     24    a detailed design specification. This proposal should be posted to
     25    [https://forum.djangoproject.com/c/internals/mentorship/10 the Django Forum],
     26    where it can be refined until it is accepted by the developer community.
     27  * We'll want to know a bit about you -- links to previous work are great, if any. If you're proposing something ambitious, you'll need to convince us that you're up to the task.
     28  * You'll also need to provide us with a schedule, including a detailed work breakdown and major milestones so your mentor can know if and when to nag you :)
     29
     30Here's an example of an accepted proposal from a previous year:
     31
     32* https://gist.github.com/chrismedrela/82cbda8d2a78a280a129
     33
     34Note that none of the ideas below are good enough to be submissions in their
     35own right (so don't copy and paste)! We'll want to know not just what you want
     36to do but how you plan to pull it off.
     37
     38Don't feel limited to the ideas below -- if you've got a cool project you want
     39to work on, we'll probably be able to find you a mentor. We plan on approving
     40as many projects as we possibly can.
     41
     42We're accepting any GSOC proposal that fits one of the following three categories:
     43
     44  * Work on Django itself - such as the ORM, forms, etc. This is what we've traditionally accepted GSoC entries in.
     45  * Work on tools to support Django - the dashboard (https://dashboard.djangoproject.com/) is a good example of an existing tool that would have fit into this category.
     46  * Work on libraries that supplement or add new features to Django to ease development - South and Django Debug Toolbar are good examples of existing projects that would have fit here.
     47
     48Unless explicitly mentioned below, we're **not** looking for people to work on
     49existing third-party libraries - we aren't able to guarantee commit access to
     50them. We may allow an exception if a maintainer of the library in question
     51agrees to help mentor beforehand.
     52
     53The broadening in scope is to allow people to work on new ideas to help Django
     54development and developers without tying you down to having to implement it in
     55the core codebase (and thus ruling out some projects that might otherwise be
     56useful).
     57
     58We're still going to be strict with what we accept - you'll need to provide a
     59strong use case for your idea and show that it would be useful to a majority of
     60developers or significantly improve the development of Django itself.
     61
     62We're not looking for small groups of incremental updates - like "improve
     63Django's Trac" - nor are we looking for impossible tasks, like "replace Trac
     64with this brand new issue tracker I'm writing". What you propose should be a
     65single project, achievable within the time period of GSoC, and something the
     66core developers can help mentor you on.
     67
     68We're also not looking for sites or projects that are merely written in Django
     69- this GSoC is not for you to propose your new forum hosting site or amazing
     70Django-based blogging engine.
     71
     72Note that when you contribute code, you will be expected to adhere to the same
     73contribution guidelines as any other code contributor. This means you will be
     74expected to provide extensive tests and documentation for any feature you add,
     75you will be expected to participate in discussion on
     76[http://groups.google.com/group/django-developers django-developers] and the
     77[https://forum.djangoproject.com Django Forum] when your topic of interest is
     78raised. If you're not already familiar with
     79[http://docs.djangoproject.com/en/dev/internals/contributing/ Django's
     80contribution guidelines], now would be a good time to read them - even if
     81you're not applying to work on Django core directly, we'll still want the same
     82level of contribution.
     83
     84== How can I improve my chances of being accepted? ==
     85
     86The best thing you can do to improve your chances to be accepted as a Django
     87GSoC student is to start contributing now. Read up on
     88[https://docs.djangoproject.com/en/dev/internals/contributing/ Django’s
     89contribution documentation] and make yourself known to the core team by your
     90contributions (ideally, related to the area of your proposal). That way, when
     91it comes time to evaluate student applications, you’ll be a known individual
     92and more likely to be able to get the attention you need to develop a proposal.
     93
     94We're looking for candidates who can demonstrate that they can engage in work
     95of a project scope on an independent basis. We're there to help but we can't
     96watch you every step of the way, so we need to see that motivation from you.
     97Being active before the submissions process is the best way to demonstrate
     98this.
     99
     100== Communication ==
     101
     102All GSOC-related communication is handled via the [https://forum.djangoproject.com/c/internals/mentorship/10 Django Forum, in
     103the Mentoring channel]. Any proposals for GSOC should be submitted there, as
     104well as discussion on the proposed projects and any updates that students post.
     105
     106Please be careful to keep content to the forum clear and purposeful; if you
     107have an idea, update, or criticism, please make sure you describe it in detail;
     108it can be tedious asking people to clarify any vague statements.
     109
     110== Ideas ==
     111
     112Here are some suggestions for projects students may want to propose (please
     113feel free add to this list!). This isn't by any means the be-all and end-all of
     114ideas; please feel free to submit proposals for things not on this list.
     115Remember, we'd much prefer that you posted a draft proposal and your rough
     116timeline / success conditions to the the [https://forum.djangoproject.com/c/internals/mentorship/10 Django Forum, in
     117the Mentoring channel] or [http://groups.google.com/group/django-developers django-developers list],
     118even if it's already on the list below; it will help you get feedback on
     119choosing the right part of a problem, as well as helping to see if there is any
     120interest before you start drafting a full proposal.
     121
     122When developing your proposal, try to scope ideas/proposals to size of your project (175hrs or 350hrs) -- you need to be ambitious, but not too ambitious. The GSoC does not
     123cover activities other than coding, so certain ideas ("Write a more detailed
     124tutorial" or "Create demonstration screencasts") are not suitable for inclusion
     125here.
     126
     127On the other side, though, be sure to be concrete in your proposal. We'll want
     128to know what your goals are, and how you plan to accomplish them.
     129
     130In no particular order:
     131
     132== Database Connection Pool ==
     133
     134Difficulty: Hard
     135Size:       350hrs
     136Potential Mentors: "Florian Apolloner", "Carlton Gibson"
     137
     138Django's persistent database connections do not function correctly under ASGI, for asynchronous code. As such we need a connection pool solution.
     139
     140There are per-database solutions out there, e.g. PG Bouncer for PostgreSQL. Can we wrap those, or provide our own implementation if needed?
     141
     142A proposal here will show awareness of the prior art, and the difficulties involved. (Background reading: https://github.com/brettwooldridge/HikariCP/blob/dev/documents/Welcome-To-The-Jungle.md and https://www.psycopg.org/articles/2021/01/17/pool-design/)
     143
     144
     145== Auto-importing shell ==
     146
     147Difficulty: Medium
     148Size:       175hrs
     149Potential Mentors: "Adam Johnson"
     150
     151One of the most popular features of django-extensions is `shell_plus`, which is like `shell` but auto-imports your models for you. Adding this behaviour to core would be a great addition.
     152
     153A proposal should consider ways to define extra things to import, perhaps a documented path of subclassing the management command and overriding a method.
     154
     155
     156== Security: Bring CORS and CSP into core ==
     157
     158Difficulty: Medium
     159Size:       350hrs
     160Potential Mentors: "Adam Johnson", "James Bennett"
     161
     162There are third-party apps providing support for Cross-Origin Resource Sharing (CORS) `django-cors-headers` and Content Security Policy (CSP) `django-csp `, but it would be good to have support built-in to core.
     163
     164Following the design of the CSRF/clickjacking protection, having safe defaults, and allowing straightforward per-path customisation, via e.g. decorators, would improve the security of all Django projects.
     165
     166== Migrations ==
     167
     168Here are a couple project ideas for improving Django's migrations framework.
     169
     170For both projects:
     171
     172Difficulty: Hard.
     173Size:       350hrs
     174Potential Mentors: "Shai Berger"
     175
     176=== Moving models between apps ===
     177
     178Support moving models between apps. This is a long-standing problem, esp. in
     179enterprise-y or just long-running projects. It's not simple and requires custom
     180migration operations to perform.
     181
     182It has been discussed previously:  https://forum.djangoproject.com/t/why-do-we-need-apps/827/20
     183
     184=== Audo-detection of custom migration operations ===
     185
     186Allow auto-detection of custom migration operations.
     187
     188The auto-detector has its change-detection mostly hard-coded:
     189https://github.com/django/django/blob/main/django/db/migrations/autodetector.py#L104
     190
     191It doesn't seem easy (or even possible with the current approach) to
     192allow third-party code to intervene.
     193
     194A proposal here would need to demonstrate a plan for a route forward.
     195
     196Note: These two projects are quite independent. Auto-detection of the fact that
     197a model has moved between apps is not required, supporting such moves with
     198flags to makemigrations or even a dedicated management-command would be
     199completely satisfactory.
     200
     201
     202- [SummerOfCode2022 (Edit) – Django](https://code.djangoproject.com/wiki/SummerOfCode2022?action=edit)
     203- [WikiFormatting – Django](https://code.djangoproject.com/wiki/WikiFormatting)
     204
     205
     206
     207== Improve the Database Cache Backend ==
     208
     209Difficulty: Medium.
     210Size:       350hrs
     211Potential Mentors: "Adam Johnson"
     212
     213Setting up a shared cache backend is nearly always required, as many
     214third-party packages assume the cache works like this (unlike the default
     215locmemcache which is per process). DatabaseCache is the easiest such cache
     216backend, not requiring any extra infra and working on shared hosts without a
     217filesystem. But it could be better.
     218
     219Django-Mysql has had a much better DB cache backend implementation since 2015: https://adamj.eu/tech/2015/05/17/building-a-better-databasecache-for-django-on-mysql/ . This has never been adapted for the other supported databases but it should be fairly straightforward, mostly some translation of SQL to different dialects.
     220
     221As a stretch goal, it would also be nice to hook the database cache tables into
     222migrations somehow rather than the current hacky duck typing approach:
     223https://github.com/django/django/blob/64b3c413da011f55469165256261f406a277e822/
     224django/core/cache/backends/db.py#L12-L28 ).
     225
     226
     227== Typed Django ==
     228
     229There are several potential projects related to typing and the django-stubs project.
     230
     231For all three projects:
     232
     233Difficulty: Hard.
     234Size:       175hrs
     235Potential Mentors: "Adam Johnson"
     236
     237=== Strict-mode support for django-stubs ===
     238
     239The django-stubs implementation does not currently pass Mypy’s strict mode.
     240
     241Making this compliant would enable users to always use strict mode with them, improving type safety.
     242
     243=== Merging django-types back into django-stubs ===
     244
     245There is a spin-off project from django-stubs called django-types. The original intention here was for it to be merged back into django-stubs, but that's never happened.
     246
     247django-types removes the need to use any mypy plugins, making it possible to use type checkers other than mypy, such as Pyrite, Pyre, etc.
     248
     249django-types is not actively maintained, however, and having competing stubs implementations means neither is as strong as could be.
     250
     251There is a small project in extracting the work from django-types and creating a PR for django-stubs allowing it to be merged back in, and effort to be concentrated on the single implementation.
     252
     253=== Exploratory proof-of-concept for typing Django core ===
     254
     255Since type annotations were added to Python, there has been discussion of when and whether they should be added to Django.
     256
     257In 2019 a proposal to add inline type hints was rejected. (See https://github.com/django/deps/pull/65 and links therein.)
     258
     259Since then there has been improvements in the typing landscape, and more people in the community are using type hints regularly in their own projects.
     260
     261It remains difficult, though, to judge whether it's now time to reassess that earlier decision.
     262
     263An exploratory proof-of-concept project applying type hints to some of the //leaf// modules in Django (those without further dependencies) — perhaps utils, the forms widgets and into fields, or inside the SQL compiler of the ORM — would enable us to see what the decision to adopt inline type hints would amount to.
     264
     265Such a project would need to:
     266
     267- Add readable type-hints, making good use type alises, Protocols, and so on.
     268- Configure mypy validation for the adjusted files, on CI, pre-commit, and for local development.
     269- Add typing to the relevant tests cases, and apply type checking there too.
     270 
     271The goal would be a PR showing what an incremental adoption of inline typing would like for Django in 2023, to serve as the basis of a fresh discussion of whether to adopt typing more generally.
     272
     273
     274== Configurable Content Type Parsing ==
     275
     276Difficulty: Medium.
     277Size:       350hrs
     278Potential Mentors: "Carlton Gibson"
     279
     280For Django 5.0 we're looking to modernize the `HTTPRequest` object, adding a content-type aware `request.data` property. This will parse `request.body` according to the content type.
     281
     282The initial phase — targeted for before GSoC — will add `request.data` and add support for JSON body handling, but the next phase is to make that fully pluggable with custom parsers.
     283
     284- Add a list of parsers to the request object, that can be customised — in a middleware for example — at any point prior to accessing `request.data`.
     285- Parsers should implement a `can_handle(content_type) -> Bool` method. The first parser returning True will be selected to parse the `request.body`.
     286
     287
     288== Window expressions improvements ==
     289
     290Add support for filtering against window expressions (see #28333), for `EXCLUDE` and currently not covered `RowRange()` cases (see #29850).
     291
     292Hard project. 350hr project
     293
     294Would require knowledge of the Django ORM, and the supported databases.
     295
     296Expected outcome would be a PR (or a number of them) on the ORM.
     297
     298Possible mentor: ''Mariusz Felisiak''.
     299
     300
     301
     302== Database-level Cascades ==
     303
     304Difficulty: Medium
     305Size:       350hr
     306Possible mentors: ''Mariusz Felisiak''.
     307
     308There's an old ticket to [https://code.djangoproject.com/ticket/21961 Add support for database-level cascading options].
     309This means that rather than Django's in-Python options for `on_delete` clauses, we'd allow the database to handle this with it's native implementation.
     310This would be a new option `db_on_delete` maybe, with the existing `on_delete` being `DO_NOTHING` if it were used.
     311
     312This had a couple of PRs that were in the right direction ([https://github.com/django/django/pull/14550 1], [https://github.com/django/django/pull/8661 2]), and [https://groups.google.com/g/django-developers/c/FJMoGgtYIX4/m/LTdjlWydJ2EJ a long-discussion on django-developers].
     313
     314A effective first-pass here for a single database backend can be done creating
     315a `ForeignKey` subclass setting a flag, and then overriding
     316`DatabaseSchemaEditor` `add_field()` and `sql_create_fk()` to detect that,
     317adjusting the generated SQL accordingly. (Try it!)
     318
     319The project would be to make that work generally, for all database backends,
     320and integrate with the migrations framework.
     321
     322Would require knowledge of the Django ORM, SQL, and the supported database
     323backends. Significant work has already gone into the project, so research of
     324the links given would be needed.
     325
     326Expected outcome would be a PR adding support for Database-level Cascades to
     327the Django ORM.
     328
     329== Add Async Support to Django Debug Toolbar ==
     330
     331Difficulty: Medium.
     332Size:       350hr
     333Possible mentors: ''Tim Schilling''/''Carlton Gibson''.
     334
     335Django Debug Toolbar (DDT) is one of the key packages in the Django ecosystem.
     336
     337https://github.com/jazzband/django-debug-toolbar
     338
     339DDT is not yet compatibile with Django Channels and async Django run unders ASGI.
     340Adding support for async to DDT would be a great contribution.
     341
     342Preliminary implementation ideas for this are available here: https://github.com/jazzband/django-debug-toolbar/pull/1432
     343
     344Would require some knowledge of asyncio, Django Channels, ASGI, and how the Django Debug Toolbar works.
     345
     346Expected outcome would be a PR (or multiple PRs) moving the toolbar towards full compatibility with Django channels and async logic.
     347
     348
     349
     350== Or Create Your Own ==
     351
     352
     353We have around 900 accepted tickets on Django. Browse the issue tracker by
     354component — here's an
     355[https://code.djangoproject.com/query?status=assigned&status=new&component=contrib.staticfiles&col=id&col=summary&col=status&col=owner&col=type&col=component&col=version&desc=1&order=id example filter for contrib.staticfiles]. What's the bit of the framework that interests you?
     356What contribution do you want to make to it?
     357
     358Use the tickets as guides here. Remember the advice above, that your project
     359needs to be both on Django itself here, and achievable in the timescale of
     360GSoC.
     361
     362Could be scoped as a 175hr or a 350hr project, depending on your idea.
     363
     364Possible mentors: ''Carlton Gibson'', ''Mariusz Felisiak''.
Back to Top