Django project structure [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 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 ;)

Related

First time web design, know Python already, any advice which direction to go? [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 5 days ago.
Improve this question
I am a sort of experienced python programmer. I will quickly describe my situation. For a hobby programming was always nice. I then started working at a company that did lots of manual excel processing. One day I mentioned that I could probably automate this with python.
Things led to another and now there is python doing the excel work multiple times a day running from an Intel NUC i deployed as a small server. It has been some work figuring everything out but the money has been good as well, no complaints.
They are quite happy with me and have lots of different plans.
They want me to design a website where the employees can fill out a form daily and the data can be used elsewhere. However, I've done some html and css programming in highschool, but I know there needs to be a back-end to at least save the data that gets filled.
I dont know where to start. I know SQL is the #1 language in data processing and PHP in handling the back-end. But I already know python which also can do back-end operations.
I have two direct questions but also looking for advice on the whole situation. Feel free to just point anything out; I will read every comment.
My questions:
Could I run the webserver from my Intel NUC? Or is this generally seen as bad practice? Also, is it true that I would only need the domain if I run the webserver myself?
Is it worth it to learn SQL and PHP or should I stick to python?
I have tried looking online but found countless of resources. I would like to create a large database with lots of data I can use anytime. I think SQL is good for this but not looking to waste time.

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: What are the downsides of manually altering model fields with SQL? [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
Since syncdb doesn't alter existing tables [1] I'm wondering what the downsides would be of logging in to a database and altering the structure.
More specifically I'd want to know what potential problems could be triggered if I change the length or type of a field (e.g. INT to BIGINT).
Will there be any issues with Django trying to truncate or alter the value to fit within the scope defined in the model?
Downsides ? If you are talking about simple project, then there arent any. Do whatever pleases you :). If the project grows bigger, then read next paragraph :P
If it is larger project and has other contributors (and even if it does not), you need to version control it. And for this reason, manual changes are BAD. Cause you just cant go back to earlier version without changing the database.... BUT....
But since you are talking about doing this manually, i feel, that i need to point out the existance of http://south.aeracode.org/
Which is created exactly for the reason that you, perhaps, should not be doing this manually.
BTW. im trolling here and talking tongue in cheek... don't take this post 100% seriously :P
Django South is the solution to this problem. It is a "must have" app to include (and here I'm going to disagree with #OdifYitsaeb's answer) in ANY project, not just large ones. It is so simple and powerful that you are essentially creating more work for yourself if you don't use it even in a tiny personal project.
It's soon to be included into Django core in (I beleive) 1.7 as well, so it's a good idea to get familiar with it now.

Create website with Python without using 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 8 years ago.
Improve this question
I need to create a website using python but without Django or any other framework, since the website I need to create ts very custom (at the back-end level specially) like having a dashboard after login and stuff like that.
I want to know what are the best practices and/or tutorials that can help me in such a situation.
I began to work with Django 3 months ago in a company. In my opinion this framework is very useful because you avoid to write a lot of HTML code and came with a lot of tools to automate the creation of many parts of the web and the database. Django allows you to use different databases.
I recommend you to visit Django Website and see the overview and the installation. The difficulties for the beginners are to understand the use of views,templates,urls... but in the web site you have a 6 steps tutorial that make a very good introduction, anyways you must get some more information like this Django Book but is almost the same than the tutorial but more extense.
I didn't work with Python until I began to use Django, and I have to say that now I love the dynamism of Python, is fast and easy to understand.
I hope this can help you a little
Using a framework like Django will start you right into developing your application. They you intend to work will cost you years of work to create your own web application infrastructure without getting anything useful.
The strength of Python is the availability of countless modules, packages and frameworks to build upon. Without there you will be getting nowhere.

Is it necessary to use/make a script that make django development easier? [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 just start a django-fairy project for django 1.3.1 here: https://github.com/goFrendiAsgard/django-fairy
It is just a simple (but I think useful) python script that can help django newbie to develop everything faster. The basic idea is:
When you make a view, usually you will make respective url and template
When you make a model, usually you will register it on admin
So that it would be more fun, if there is a way to do such a things in a simple way.
I want to make sure if what I do is right.
So these is my questions:
Do you think that such a project is useful for community?
Is it violate django (and python) philosophy?
Do you think that such a project is useful for community?
Yes, just keep developing it plus, you will know that from the users as feedback and even if the feedback wasn't good enough, let your project be, enhance it more and more and your project will get a good rating and acceptance in no time. Just consider your users' notes and comments and you will be fine.
Is it violate django (and python) philosophy?
No, it is not.
The only way to tell if it is useful is for you to complete it and publish it and people start using it.
No, there are tons of other quick bootstrapping scripts available for django. There is no such policy that prevents this.
However, you shouldn't make a lot of assumptions as to what the end user will want to do with their models/views. Django is a toolset and as such there are lots of ways to use it.
For example, there are models that are never entered in the admin, and similarly there are django sites that don't have a "front end" (ie, a view) and only use the ORM and the admin, with applications like databrowse

Categories