Host multiple websites on same python app - python

I want to start make a django app, but i want to know if it's possible to use same "core" to host multiple sites.each site will just have a unique conf file (templates to use, db name, meta info, etc). what will be the best way to do that ?

Check out the Django sites framework.
https://docs.djangoproject.com/en/dev/ref/contrib/sites/

Hi :) Hope that yo are doing fine .
I'm not that good in python but I guess that you could get some help from a previous similar question through this link
https://scottlinux.com/2014/04/03/how-to-host-multiple-django-or-python-apps-on-the-same-host-with-nginx-and-gunicorn/
Hope that my answer helped in a way or clarified your intent
Regards

Ultimately, a Django app is a WSGI app. Many decent WSGI servers support running multiple WSGI apps simultaneously. For instance, uWSGI supports multiple WSGI apps using "Emperor mode". Check it out: http://uwsgi-docs.readthedocs.org/en/latest/Emperor.html

Related

Is there a way to create instant messages using django?

So, I spent a few hours browsing through github repositories and through the internet for a possible way to create a messaging app using django But I can't seem to find any .. The only thing i could find was ways to create chatrooms but nothing about creating a one-to-one convos
Is it possible to do this in django at all?
a simple solution was to add a database to the django-channels and edit the consumer.py file
Final Project Result
Hope it helps someone :)

Django multi host url configuration per app

I searched around here on SO for how I would setup different domains for apps within a single django project. e.g.: news.io, jobs.io, etc for a news, job, etc app within the main project.
The app will also have authentication where the user will need to remain signed in across the domains if this matters. e.g. - billing platforms, etc.
The recommendation was to use a MultiHostMiddleware found here which is obviously outdated.
Similarly, the other recommendation was to use django-multihost which is also really old.
I'm on Django 1.11 and Python 3.6. Is there anything more recent or better yet how would I roll my own?
I'm just getting into this myself, and from what I can tell django-tenant-schemas seems to be the best option.

Allowing users to use custom domains for Django app on Heroku

I have a Django app hosting on Heroku. In the app, the users create pages at http://domain.com/username
I'd like to give users the option to use their own domain name for their page using a CNAME. Ideally I'd like to avoid an A-Record in case I change hosts in the future and my IP changes.
This is completely new territory for me and dont even know where to start, or what to look for. Does anyone have a suggestion on where to start? I've seen mention of Wildcard DNS, but not sure how that ties into my app.
Any suggestions would be really appreciated.
Prelim Answer:
If you control the nameserver for the domain and have access to the RNDC Key, you can use the post-signup view/signal to squirt out a cname to your DNS server that will resove username.yoursite.com to yoursite.com. Make sure apache is set up to recieve a wildcard virtualhost to the correct app, and then use a custom middleware to read request.META['SERVER_NAME'].lsplit('.')[0] to see what the subdomain is. You can then use this information in your views to differentiate user subdomains.

Multiple Domain and Multi Directory in the same Django App

I am trying to support a quite complex architecture with mixed multiple domains and multiple directory in the same django application. Basically, we'll have urls like this :
http://www.firstdomains.com/(DJANGO_APP)
http://www.firstdomains.com/de/(DJANGO_APP)
http://www.other.com/esp/best/(DJANGO_APP)
http://www.complex.com/it/(DJANGO_APP)
http://www.last.com/(DJANGO_APP)
.... (lot more)
The "combo" domain/directory will determine a theme website and a language. What do you think is the best way to implement this ?
You are in luck! Carl Meyer recently released the perfect app for you: django-hosts
If for some reason the URL parts don't work for you try also adding one of the apps that do URL i18n/l10n such as http://pypi.python.org/pypi/transurlvania

Email notifications of exceptions happening in a Python app?

UPDATE: This is a Django web app
Hi folks, I want to set up email notifications when there is an error happening in my application. In ruby, there is a very elegant solution called ExceptionNotifier, which wraps around the exception handler and uses the built-in mailer to send an email.
What is the best way of doing this in Python? I know that this is a very common issue, so would love for any tips that you folks can share!
PS: Code samples, pointers to modules would be AWESOME! Thanks!
(I'm guessing you're talking about a web app here, because ExceptionNotifier is a Rails plugin...)
A Python web app using which framework? I know there's Django-hoptoad, which is actually a step above the ExecptionNotifier of Ruby, using ThoughtBot's Hoptoad.
But that's just a guess that you're using Django, which you might not be...
Similarly, Pylons (and by extension, Turbogears 2, I guess), has configuration options for error emails

Categories