How to best configure gedit to work with Django? - django

Am looking for a good and free IDE to work with Django framework. I came to learn that gedit is a powerful one with right plugins.
How to best configure gedit to work with Django ?
My requirements include -
easy navigation (finding usages, declarations etc)
auto completion
replacements/updates across files
(obviously) editing/debugging python, CSS/HTML, database queries etc
(optionally) integration with GitHub
Am new to Python/Django, so please suggest any other plugins that might be useful.

you can use Sublime Text wirh Djaneiro for django and python, SublimeCodeIntel

Related

Is there code generator for Django like Gii?

I use Gii code generator with Yii2 framework for more that 3 years ago.
Now I want to change to Django but I need a similar code generator.
No, I don't think so. Django has some great built-in features that makes coding web applications so much easier, but you have to write Python to use it.
But don't be afraid, it's quite easy to learn!
You could try Telosys (https://www.telosys.org) a lightweight code generator that is able to generate any kind of langage (Python among others) with any kind of framework (possibly Django).
This tool is quite simple, free and Open Source.
It provides a CLI (Command Line Interface) and Eclipse plugin, so it can be used with any IDE
It is usualy used to boostrap a project and to generated all the repetitive code (CRUD, Controllers, unit tests, HTML pages, etc)
Some Python application templates are already available (not for Django but it can serve as an example):
https://github.com/telosys-templates-v3/python-web-mvc-bottle
https://github.com/telosys-templates-v3/python-persistence-sqlalchemy
See also this tutorial: https://www.slideshare.net/lguerin/telosys-tutorial-code-generation-for-a-python-web-application-based-on-bottle-and-sqlalchemy

What web-CMS website language do you recommend?

I am a novice web designer who has a history of creating websites using templates and WSIWYG programs like Dreamweaver. So I know some basic html and a little flash. But that's it - I DO NOT know CSS or CMS. Mostly I'm a graphic designer. But I'm looking to learn a new web language...
I now have a client who wants me to design a website so that in the future, they can edit the website themselves. I know this is a popular trend these days in the client community. And I know this is the main purpose of web CMS. I am looking to learn a new web language but want to make sure I learn the right one.
My question is, what language do you recommend to build this website -- making it the easiest for the client to edit in the future? What language has the best/easiest interface for a NON-DESIGNER to edit a website? Another matter of note, also, is the flexibility of design creativity on my end.
Wordpress? Droopal? Joomla? I've researched a little bit about Adobe Contribute CS5 as well and thought of this also as a viable option... perhaps?
Thoughts? Suggestions?
In depth info would be awesome! Pros/cons of popular languages, common uses for popular languages (blogs, ecommerce, etc.), links to further knowledge, references, etc.
Thanks!!
Without a doubt, you should start with Wordpress.
You may take a look at this google trends comparison: https://trends.google.com/trends/explore?q=wordpress,drupal,joomla
I'm not saying is the best, but Wordpress is VERY popular, it is much simpler to begin with, and I think you'll get much more job offers.
Regarding languages and technologies, Wordpress is PHP powered, so your learning path should be:
- HTML
- CSS
- PHP
- JavaScript / jQuery
And for the future, you might start thinking on Javascript, Node, Angular and React since the internet ship is going that direction (even Wordpress)
My personal recommendation if you wanted to code fancy things would be Python and the Django web framework. However, that's probably a bit more advanced than you can currently handle.
All 3 of the frameworks you've listed are well respected. Which one you choose is really going to depend on what kind of site you're building. If you're building a site which focuses around a blog, by all means use Wordpress. You can add static elements relatively easily, but it shines for episodic content. If you're building a site that has more static "page" type content, either Drupal or Joomla are reasonable choices. I would probably lean a bit towards Drupal. If you tell us what kind of page you're building for your client, we can give you more tailored advice.
As an aside, "CMS" isn't really a language. The systems you're talking about are frameworks. PHP is the language that they happen to be written in.
You won't go wrong with any of the above options.
I would stay away from Adobe Contribute.
There are many good open source content systems such as wordpress, drupal, joomla, etc. They can be customized for your needs. Here are some tips if you want to write your own: learn soke script language like php, perl, python,etc. Php is very user-friendly and there are so much built in functions that make your life easier. You also need some database experience - mysql, postgre, etc. Creating your own cms is a good way to learn a concept, so good luck.
I would definitely start with learning HTML 4 (and 5) and CSS.
For a server side language there are several options. Perhaps PHP is the easiest to start with.
WordPress is a very powerful framework. Joomla is even bigger. It totally depends on the requirements. But if you want to use a framework like Joomla, Drupal, or WordPress, PHP is probably the best language to study. Personally I'd prefer ASP.NET, but that's mostly because I'm already familiar with that framework. I like PHP as well, but it always feels like ASP.NET is more mature. But that's my personal opinion!
Take a look at the features of WordPress, Joomla, Drupal, that's the best advice I can give. You've got the requirements for the website so, after a short study, you are the only one who can make a good decision.

What's a good open source django project to learn from?

What is a good django open source app that I can learn from? Something that follows best practices, and covers the majority of features and isn't overly complicated?
This would depend on your current level of knowledge of python and django.
If you are just starting to use django, I suggest you take a look in django documentation. It is well specified and clear. If you have some project in mind, start working on it while looking up for best practices about specific parts. For python coding style try to follow the pep 8 style guide.
If you already have done some work with django there are many sites lie these:
http://djangopackages.com/categories/apps/
http://www.django-apps.com/
What I do nowdays is look into django contrib apps (admin, auth, comments, flatpages), which are built based on the rest of django. This gives the best ways on how to write my apps.
Following the django comments framework (object independent), I am working on an app django-valuate (object independent attachment of ratings, likebuttons etc. through template tags)
These are some of my views. I have also starred this question, as I would like to know about some different perspectives and if mine are sound.
I've found djangobb (www.djangobb.org) to be a complete application, production quality and relatively simple. I use it as a base for my application which has nothing to do with forums and bb.
cloc output: only 3000 lines of python code in 30 files, another 2900 lines of templates html
I do not think there would be any one specific app that would cover all/most features of Django since the concept of the Django app itself is to perform specific/related functionality.
Having said that, a popular Django app is django-registration. Its popularity stems from the obvious requirement of most webapps to have User authentication and also its extremely easy to integrate with a Django project.
The best approach perhaps would be to keep trying the tons of open source Django apps available on the net. You can browse through http://www.djangopackages.com/ and http://www.django-apps.com/ to start getting your hands dirty.
snipt.net, a code sharing site:
https://github.com/lionburger/snipt
Review Board, a code review web app
https://github.com/reviewboard/reviewboard/tree/master/reviewboard
rietveld, another code review on app engine, by GVR himself. You need to know a bit of Django before digging into this source code since the Django models don't work on App Engine, GAE db model is used instead.
http://code.google.com/p/rietveld/source/browse/#svn%2Ftrunk

Web Application Frameworks: C++ vs Python

I am familiar with both Python and C++ as a programmer. I was thinking of writing my own simple web application and I wanted to know which language would be more appropriate for server-side web development.
Some things I'm looking for:
It has to be intuitive. I recognize that Wt exists and it follows the model of Qt. The one thing I hate about Qt is that they encourage strange syntax through obfuscated means (e.g. the "public slots:" idiom). If I'm going to write C++, I need it to be standard, recognizable, clean code. No fancy shmancy silliness that Qt provides.
The less non-C++ or Python code I have to write, the better. The thing about Django (Python web framework) is that it requires you pretty much write the HTML by hand. I think it would be great if HTML forms took more of a wxWidgets approach. Wt is close to this but follows the Qt model instead of wxWidgets.
I'm typically writing video games with C++ and I have no experience in web development. I want to write a nice web site for many reasons. I want it to be a learning experience, I want it to be fun, and I want to easily be able to concentrate on "fun stuff" (e.g. less boilerplate, more meat of the app).
Any tips for a newbie web developer? I'm guessing web app frameworks are the way to go, but it's just a matter of picking one.
I would go with Wt because:
You already know C++
It has a nice layout system, so you don't need to know lots of HTML
It is very well written and a pleasure to code in
Your deployed apps will handle 50 times the load of the python app on less hardware (from experience with pylons apps, 10,000 times the load of a plone app :P)
It has all the libraries that the guy in the first question says it doesn't and more
In built development webserver
Templating language
ORM
unit testing help
open-id and user+password authentication
A brilliant widget library
Web 2.0 isn't an after thought; it wasn't designed on a Request+Response model like all the python frameworks (as far as I know), but on an event driven interactive model.
It uses WebSockets if available
Falls back to normal ajax gracefully if not
Falls back to http for browsers like linx
It is more like coding a gui app than a web app, which is probably what you're used to
It is statically typed and therefore less error prone. Does def delete(id): take an int or a string ?
The unit tests (on my apps at least) take 10-100 times less time than my python app unit tests to run (including the compile time)
It has a strong and friendly community. All my email list posts are answered in 0-3 days.
If you'd like to avoid writing HTML, you could try GWT. However, in my experience, using an intermediate framework to generate HTML and ECMAScript never works anywhere near as well as hand-writing the pages.
[edit] nikow mentions in the comments that Pyjamas is a port of GWT to Python.
Regarding the language, if given the choice between C++ and Python I would pick Python 100% of the time. Even ignoring the obvious difference in abstraction between those languages, Python simply has more useful libraries than C++. You don't have to write your own development-oriented web server -- Django comes with one. You don't need to write a custom template library -- Python has Genshi. Django comes with a capable ORM layer, or for even more control you can use SQLAlchemy. It's barely a contest.
Django is good point to start web development it is great framework
If you look for C++ take a look on CppCMS, it is much more close to Django, it is not like Wt that mimics Qt.
In any case, it is really depends on your needs. C++ can be used for embedded or high performance web applications, but for medium range web sites Django would be better. (and I'm developer of CppCMS)
I think you better go firt python in your case, meanwhile you can extend cppCMS functionalities and write your own framework arround it.
wt was a good idea design, but somehow not that suitable.
If you are exploring Python frameworks (based on the excepted answer I think you are) I think you really owe it to yourself to check out CherryPy. When you write CherryPy apps, you really are just writing Python apps. The framework gets out of your way in a real hurry. Your free to choose your own templating, ORM (if you choose to use ORM), etc. Seriously, take 10 or 20 minutes and give it a look.
The only reason you might want to use C++ over Python is when speed is paramount.
If this is going to be your first web-app, you'll probably be ok with just Python, and your development speed will be orders of magnitude better than with CPP.
Django's templating language is far from powerless, to me it actually seems very pythonic. You actually can write pure python in a template(although this is generally not recommended).
Even better, it's possible to replace Django's templating system with the one you like.
My personal favourite language for this is HAML.
Here's some data on this:
Is there a HAML implementation for use with Python and Django
Having looked several ones, like django, pylos, web2py, wt. My recommendation is web2py. It's a python version of "ruby on rails" and easy to learn.

Using Git For Community-Oriented Website Content Revision System

I'm working on a Django-based web app in which the community fuels the content on the site, much like a wiki. Content is in the form of HTML, and users have total freedom to fork articles/chapters or make their own modifications to existing ones and add them to the current 'working version'. The maintainer of each article/chapter (the original authors[s]), will have the option of accepting these changes.
We're also planning on maintaining two versions - or at least views - of any given article: the author-approved edits version and the free-for-all community based edits version.
The revision system that would manage all this forking, merging and branching on top of detailed histories is starting to sound a lot like what a source revision system does. So I'm considering using Git to manage these revisions.
My question to those more experienced in this type of thing than I:
Is it worth the effort and after that, will it be better than rolling something out in a RDBMS?
And if so, roughly, how should I go about implementing this with Django/Python?
asked again in hopes of catching more replies, this is very important to me
I don't know any Django module which would offer what you want (at least wiki i.e. editable text with some lightweight markip language, coupled with version control system), but you can take a look at InterfacesFrontendsAndTools page at Git Wiki, section "Wikis, blogs, etc.". Among others you can find there:
wikiri: simple, single-file wiki written in Python, with optional git support for history tracking
Chuyen: a weblog software written in Python, using the Django web framework and Git as its data storage backend through PyGit
Pystl: very simple, small blog engine in Python, using Git for version control.
You might consider looking at how ikiwiki works. It's a simple wiki system that can be backed by a real version control system (I use it with a Git repository).
GitPython is a python library that interacts with Git repositories. I've played around with it, but not used it in production. It seems solid and relatively easy to use, and is under active development.
If you have difficulties integrating Git with your Django project, you might look at Mercurial. I strongly prefer Git, with its elegant and powerful data model, but Mercurial offers functionality similar to Git and it is written in python, so it might be easier for you.
django-rcsfield might be helpful. It is a field (like models.TextField) for the Django web framework which - under the hood - versionizes its content. The 'rcs' in the name is short for revision control system.
http://code.google.com/p/django-rcsfield/
I've just seen this on reddit:
https://launchpad.net/django-wikiapp/
Django WikiApp is a pluggable
application for Django that aims to
provide a complete Wiki (for really
small values of "complete").
HIH,