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
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 1 year ago.
Improve this question
I am a novice in Django.
I am just wondering why most developers would create separate dashboards to login and logout to perform all the CRUD functions. Why go through all that trouble instead of using the shipped Admin panel and create your users and assign permissions/roles to them to perform basically all the CRUD functions.
The admin panel functionality is limited and making changes can be burdensome. The admin panel is useful out of the box for an admin who needs access to database-level information, but for enterprise solutions I often find myself building custom dashboards as you suggest. The nice thing about django is that the structure makes any code you write highly reusable - in fact I've only written one custom dashboard and have reused it across all my various projects with great success!
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 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.
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.
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 have created an online webstore. Initially I used Django due to its awesome ORM (in fact the first ORM I met) and built-in admin.
My webstore consists of couple basic components such as shopping cart, a catalog and some user management module.
Over the time I realized that using the built-in admin is not efficient. I spent a lot of time reworking the data registration form due to FK relationship tables and as the items in the webstore diversified, the catalog table has to be extended.
One of the solution that came across my mind is to develop the catalog using NoSQL such as MongoDB in order to make it more flexible. A great idea but then I found out that NoSQL is not officially supported in Django. There is a fork of Django that supports NoSQL but the version is way behind the mainstream and there is no guarantee will be supported for a long time.
Then I came across Pyramid. I really love Python and I would like to stay developing using it. I found out that Pyramid has SQLAlchemy to replace the Django ORM and can be used with MongoDB. It also simpler; I have to plug only components that I want to use and there is lesser point of sticking with Django as I found out the built in admin is not practical for this.
However, I have yet found any good Pyramid hosting. Should I migrate my webstore to Pyramid? Does it worth it? What are the risk and challenges that I need to consider before this migration?
The MongoEngine is very similar to the ORM used by Django.
Sample code:
Model:
class UserProfile(Document):
user = ReferenceField(User, required=True, primary_key=True)
name = StringField()
View or Action
user_obj = authenticate(username=account, password=passwd)
profile_obj = UserProfile.objects(user = user_obj).first()
profile_obj.name = "Mongo"
profile_obj.save()