Hi,

I'd like to fix #21381 <https://code.djangoproject.com/ticket/21381>. I 
think I have a viable idea, but would like to discuss the prototype before 
spending time on all the details like tests and documentation.

The plan is the following:

   - Models
      - Redirect model no longer has Site foreign key, it has `domain` 
      CharField instead which is not visible in admin section.
   - Migration
      - Site Foreign Key removed from initial migration.
      - Second migration adds domain field and runs custom code to migrate 
      domains from sites table if there were any.
   - Middleware
      - If `domain` field is filled, it must match request domain, so 
      redirect will be applied. If `domain` field is empty, redirect can be 
      applied to any domain.
      - Matched domain redirect priority is always higher than "blank" 
      redirects.
   - Redirect creation
      - Without contrib.sites, user creates redirects just as before, 
      excluding `site` field.
      - With contrib.sites installed, `sites` selector is available in 
      admin section, including blank value. Or user can just fill `domain` 
field 
      via Python API.
   

Here 
<https://github.com/dspechnikov/django/commit/5cafda1b1afd3014c5d64773992af1ba1e309ccc>
 is 
the first part of code to help understand what I mean :) Any 
suggestions/comments are welcome.

If this would fit better in django-developers list, I can repost it. This 
is my first attempt to contribute, so I thought it would be better to post 
here first.

Thanks,
Dmitry.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/e1952b8a-1217-4927-8006-6d23aae273ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to