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 8 years ago.
Improve this question
I'm trying to use mongodb together with django. I mainly use the admin app of django.
I noticed that there are 2 mongodb orms for django.
One is mongoengine, https://github.com/MongoEngine/mongoengine
Another is mongodb-engine from the django-nonrel group.
https://github.com/django-nonrel/mongodb-engine
What I want to know is that whether django's admin app works fine with the two. If not,
which one is better.
Also, I want to know whether 3rd party apps would work if I use mongodb with django? Which of the two orms is more friendly with 3rd party apps?
At first glance, mongodb-engine seems to be more friendly, but it depends on django-nonrel,
which is based on django 1.5. If I want to use recent version of django, mongoengine seems to be the better choice, also mongoengine development seems more active.
The short answer is yes. Django works well with MongoDB.
Please check this thread for more relevant answers: On Using Django with MongoDB
Hope it helps.
Related
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 2 years ago.
Improve this question
When it comes to actually deploying a Django project, is SQL software, like PostegreSQL, or NoSQL, like MongoDB, a better option?
To evaluate which might be a better choice, you can consider:
requires less changes to the actual code of the already existing project - for example having to re-do the models structure,
has correct integration with the backend, i.e.: some years ago MongoDB wouldn't integrate with the Django backend,
is more beginner friendly.
Edit
For this example's sake, let's set some information:
the project uses models such as client, booking, flight, hotel.
it uses with ForeignKeys.
it connects a model client with django's own User model.
Data needs to be retrieved both to client side and administration side.
JSON might be used, if necessary, at some point in the future.
A SQL DB would be appropriate for this project. This is due to the use of foreign keys, the nature of the models and the relationship between client and user.
You will want to be able to store structured data and be able to maintain relationships between that data, this can be achieved with SQL.
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.
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'm trying to make a Django website as a user interface for data I've collected through a scraper. The scraper generates (and constantly updates) a database and I'd like Django to interact with it as well.
I need to run the scraper program often, is there a way I can do this through Django's admin? Like manage the backend that doesn't have to do with Django directly?
Should I merge the databases (scraper and Django)?
Is there a proper way of doing this?
Thanks in advance.
Django supports multiple databases. You can leave your scraping program/database as is and simply access the database through Django. Set up models as you normally would - but in the META field set managed = False. This will prevent Django from applying migrations to the databases.
If you find you do want to manage the database through Django models you will need to set up a routing class to make sure your app only targets the intended database.
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'm pretty new to django and I'm a little confused as to what is the best and common practice for implementing users in Django apps. Do people
use the django's built-in user system in each app,
create an app using django's built-in users and applying that to other apps,
use a third-party app like Pinax, or something else entirely?
Thanks for the help.
Unfortunately, "BEST" is very subjective. Django provides many flexible ways for you to model users (and customize users) so that you can leverage their built in authentication and user system.
Will django's built in user system provide you with everything you need for your requirments? If so then use it, If you just need to add a couple more fields, create a new model and give it a onetoone with the built in user object
Not so much, django provides a new AbstractBaseUser that should be flexible enough to do whatever you need to do regarding users, I have not used it personally yet, but documentation on it can be found https://docs.djangoproject.com/en/dev/topics/auth/customizing/
Does a third party app provide you with your desired functionality out of the box, or with minimal configuration? Probably
Basically, it all depends on your requirements! Django's built in user should be more then sufficient for the majority of websites
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 3 years ago.
Improve this question
How can I configure Django with SQLAlchemy?
You can use SQLAlchemy within a Django project with Aldjemy:
https://github.com/Deepwalker/aldjemy
Check this:
Replacing django orm
alchemy? :)
Google links:
replacing-django-s-orm-with-sqlalchemy
django-sqlalchemy
googleGroups
Please find this little tutorial on how to use SQLAlchemy with Django
There are many benefits of using SQLAlchemy instead of Django ORM, but consider developing a built-in-Django choice of SQLAlchemy
(to have something called a production ready)
By the way, Django ORM is going better - in Django 1.11 they added UNION support (a SQL basic operator), so maybe some day there will be no need to change ORM.