Sample django and python project [closed] - python

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 9 years ago.
Improve this question
I am a newbie to python and its framework Django. I am learning both the technologies parallel from its documentation, so I thought if there are some projects which I can use as reference for learning then it will help me learn the things fast. Can someone suggest me any such links.

I would suggest that you learn Python well, really well, since django uses Python's myriad of features to almost their fullest extent. I would start off with any random Python tutorial, but Zed Shaw's Learn Python the Hard Way is the best, and you can find a free HTML version of what he wrote. You can then get a book that teaches you to make games (great way to learn); Invent your own games with Python.
Well since you're a newbie, you'll probably want to start off by making a blog or something and then slowly moving up and making more complicated websites. The best approach to learning django is to first make something simple, then look at other people's code and learn from that. You an pick up a lot from reading other people's code and how they've structured their logic.
For a free resource, I would check out Mike Hibbert's Django tutorials on YouTube. He teaches you pretty much everything. Don't worry about the IDE he is using, just use a text editor like Sublime Text 2.
After you've made your simple website, its best that you start reading a book called Two Scoops of Django, by Daniel Greenfield. Really good tips and tricks on how to use django right. Great for newbies.
After that, start reading code. Read other people's code and understand how they made their sites. You can take a look at many sample django projects on the web. I would suggest that you go over to github and just randomly search for django projects. Thats what I did, and I think looking at other people's code is the best way to learn.
Lastly, if you want to get even more into django, join the IRC. Great bunch of guys there, not as lively as the Rails bunch, but they're pretty awesome.

Seconding the tutorial. It really is one of the most comprehensive and easy-to-follow framework tutorials out there. By the time you've finished it you'll have a much greater understanding of how all the django pieces fit together. It also has plenty of room to expand so you can experiment with new ideas.
Completing the tutorial has an added benefit: the django documentation frequently refers back to the tutorial app in its examples. So having the tutorial project available means you can quickly try out the features you're reading up on in an actual project.
One of the things that I (and possibly most people that are new to python as well as django) struggled with was separating "what bits are python?" from "what bits are django?". There's no real quick-fix for this other than gaining experience but like another answer mentioned, learning python on the side (maybe doing a few projects just using python) can help you with writing clean code within django too, and also see what is "missing" without django.

First start with Python as indicated.
Then, with regard to Django: I learnt a lot from the http://www.gettingstartedwithdjango.com/ video series, especially on set up and interesting packages to use.
No need to watch the video if you don't want to, as everything is outlined below the video as well.
Next to that, http://www.effectivedjango.com is a great help.

Related

Understanding Django internals working - Where to start? [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 months ago.
Improve this question
I have dabbled with Django and Created one project successfully.
What I don't understand is how exactly the whole Django Framework Works e.g. internal structure, which line of code gets executed first and why, what would be workflow between a request and response cycle, etc. ? I maybe asking the wrong questions.
What would be the best way to understand the Django framework?
I suggest you to start with a Django in depth video by James Bennett. He's member of the Django core team and was involved with it since the 2005. Video descriptions says:
This is a tutorial that goes beyond most tutorials; it's meant for
developers who already know a bit about Django and want to really
understand the inner guts of the framework. This tutorial will not
involve writing code or apps; rather, it'll be a deep tour of the
workings and APIs of Django itself, across all the bundled components
and at all levels of the stack.
I personally love this video to death, it's the starting point for my understanding of Django.
If you want to build some more advanced Django projects while being a tyro take a look at these -
http://shop.oreilly.com/product/0636920032502.do
http://shop.oreilly.com/product/9781785886775.do
If you want to read more about Django design patterns and best practices try these
https://www.twoscoopspress.com/products/two-scoops-of-django-1-8
https://highperformancedjango.com/
I assume you're wandering into Django framework territory from the neighbourhood of PHP based server-side scripts.
I too(like any newcomer...) was initially intrigued with the seemingly unnecessary abstractions around webpages, databases and business logic of the websites/web apps.
Firstly, understand that the concept of server-side web development using Django is directed by the MVC paradigm. It takes a while getting used to, but is very simple and intuitive once you get a hang of it.
Next, learn to visualize the app directory and project directory structures and the dependencies between them. For example, you should be able to understand the reason for having a separate <your_app_name> folder within every templates folder...
Finally, learning by experience and practice is a good way to learn Django basics. Jump into the simple sample implementations of Polls app to get the workflow. Finish all 7 parts of the Polls app tutorial.
Don't worry if you don't get concepts at once. Re-read them and don't forget to code as you learn.
Here's the starting point:
Django Polls app tutorial Part 1

Is it good to read Python Documentation to learn Python for a beginner? [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
I've started learning Python recently and started reading Head First Python and Learn Python The Hard Way. Both books doesn't seem to explain everything in detail. I wanna know if it's a good idea to read Python Documentation instead of these books. Any help would be appreciated. Thanks in advance!
The documentation has two parts; one is a basic tutorial which won't cover much beyond what you can find in the books, and the majority of it is a reference to the language itself. It is not a good learning resource, but it is (as good documentation is), an excellent reference for when you want to find out what a particular module does.
The documentation won't answer questions like "How do I download a file from the Internet?" (actually, it answers this specific question but the idea is that its not a teaching resource) but it will tell you what are all the methods of the urllib module, however you would already need to know that you need urllib to get the job done; this is the main problem when you are starting out.
I would say from the documentation you should probably skip the tutorial (especially if you are already reading a book), and then have a look at the standard library index which will give you an overview of what modules are available, broken down by function.
I would recommend the Programming Python book by Mark Lutz as a great starting point. It is quite a tome (at 1632 pages) but covers everything you need to know to be proficient in Python.
Once you have gone through that, the next book I would recommend is The Python Standard Library by Example by Doug Hellman. It is an excellent resource on how to use the comprehensive standard library.
Finally, after the two books you are now ready to solve real world problems and nothing helps more than having a cookbook/reference of sorts, for this I can recommend the following:
Python in Practice
Python Cookbook
Writing Idiomatic Python
If you want a comprehensive review of the language, the docs are your best resource.
http://docs.python.org/index.html
Nevertheless, you may prefer to start out with the tutorial (http://docs.python.org/tutorial/) and some introductory material such as the ones you've referenced, so that you can have some experience putting together the basics so that you have experiences to draw from when reviewing the docs, since the library reference (http://docs.python.org/library/index.html) and the language reference (http://docs.python.org/reference/index.html) don't necessarily have a lot of good examples, and frequently presume at least elementary knowledge of the language in its expositions.
The How-To's are a good in-depth review, with examples: http://docs.python.org/howto/index.html
The books are good to introduce you the language, with examples. You should definitely read them if you have time.
The documentation is useful to get technical details on some method, for a specific version of the language (eg Python 2.7.6 reference)
Finally, when you're developing an application, you can also learn by reading the source code, exploring where the code is going and what is happening. An excellent debugging tool is iPdb, which allows you to put breakpoints in your code and examine the current state at that position.
If the documentation is too crude, and the book too long, you can also try some online tutorial. Google is full of resources, like LearnPython.
It is, definitely :-).
I'd also read http://www.diveintopython3.net (or http://www.diveintopython.net for 2.x).

A different approach to understanding programming [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am new to programming. I decided to stick with Python after messing around with objective-c.
I'm beginning to get a grasp on most of the basic concepts, but as an artist, I think visually. This said, I would like to attempt to work in reverse. In other words, I'd like to start out with a complete, functional piece of software and look at the code and mess around with it to see what does what. This is kind of a similar approach to CAD modeling, where you can see which features in the model affect it, and how. This may not make sense to those who are not familiar with CAD, but I hope someone out there can relate?
Exploring existing projects is an excellent way to learn programming. Breaking existing code and fixing it is an even better way.
There are many open source projects out there that you might want to explore. Some of them are code libraries, while others are entire applications. As you are new to programming, you may want to consider looking at projects that are not too gigantic as it might be overwhelming.
Additionally, it may be even more helpful for you to dissect a program that you would actually use. I have not used this program, but PythonCAD might interest you:
http://sourceforge.net/projects/pythoncad/
This most likely does not fall into the small or simple category of open source projects but it sounds like you may already understand the intended functionality which should be of considerable aid to you in your exploration.
Browse through Google Code for open source Python projects that are of interest to you:
http://code.google.com/query/#q=python
I recommend to take a look at the PyRoom project, a no non-sense text editor for writing without distractions. It's barely 2K lines of code and seems simple to understand. You can access the repository here.

How can a total, complete beginner read source code? [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 7 years ago.
Improve this question
I am a complete, total beginner in programming, although I do have knowledge of CSS and HTML.
I would like to learn Python. I downloaded lots of source code but the amount of files and the complexity really confuses me. I don't know where to begin. Is there a particular order I should look for?
Thanks.
EDIT: Sorry guys, I forgot to mention that I already have both the online tutorial and a couple of books handy. I basically I don't quite understand how to "dismantle" and understand complex source code, in order to grasp programming techniques and concepts.
EDIT2: Thanks for the extremely quick comments, guys. I really appreciate it. This website is awesome.
Have you looked at these:
Python tutorial for total beginners?
What is the best quick-read Python book out there?
SO Python Book Search
I would recommend you understand the basics. What are methods, classes, variables and so on. It would be important to understand the constructs you are seeing. If you don't understand those then it's just going to be a bunch of characters.
To understand source code in any language, you first need to learn the language. It's as simple as that!
Usually, reading source code (as a sole activity) will hurt your head without giving much benefit in terms of learning the underlying language. You need a structured tour through carefully chosen small source code examples, such as a book or tutorial will give you.
Check Amazon out for books and Google for tutorials, try a few. The links offered by some of the other answers would also be a great starting point.
There is no magic way to learn anything without reading and writing code yourself. If you get stuck there are always folks in SO who will help you.
Donald Knuth suggests:
"It [is] basically the way you solve some kind of unknown puzzle -- make tables and charts and get a little more information here and make a hypothesis."
(From "Coders at Work", Chapter 15)
In my opinion, the easiest way to understand a program is to study the data structures first. Write them down, memorize them. Only then, think about how they move through program-time.
As an aside, it is sort of a shame how few books there are on code reading. "Coders at Work" is probably the best so far. Ironically, "Reading Code" is one of the worst so far.
If you don't have any experience in programming, even the simplest code might be too hard to understand. Just start reading the docs/tutorial (http://docs.python.org/tutorial/index.html) and write your own small apps. You'll get hang of it soon and will be able to understand what others created.
I would start with reading the Python tutorial. This wiki page looks good, too.
try python "Python in a Nutshell" it gives you from a to z in python..
however, python code is "eye-fiendly" clear and simple to read unlike other languages
http://books.google.jo/books?id=vpTAq4dnmuAC&dq=Python+in+a+Nutshell,+2nd+Edition+(O%27Reilly,+2006)&printsec=frontcover&source=bl&ots=AOQ5A-IdxA&sig=zh6PwVhjlNt5MRKYUZKl65h1goU&hl=en&ei=A7kgS8SiBouh4Qbd6e34CQ&sa=X&oi=book_result&ct=result&resnum=8&ved=0CB8Q6AEwBw
Maybe you have a project in mind that you want to code up? It's very hard to read what other people write, the best way to learn is to try something. Other people will have gone through the problems you will come across, and so why code is written the way it is may start to make sense. This is an excellent site to post questions, no matter how stupid you consider them.

Anyone used Dabo for a medium-big project? [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 4 years ago.
Improve this question
We're at the beginning of a new ERP-ish client-server application, developed as a Python rich client. We're currently evaluating Dabo as our main framework and it looks quite nice and easy to use, but I was wondering, has anyone used it for medium-to-big sized projects?
Thanks for your time!
I'm one of the authors of the Dabo framework. One of our users pointed out to me the extremely negative answer you received, and so I thought I had better chime in and clear up some of the incorrect assumptions in the first reply.
Dabo is indeed well-known in the Python community. I have presented it at 3 of the last 4 US PyCons, and we have several hundred users who subscribe to our email lists. Our website (http://dabodev.com) has not had any service interruptions; I don't know why the first responder claimed to have trouble. Support is through our email lists, and we pride ourselves on helping people quickly and efficiently. Many of the newbie questions help us to identify places where our docs are lacking, so we strongly encourage newcomers to ask questions!
Dabo has been around for 4 years. The fact that it is still a few days away from a 0.9 release is more of a reflection of the rather conservative version numbering of my partner, Paul McNett, than any instabilities in the framework. I know of Dabo apps that have been in production since 2006; I have used it for my own projects since 2004. Whatever importance you attach to release numbers, we are at revision 4522, with consistent work being done to add more and more stuff to the framework; refactor and streamline some of the older code, and yes, clean up some bugs.
Please sign up for our free email support list:
http://leafe.com/mailman/listinfo/dabo-users
...and ask any questions you may have about Dabo there. Not many people have discovered Stack Overflow yet, so I wouldn't expect very informed answers here yet. There are several regular contributors there who use Dabo on a daily basis, and are usually more than happy to offer their opinions and their help.
I have no Dabo experience at all but this question is on the top of the list fo such a long time that I decided to give it a shot:
Framework selection
Assumptions:
medium-to-big project: we're talking about a team of more than 20 people working on something for about a year for the first phase. This is usually an expensive and very important effort for the client.
this project will have significant amount of users (around a hundred) so performance is essential
it's an ERP project so the application will work with large amounts of information
you have no prior Dabo experience in your team
Considerations:
I could not open Dabo project site right now. There seems to be some server problem. That alone would make me think twice about using it for a big project.
It's not a well-known framework. Typing Dabo in Google returns almost no useful results, it does not have a Wikipedia page, all-in-all it's quite obscure. It means that when you will have problems with it (and you will have problems with it) you will have almost no place to go. Your question was unanswered for 8 days on SO, this alone would make me re-consider. If you base your project on an obscure technology you have no previous experience with - it's a huge risk.
You don't have people who know that framework in your team. It means that you have to learn it to get any results at all and to master it will require quite significant amount of time. You will have to factor that time into your project plan. Do you really need it?
What does this framework give you that you cannot do yourself? Quite a lot of time my team tried to use some third-party component or tool only to find that building a custom one would be faster than dealing with third-party problems and limitations. There are brilliant tools available to people nowadays and we would be lost without them - but you have to carefully consider if this tool is one of them
Dabo project version is 0.84. Do you know if they spend time optimising their code for performance at this stage? Did you run any tests to see it will sustain the load you have in your NFRs.
Hope that helps :) Good luck with your project

Categories

Resources