How to manipulate subdomains with sending pyramid url?

Possible duplicate:
Multiple domains and subdomains in one instance of Pyramid

I can not find any documentation on working with subdomains with Pyramid framework. There is one question / answer on SO regarding this, where do they say

"Theoretically, this is covered by add_route () with a regenerator argument."

I also found in docs that mention subdomains under the IRoutePregenerator interface

__call__(request, elements, kw): "The regenerator for the route is called pyramid.request.Request.route_url()to configure the set of arguments passed to it by the user for specific purposes, such as support for Pylons subdomains.

But these are the only places that even mention subdomains, and there is nothing about how to work with them.

All I want is to have a wildcard DNS server for any subdomain. If the subdomain is a user, go to a specific controller, if the subdomain is any other word, go to the controller and provide the subdomain as a variable.

It is very simple with Flask:

mod = Blueprint('users', __name__, subdomain='user')
@mod.route('/')
code

or

mod = Blueprint('everything', __name__)
@mod.route('/', subdomain='<var1>')

How can I / can this be achieved with Pyramid?

+3
source share

All Articles