Multiple Django apps under the same site [closed] - python

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I am thinking of creating a content delivery web application using Django with a MySQL database, and after reading the docs a bit I noted that it is possible to create multiple apps in the same project/site directory.
It may or may not apply to what I want to do, but I was wondering what the motivation behind this architecture is. Why would I want multiple web apps in one site?
For example, Youtube was built around the Django framework, but the entire experience works seamlessly as one application? Is Youtube actually one large web application, or does the project use many applications packaged as one product? If so, why would that be a better option?

There's a good explanation about it in the django docs here and here.
From my own experience: it helps you to organize your code. If you're planning to create a small application it may not need more than one django application. But it you want to create medium or large applications you can take advantages of this approach. Some of useful cases:
Authentication
Blog
Split your RESTFul API based on resources (e.g. clients, invoices, users, etc)
Logging
Chat
Hope that helps a bit.

Related

Real Time App with Python - Tornado - Falcon - Django [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
i have to develop a Real Time Application that supports thousands of users with Python. The question: decide which framework and architecture use.
The first option is:
Falcon only (Admin and API)
The second:
Tornado manage request, Admin runs Django and API runs Falcon
Another problem is database. Could be one only RethinkDB (1st option), or two, with Postgresql (2nd option).
Which of these option is the best? Should try something different?
PD: One fancy implementation could be with Tornado sockets
I think your question needs to be more specific.
Without more detail about the application my general suggestion would be to not complicate things by using many frameworks, just pick one that does everything you need.
Unless you are planning to design an asynchronous API forget about Tornado. If your application is very small and has a simple API then you could consider Falcon because of it's short learning curve. Otherwise I'd suggest going with Django.
As for the DB, it's nearly impossible to provide a suggestion without understanding what type of data you are planning to store? What is your expected read/write ratio? Do you already have operational experience with any DBs?

Create an admin panel for GAE web app [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm newbie in GAE and just trying to work out basic principles of my future web app. So I looking to java to design my app. And I want realize which is better way to create admin panel? An admin should be allowed to manage posts and users for example.
I heard that Django has build-in admin panel, but I do not experienced in Python.
The great thing about going the Python/Django route is that there are great tutorials that walk you through the process step-by-step.
One example.
Google's own example of how to get Django running.
Another example, but be more careful with this one: it's slightly out-of-date. Still a good reference though.
If you're comfortable with programming, Python is a very easy language to pickup. As you mentioned, Django provides a great admin interface that does a lot of the work for you.
If you do decide to use Java, you'll have to build the admin interface from scratch, which generally takes quite a bit of time (if you want to do it right and do it well). I recommend that you use a framework to help you in the process, and here Google has some documentation on which frameworks work in GAE.

What would be the more practical uses for a Django application w/out a database? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I recently got into Django out of curiosity after developing for quite a while w/ Ruby on Rails and Node.js, and found that it's splendid for working w/ databases. Django is primarily known for working with databases and every tutorial I've ever found on it has included databases. Django supports not requiring databases however, and, just out of curiosity since I'm still rather inexperienced w/ Django, what would be some practical uses w/ Django w/out requiring databases?
I do not recommend using Django if you are not interested in using a database. Having written that disclaimer, if you insist on still using it, you can just scan over the documentation and identify what is still available to you if you do not have a database:
You can use Django's security features to help protect against clickjacking, cross site request forgeries, etc.
You can take advantage of Django's support for internationalization if you want to support multiple languages on your website.
You can have Django handle validation of any forms you have on your website.
...basically you can create a static website that takes advantage of the rapid prototyping enabled by a framework built using Python.
I can't think of many if I'm honest. If you are writing a web application that doesn't need to store to retrieve things from some sort of storage then using a whole Django project is probably total overkill.
A blog wouldn't really require a database if you only had a single user who was willing to add posts by adding files manually, but something like Jekell would be better for that.
You could create a web app that would interact with the server it's on. For example, you could create a web page that called a unix command when you hit a create webpage. You would be able to use to this create some sort of dashboard for your server or maybe provide a cleaner user interface for things that you could do with ssh. However, Django might be overkill for this, something like Flask might work better as you would have a lot less overhead.

Django sites framework - Is this a good fit? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am trying to run around 50 mini sites which share about 90% of their code. My inital idea was to run them as separate applications with a common library but I have read about the sites framework which would allow them to run from a single instance.
https://docs.djangoproject.com/en/dev/ref/contrib/sites/
My question is, is the site framework the right approach to a problem like this, and does it have real benefits over running separate applications.
The sites framework is likely perfect for what you are doing. Generally, it allows you to use the same architecture and functionality across a variety of extremely similar sites. The main benefit is that instead of having to manage 50 different servers, or 50 different instances of Django running, that you can maintain 1 instance of Django. That includes database migrations, deployments, etc.
The sites framework is mostly useful to implement "multi tenancy" in your database - different sets of data belonging to different sites/instances, all in the same database.
Along with this you can define a hostname for each site.
But your SITE_ID is set in settings.py, so in order to have multiple sites, you need multiple settings.py configurations, which means multiple distinct processes/instances. You can of course share the code base between them, but each site will need a dedicated worker / WSGIDaemon to serve the site.
Alternatively, you can use django_layers (a package I wrote) to serve different sites (with different templates, static resources, and so on) from a single instance.

Python - micro-web frameworks - [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
There is a lot going on in web frameworks - they can take an age to learn.
So, what is it I am missing when I say that WSGI defines pretty much all we need to respond to a request. If I overload the environ dict I can store almost all I need, so what am I gaining from a framework?
You can certainly write a web application using only WSGI, but at some point you're going to have to solve the following problems:
How do I handle different url requests?
How do I parse form data?
How do I render a response?
How do I support sessions?
How do I persist data?
etc, etc, etc...
Each web framework solves some (or all) of these problems. Yes, you could design and implement solutions yourself, but web frameworks contain solutions that other people have found work very well for them. So that's what you get from a framework: a bunch of suggestions for how to solve common problems when writing web apps.
Finally, it's easy to be overwhelmed by the number of choices for web frameworks, but if you just learn one, others will be much easier to understand. I would recommend learning either django or a more minimalist framework like flask. Other frameworks are pretty similar to these two, and you'll be able to pick them up easily.

Categories

Resources