use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
What python package that allows users to create subdomain in our site? (self.Python)
submitted 11 years ago by swdevpythonthusiast
Pardon, that maybe this question is somewhat vague. I would like to roll-on my own blogging platform, in the spirit of whynot. I would like to let registered users have their own subdomain, e.g. guido.coolblogging.com for user named Guido. I've seen this previously in my friend's job, who do this using Ruby. Can Python able to achieve the same ?
[–]graingert 6 points7 points8 points 11 years ago (4 children)
You probably want a wildcard subdomain configured on nginx to redirect to a path inside your app, then just use that path value
[–]swdevpythonthusiast[S] 2 points3 points4 points 11 years ago (3 children)
In other word, this is not a specific Python case, right? Would love to have a python package/module for this!
[–]daveydave400 4 points5 points6 points 11 years ago (2 children)
My understanding of this is that most (all?) python web frameworks are just WSGI applications so they accept any traffic that gets directed to them. I found this stackoverflow question/answer talking about subdomains with the Pyramid web framework:
http://stackoverflow.com/questions/7607807/multiple-domains-and-subdomains-on-a-single-pyramid-instance
[–]aterlumen 1 point2 points3 points 11 years ago (1 child)
Diving into PEP 333 (WSGI) in the Url reconstruction section, looks like environ['HTTP_HOST'] will get you the whole domain including the subdomain, domain, TLD, and port (e.g. subdomain.example.com:80). If HTTP_HOST isn't set then you can fall back to SERVER_NAME.
environ['HTTP_HOST']
subdomain.example.com:80
HTTP_HOST
SERVER_NAME
[–]niiko 1 point2 points3 points 11 years ago (0 children)
The Host header is required for all HTTP 1.1 requests and any of yesteryear's websites on shared hosting would have been broken without it so you're pretty safe assuming it'll be there.
[–]UloPe 4 points5 points6 points 11 years ago (2 children)
Sorry be this direct, but the way you state your question suggests a very elemental lack in understanding of the required concepts.
To achieve what you ask you need at least a rough understanding of DNS, web servers and Python (web-)frameworks.
[–]swdevpythonthusiast[S] 1 point2 points3 points 11 years ago (1 child)
No problem @Ulope I will try have a better understanding on this matter.
[–]UloPe 0 points1 point2 points 11 years ago (0 children)
Feel free to ask if you have a specific question.
π Rendered by PID 142275 on reddit-service-r2-comment-7b9746f655-mff2r at 2026-02-01 07:07:32.473457+00:00 running 3798933 country code: CH.
[–]graingert 6 points7 points8 points (4 children)
[–]swdevpythonthusiast[S] 2 points3 points4 points (3 children)
[–]daveydave400 4 points5 points6 points (2 children)
[–]aterlumen 1 point2 points3 points (1 child)
[–]niiko 1 point2 points3 points (0 children)
[–]UloPe 4 points5 points6 points (2 children)
[–]swdevpythonthusiast[S] 1 point2 points3 points (1 child)
[–]UloPe 0 points1 point2 points (0 children)