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 9 years ago.
Improve this question
Is it possible to use only some features of Django?
I'm using my own home-made ORM with redis for a webapp using the MVC model. Now I want to know what I have to do to so that I can take advantage of Django's very nice admin.py
Has anyone ever done anything similar?
You can "use only some features of Django", but some parts depend on other parts. Django Admin is very dependent on Django ORM. It is basically a tool for visualizing, creating and editing Django ORM models. Using it with your own "home-made" ORM is virtually impossible.
Take a look at django-nonrel. It forks Django to provide support for non-relational databases (currently MongoDB and Google App Engine). It might help you if your main aim is to use a non-sql db in your project. It still won't help you to easily integrate your custom ORM with Django Admin. So your other option is to write your own admin for your project.
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 10 months ago.
Improve this question
I have just learned python, and am beginning to make a web application using Django / DRF in the back end.
The back end would be similar to a CRUD, or just a CRUD actually, I'm not planning on doing too much processing on requests, but would be queuing jobs for another python script on the server to pick up when needed.
The API I'm building would need to manage a few different entities like Users, Packages, Transactions, Jobs etc, and I plan to manage all of these entities... no ... models... via a rest API.
Do I create an app for each model ? e.g. user_app, package_app, and transaction_app ? or should I create a single app to manage them all?
I'm torn between thinking of Django Apps as actual applications, or Bundles like in PHP/Symfony
There is no obligation to create a new app for every feature that depends on another part of the project logic.
But overall the more you divide into, the easier it will be in the future.
when the project updated and new features added it will be easy to manage it.
Also take a look at some open source projects.
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 3 years ago.
Improve this question
I have to develop an API to manage data between my Database in PostGreSQL and my website in Django.
I'm actually looking for the best way to manage and transfer this data, what I actually found on different topics / sites is the Django Rest Framework to develop a Rest API in Django, here I would use a JavaScript framework for the front like React, Angular or VueJS (any tips about which one to choose ? ).
I was wondering if there was other solutions that would be interesting ? I've been searching about FTP or things like this.
Thanks,
Lucas
Like you said you need to send and retrieve information like name, contact, login detail etc related to user and their subscriptions.
In this case you don't have to think about FTP. It isn't related here. FTP is something that you'll use to transfer files without django.
With django you will have to use DRF (django rest framework) or use GraphQL along.
There is a package well known to use GraphQl called graphene
For front end part you can use anything according to your requirement and skillset.
Hope this helps.
Cheers
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 5 years ago.
Improve this question
I wonder if a good habit is to have some logic in MySQL database (triggers etc.) instead of logic in Django backend. I'm aware of fact that some functionalities may be done both in backend and in database but I would like to do it in accordance with good practices. I'm not sure I should do some things manually or maybe whole database should be generated by Django (is it possible)? What are the best rules to do it as well as possible? I would like to know the opinion of experienced people.
It is true that if you used a database for your business logic you could get maximum possible performance and security optimizations. However, you would also risk many things such as
No separation of concerns
Being bound to the database vendor
etc.
Also, whatever logic you write in your database won't be version controlled with your app. Thus, whenever you change your database, you will have to create all those things once again.
Instead, use Django ORM. It will create and manage your database based on your models by itself. As a result, whenever you recreate your database, you will just have to run migrations with one single command and you are done.
This will cover most of the situations. And whenever you will need those speeds of stored procedures, Django ORM has you covered as well.
In short, I believe that business logic should be kept out of the database as much as possible.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Does django have the same level of code generation like Rails?
In rails you can create models, which then create database migrations.
You can generate controllers, views using the command line.
Django has a very similar way of handling database migrations. They are created by calling python manage.py makemigrations and applied with python manage.py migrate
Controllers (urls.py) must be added manually to each app, but by typing one import statement they are ready to be used.
Views are made automatically when an app is initialized. However, they are empty, so creating a app does not give you the automatic CRUD html that rails does. There is generic class based views in Django which have most of data management done for you, along with automatic form generation, but this requires some actual coding albeit very little.
TLDR: In terms of prefab code generation, Rails wins, but any experienced Django developer can include generic views and forms to get the same functionality in minutes.
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 7 years ago.
Improve this question
I'm diving into Django to create a webapp.
The thing is, I'm not sure if my app is too simple for what Django offers.
My app will download the latest CPI figures and convert your (monetary) dataset into inflation-adjusted figures, going way back in decades. The user pastes their data in via a textbox. It certainly won't need SQL.
I may want to expand the project with more features in future.
Is it advisable to go with a more lightweight framework for something as simple as I've described?
Every framework has its pros and cons. There are many different frameworks. Personally I prefer Flask but it is all personal preference. Here are some articles that help describe the differences:
https://www.airpair.com/python/posts/django-flask-pyramid
https://www.reddit.com/r/Python/comments/1yr8v5/django_vs_flask/
https://www.hakkalabs.co/articles/django-and-flask
A webapp like the one you describe sounds like most of the work can happen on the client side, without sending the data back to server. From what it sounds like, you simply need to make a few calculations and present the data in a new way.
For this I don't recommend Django, which is ideal for serving pages and managing relational DB content, but not really useful for client side work.
I'd recommend AngularJS