Django - How to design a Django website with subdomains? - django

I'm new to Django...
I will develop a web application that will have subdomains like "us.mysite.com", "uk.mysite.com", "es.mysite.com". I have many doubts about the better way of doing this in Django...
Should I design my Django project by Apps like this:
mysite_project
--> uk_app
--> us_app
--> es_app
If not, what should I do? One Django Projecto for each subdomain?
Best Regards,

Read Using Subdomains in Django.

Is Using Subdomains better than using this? (I don't know the answer--these were the two resources I found, and I'm confused by both.) Which is better/easier? (Hopefully the same answer to both questions, but...)

Related

WordPress blog in Subdirectory of Django website on a CPanel Host

As I read articles and questions online, I believe it is possible; My main question is how to achieve this goal?
I have Django Website with some urls on my domain (I use Setup Python App plugin on CPanel). I can simply achieve this using a subdomain, but I want to run my WordPress blog on a subdirectory, but every url that is not registered in urls.py will raise an error.
What's the best way to reach this goal?
What are the steps that I need to take to reach it?
I will be more than greatful if you point me towards the right direction.
Thanks in advance.

URL parameter before the domain name in Django

I want to configure my urls something like these:
username1.mysite.com
username2.mysite.com
You know, the parameter is actually the username, and its placed before the domain name. Other sites do this I have seen, for example, Wordpress Blogs and so on. Can I do this using Django URLs? Any help is appreciated.
I cannot think of a way to do this using Django's URLs because this is a subdomain NOT a URL parameter. What I would suggest is reading the subdomain in your server config (e.g nginx site config) and writing it into a header to be read by some custome middleware in django
I accomplished something like this with the "django-dynamicsites" plugin.
https://bitbucket.org/uysrc/django-dynamicsites
It's quite old and may need a few tweaks for modern Djangos but it does do what you need, I use it myself and it works well.
It involves modifying the django_sites table so doesn't play too nice with makemigrations. You may have to use the SQL to update the SQL database on your server to get around that.
I stumbled up django-subdomains which does exactly what I want. Thanks everyone.

Django vs Django-CMS -business compare site

I've developing in django for the past few months and I find it extremely great.
My next project is a price-comparing site for local businesses - where each user can add business and comment on each.
The admin of the site won't be a programmer, but with basic knowledge in web and python.
Should I stick to the old familiar django or should I try it out?
Thanks :)
Matan.
django CMS is built on top of Django and meant to be integrated into existing Django applications or extended with new ones. So your question is flawed.
So instead ask yourself if you need CMS functionality (pages managed by your admins). It sounds like your main app (the compare bit) is better handled by a Django application, but maybe you want the site admin to be able to easily edit the About Us page etc, this is where django CMS could come in handy.

Django: Is there a django blog or cms engine that have all wordpress features?

as it says, I want django cms engine that have the capabilities of wordpress.
I wanna build something like tutsplus.com network but want it in python/django base.
Django is a framework, so it would be a bit more involved than wordpress for the most part to make something like tutsplus out of the box.
Check out
http://pinaxproject.com/ (I dig pinax) or
https://github.com/nathanborror/django-basic-apps
But you might also want to dig deeper into django based CMSs (via other posts) like:
Django CMS which is the best?
Integrate existing blog code into Django-CMS?
more detailed list of Django based CMSs here:
http://djangopackages.com/grids/g/cms/
Hope that helps.
I have experience with django-cms and I found it very well documented and easy to start with. I still have to figure out good way of putting forms into it.

Django: One project for integrated blog, forums, and custom web app?

Im still fairly new to Django, so please explain things with that in
mind.
I'm trying to create three websites using 2 subdomains and 1 domain:
for the blog, blog.mysite.com
for the forums, forums.mysite.com
for the custom web app, mysite.com
When building the custom web app, I used contrib.auth to make use of
the built-in django provided user models and functionality.
For the forums, I am planning on using SNAPboard (http://
code.google.com/p/snapboard/) with minimal, if any, modifications. On
initial inspection, it looks like it also uses contrib.auth users.
For the blog, I will probably be rolling my own lightweight blogging
app (since that seems to be the Django way and, also, b/c as Bennet
mentions, there is no killer Django Blog app)
Currently, I am considering two features that require some integration
between the three sites. First, I want to have the users of the custom
web app to use the same account to also log into the forums. Second, I
also (but I haven't figured out how I'm going to do this yet) would
like my blog posts to automatically become a topic for discussion in
the forums (this is just an idea I had, I might end up dropping it).
Ok, so to my questions:
1) Again, I'm new to Django, but this integration leads me to believe
the three websites need to be all under one project. Is this correct?
2) How would I accomplish the url structure for the websites that I
described above (blog.mysite.com, etc)? In the project's urls.py, I
don't know how to filter off of subdomains. If it was mysite.com/
forums/, that would be easy, but I don't know how to to catch
forums.mysite.com and forward it to the appropriate Django app.
3) Would I have to make use of the django.contrib.sites framework? I
don't understand that framework fully, but it seems like it's used
when two different websites are using the same django app in the
background. Whereas my three websites are all using different django
apps, but I want them to share a little bit of data.
Thanks for your help.
1) Yes, it's only true way for that
2) Use middleware
3) No, you don't need it.