Comments (15)
Somewhat related to #54
from django-registration.
@sircco does the fix in #54 solve your problem?
from django-registration.
looking at code, i don't think that this does it unless i can override this line on per case basis.
from_email = getattr(settings, 'REGISTRATION_DEFAULT_FROM_EMAIL', settings.DEFAULT_FROM_EMAIL)
Our app is whitelabel, meaning that more than one domain can use it, register its own customers (and send registration emails)
from django-registration.
@sircco the use case makes sense 👍
If you'd like to implement we are happy to review.
from django-registration.
strawman could be to allow REGISTRATION_DEFAULT_FROM_EMAIL
to be a python dotted path.to.function
which would point a function that take site
as an argument and does custom logic to return the email? Thoughts?
# settings.py
REGISTRATION_DEFAULT_FROM_EMAIL = 'path.to.function'
# path/to.py
def function(site):
return '[email protected]'
from django-registration.
(probably cleaner to have a separate settings variable REGISTRATION_FROM_EMAIL_FUNCTION
or similar but same idea)
from django-registration.
How about something like this, overriding default if variable not provided
during instantiation.
I didnt look too much at the code recently but here is some dummy code to
explain my idea.
class Registration(Object):
def init_(self, mail_from=None, .... ):
self.mail_from, = mail_from or
settings.REGISTRATION_DEFAULT_FROM_EMAIL
On Tue, Jun 7, 2016 at 6:14 AM, Joshua Blum [email protected]
wrote:
(probably cleaner to have a separate settings variable
REGISTRATION_FROM_EMAIL_FUNCTION but same idea)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#26 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AJ9osiYzs0R4cFXyRZeY07tAUzef4qE-ks5qJPASgaJpZM4Da72R
.
from django-registration.
I think it's acceptable to use static configuration for this as well. You can use a dictionary to map emails to sites, just as an example.
from django-registration.
@sircco would a static configuration meet your use case?
from django-registration.
It will work for now. If we get so much traffic on our whitelabel site that we can't manage static setting we will think of something and submit code for review.
from django-registration.
Great. Do you want to take a first stab at implementing this?
El El mié, jun 15, 2016 a las 01:14, Damir [email protected]
escribió:
It will work for now. If we get so much traffic on our whitelabel site
that we can't manage static setting we will think of something and submit
code for review.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#26 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABF01NyzOHc4NZQXqii166U7mMXFzlHSks5qL4pFgaJpZM4Da72R
.
from django-registration.
@sircco take a look at #294 and let me know if this address your use case!
from django-registration.
should work fine!
from django-registration.
Awesome! I'll leave this open until #294 is merged in
from django-registration.
closed by #294
from django-registration.
Related Issues (20)
- When using Jinja, request user is preferred over ctx_dict's user HOT 2
- In send_activation_email() if email_message.send() fails it creates user anyway HOT 2
- Django 3.0 Support HOT 8
- [question] how to change default location of registration folder HOT 1
- Migrating from django-registration HOT 3
- ACCOUNT_ACTIVATION_DAYS not an int HOT 1
- For more understanding with backends.default.ResendactivationView exception process. HOT 1
- 2fa support or recommend package that works with this packages HOT 1
- Update cleanupregistration output for more understaing
- Show exception message for resend activation email. HOT 3
- Changing default_auto_field for RegistrationProfile HOT 1
- activate_user should send the user_activated signal HOT 1
- I get IntegrityError. Do you have any idea? HOT 1
- ...\> git clone https://github.com/YourGitHubName/django.git django-repo ...\> cd django-repo\tests ...\> py -m pip install -e .. ...\> py -m pip install -r requirements\py3.txt ...\> runtests.py
- New release :pray: HOT 1
- Rename master branch to main HOT 2
- AttributeError: 'WSGIRequest' object has no attribute 'session' trying reset the password HOT 1
- Define the default_auto_field on an AppConfig, not the model, reopening #413
- Some mixed up comments in registration templates
- Use protocol context variable instead of hard coded http
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-registration.