Should I create Apps for each Model in my django app? [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 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.

Related

Get and transfer data using an API [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 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

Is Django suited to simple webapps? [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 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

Django project structure [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 7 years ago.
Improve this question
I've been playing with Django for a couple of weeks and I decided to try to make my personal website with it.
The only thing I can't yet wrap my head around is how I should structure the project. The essential of the site will be a blog-like portfolio that shows projects. Those projects (comparable to categories on normal blogs) will contain posts about them.
Now my question is, should that be 1 big app or should I divide this into multiple smaller apps and in that case how would you do it?
For now it looks acceptable to have everything in one app, but my plan is to add features along the way and expand the site continuously. After some time I don't exclude the possibility that it could get pretty complex :)
Response to the fact that this question has been closed because it is "mostly opinion based"..
I am asking for experience (that I don't yet have), to be able to make a better choice about how I should structure my project in order to avoid having to restructure it later because I made a bad choice due to a lack of experience. Of course this requires some opinion based answers..
As you only have one category of articles, I recommend you to start with one application.
Hence, you can start with an application named projects. Then, if you want to write about your experiences, create a new application named experiences, and so on.
Personally, my portfolio is built around three categories/applications:
Skills,
Projects,
Experiences.
Applications are ideal for large Django websites. I advise you to add applications to your project when it becomes bigger and more complex. For now, make your life easier by using only one application ;)

Easiest way to manage/monitor a flask app? [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 8 years ago.
Improve this question
I have a small flask app I want to deploy on my server and I'd like to be able to monitor it via an HTTP web interface. I don't need something complicated and I definitely don't want something that's difficult to set up. Previously I've used the Google App engine and the functionality in the Logs tab is completely fine.
The app is served through nginx & gunicorn and uses redis (w/ py-redis) and sqlite (w/ peewee). Ideally I'd like to be able to check the logs for all parts of the system from one place. Is this possible? What's the easiest way?
There is no definitive answer to the predicament and it would be whatever way you are most comfortable with.
You could change all your logging to write to a central database then create a small program which would scrape this data for you. This method also includes configuring a central syslog server:
http://www.linuxjournal.com/content/creating-centralized-syslog-server
What ever way you want to read these files is fine and all depends how much control you want. You could simply name all the logs based on hostname and rsync them to a central server from where you could parse them.
There are also free tools out there which will aid you in choosing you method take a look at:
http://www.linuxjournal.com/content/creating-centralized-syslog-server
There are also some proprietary systems you could use, such as Splunk:
http://www.splunk.com/
This is by no means a definitive list but should aim you in the right direction.

Using Django partially [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 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.

Categories