Jump-starting web development - language-agnostic

I wrote a prototype for my software in Python as a desktop client-server program, but I want to do the real version as a web service. (I have seen the light? much better deployment and reduced cost) Trouble is, I don't know web development.
I already did something webdev-ish: I have a page with a form on it, that when submitted Apache will run my Python script, which will do some server-side tasks and then send the result on a new page back to the user. Its a very simple tool (doesn't use any DB or framework), but I suppose that's the basic idea of web-based services... I think. To me that was a workaround, I did not realize it is webdev-ish.
So I have a basic idea of how it works, and about 8 years of programming behind me, but I need to learn:
How to design web sites (XHTML and CSS?)
Javascript and AJAX
More advanced features of databases (Postgresql)
I'm thinking Python/Django is a safe bet.
Any suggestions on where to start? I'm not the type who has the patience to read a book; I would rather jump in and build something simple first, then bigger and bigger stuff, but I can't seem to get my head around learning web design - I still format everything with tables.
Cheers and thanks

Check out Django. Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
There will be a learning curve, but you might as well learn how to do it right the first time. Go through the documentation, and start building small Django applications. There are tutorials on the Django website.
And yes, you will have to learn HTML and CSS anyway.
Tables are not evil, by the way. You don't have to learn your first website with CSS, but you will need to learn correct CSS layout sooner rather than later. There are free CSS templates out there you can use, which makes the correct use of CSS much easier.

I only got slightly into Django, but I hear good things, so stick with it if you like the approach... inheritance & templating language
XHTML blocks just need to not overlap (markup container rule, good XML syntax with contained elements closing before new ones are begun). Honestly the simplest & most common approach to start web layout is PHP, so I suggest that as first alternative since it is so template-centric.
my favorite CMS is ZOPE, built and used with Python for scripting. Zope3 is more like Django, Zope2 I use more still (Python 2.4.x) has some internal syntaxes and methods to grapple with at first, but if you wish to try it I have a basic site editing framework.
the advantage is the object database hierarchy is just like site structure, inheritance of scripts, content objects (HTML chunks & contextual values), properties... so duplication is minimized, the whole site can be a simple template, reuse & extension maximized. navigation scripted, archive by month & listing contents scripted, footer once, sidebar inherited throughout site - override by cloning into subdirs and editing or specifying object/property for local instance closest to the URL path then seeking up to root.
users can have roles in sections, XML-RPC/HTTP/FTP all ZOPE methods including user-defined, so rich clients can workflow media effectively. batch process media uploads with default containers for each item and metadata (filename, type extension) so users get right to their details. ZOPE can host files or static, remote, whichever, so long as the app knows where to find them (one base property for the app or project root)
if you get into Django there is the ZODB standalone library part of ZOPE for persistent storage only, no ORB

Related

Going from webpage to website

I have been coding html/css for some time now, and I've gotten to be proficient at coding single webpages, but I can't figure out how to code a website. Some questions I have are:
Do I need to buy a domain if I want to build a website (for practice)
Are their special things I need to know (such as special tags) that I wouldn't have learned from coding just a single page?
Should I learn how to use a grid if I am coding multiple pages?
You may want to first decide what kind of back end you want (the server side code that builds and delivers the pages) I strongly recommend rails, and a react.rb.
You do not need a domain name.
A great way to start is to use a service like cloud9 which is free, and will get you going in no time. Cloud9 will do a one button setup of a rails environment and get you going.
Another approach is to begin using react.rb and just expand your skill set from the front end towards the server. The react.rb tutorial creates a simple chat application and you can do this all with the tools your already have. Once you have mastered that you can set up a simple rails server and start adding server side persistance (saving data on the server.) This is the approach I recommend, but full discloure: I am one of the leads on the react.rb project so I am very biased.
Well, you can build simple to wonderful STATIC websites from HTML/CSS but if you are talking about some serious web development then you will need to learn a server side scripting language. Most of the websites these days are database driven serverside webpages. There are many serverside programming languages and tutorials for the same out there.
I suggest you start with PHP (for scripting language) and MySql (for database)
Again, the choice of language is totally upto you.
Then you would need to learn about setting up a server on your local computer. For this you will need to learn about (x)-AMP. This would be WAMP, XAMP, MAMP depending on what OS you are using.
If you are only needing to develop a simple CMS website, then there are alot of CMS framework which you can go for, which will not require much of coding.
It seems as if you are looking to connect multiple pages to the same website, so you can navigate between pages. And it seems that you want to practice with local files. If that is the case, you need to first create a local folder for your website and use the a tag in your html files. Inside the a tag, you will need to include an href with the url to your other page. A link to another html page that is saved in the same folder as your original will look like this:
New Page
You will want to use external CSS and JavaScript files to keep all of your pages in the same format.
http://www.w3schools.com/html/html_links.asp
http://www.w3schools.com/tags/tag_link.asp

Best practise for updating / managing HTML pages

I am developing an e-commerce website as part of an assignment and am wondering what is the best practise for updating a collection of webpages.
I currently have one index.html page for the news etc. and then I copied and pasted the file and edited as i needed for the shopping cart functionality.
My question is; if I need to update something on the index.html file and which that change to show in all the pages, is there an easy / convenient way to update all of the pages together if I have a large amount instead of updating them manually one by one?
This is where the rubber meets the road for most developers. Now you are seeing a need to update something once and have that change propagate out to some / elements / pages. This is where making things "dynamic" and "modular" start to make sense and is the very reason server side scripting languages such as PHP were created. This in addition to a database such as mysql can create powerful, data driven websites and applications. HTML is just markup, all sites use it, but it by itself isn't able to take advantage of the benefits of being a dynamic language.
A great place to start looking for a content management system is by using something that has a lot of support / community behind it to help with the questions you will have along the way. It is also a good place to ease in to dynamic languages like php. I suggest using something like wordpress (wordpress.org) to get started. It handles most / all of the heavy lifting in regards to structure and all you really need to do is worry about the presentation of your site (themes). You'll only need something like MAMP (for mac) or XAMMP (for win) in order to make a local server (php / mysql) so you can install wordpress. There is a TON of resources and tutorials, plugins, themes, community support.
Edit :
Since you are limited to the client side. Alternatively, if you know javascript, you could look into a javascript MVC framework and use client side templates like handlebars, .EJS etc.
Good luck & Happy Coding!

JSP / HTML UI Design

We have some JSP code to run in our pages.
There is a UI designer who will constantly update the UI but does not have Tomcat server. We prefer he doesn't because he isn't a programmer.
However, it is getting annoying to have to cut and paste the JSP related code each time he updates the UI.
Is there anyway to handle this issue? We prefer to keep the same files, but still have it so he can see his UI work without worrying about the JSP and when he checks in the new files, we don't have to cut and paste our JSP related code.
One example of such code, is that there are certain navigation menu items which are displayed depending on the user.
We are using Tomcat authentication. We could I suppose use AJAX to obtain the user information, but is that less secure? Everything else in the application is AJAX.
The problem here is that this person is not working with the team. Rather, he's creating work for them... and it goes both ways. Read on.
I both do and manage front end development. If this UI person was on my team, I would force him to set up a Tomcat server. He just needs to learn some things.
In effect, when implemented properly, JSP is not much different from any other server-side markup language for views, such as Rails + ERB, PHP, .NET etc... even Javascript templating engines (mustache, handlebars, etc.). The same condition checks, for-loops, auth checks - all basic view-layer logic that is needed is available and usable.
If he's on a Java project / team, he needs to learn the Java front-end. It's that simple.
His main tasks should be basic, and frankly, he shouldn't even need to install a Java IDE to do them. They are:
Get/push source code + analyze diffs (any source control client)
Build / deploy latest to his local environment (scripts or .bat files)
Work on the running app*
(*) The last part is where things get tricky. If you work directly on the running server and then accidentally run a fresh deploy before copying over your updates, you're screwed. If you use symlinks (which are also available in Windows), there may be files that only appear post-compilation, or locks, or sync issues when getting latest code - all creating problems.
The way I have found that works best is to work on the code repo location (pre-build), and create two scripts:
Build+deploy - stops running server, blows out directories and caches, builds latest, and redploys
Update - Synchronizes the View files and any other necessary directories with the deployment target. You must be sure to disable hot-deploy in the Tomcat config, or you'll get memory leak errors.
That said, and it should be obvious by now: Java is one of the most difficult ecosystems to develop UI's for. The compiled nature and complex environment requirements make development slow and tedious, with significant dependencies on different people or systems to make a decent product.
JSP itself, while capable as described above, is almost always organized badly, with various ways of includes, tagfiles, partials, frameworks - it becomes a UI person's worst nightmare. GSP (from Grails) solves a lot of the organizational issues, but will require flexibility from the dev team. Even then it is not an "ideal" solution.
JSP syntax - JSTL, C:tags, etc. creates even greater headaches. Front-end people who do not program, don't use IDE's and therefore don't have a way of looking up methods, objects, parameters etc. when writing or customizing conditional logic or loops. The dev team can help by pre-writing these out on the page, but any time there are changes or enhancements needed, it requires meetings, conversations, and compromise.
In the long run, you should abstract the Java app from a separate, more flexible, more capable front-end technology stack, using REST / JSON-based services to talk between the two. (Side note: For performance / apps with scale, ensure you are using either a custom protocol or Web Sockets).
My preference is node.js, because front-end developers can stick with the language they will know best: Javascript / JSON. But it could be anything that your particular front-enders are comfortable with and can do design with.
The key is to eliminate bottlenecks on both front-end and back end. Both tracks should be able to develop and iterate quickly, with the RESTFUL API being the key point of collaboration.
Lastly, for those of you who are aspiring front-end developers / designers but only know Java (or some other server-side technology), I CHALLENGE YOU to learn something new. User-facing technologies are in a constant state of change, and more recently that change has accelerated. If you want to have UI-competitive products, you need to invest in technologies that will make them competitive.

Cross-platform lightweight master pages

Currently I have a web site full of static pages. This minimizes web server load and guarantees that this site will run even on tiny Linux-based hardware web server.
I am seeking for an ability to make master pages for my site and I like the way used by Ruby on Rails, but this technology is redundant for a simple web site and is too heavy for a simple hardware web server.
I like the SSI, it is really lightweight and cross-platform, but it does not provide master pages, it only makes includes that each document should maintain by oneself.
I like an AJAX technology, but it is client-side dependent.
The IFRAME technology does the opposite to what I want - it references from master page to slave page, and I need the reverse.
Is there something else left?
Template-Toolkit, specifically the wrapper directive, should do the trick.
You can use ttree at build time to generate static pages, avoiding the need for any server side technology beyond a simple HTTPD.
Em.. php includes?
So: CSS, Javascript, Includes directories detailing reusable styling, client scripting, and markup respectively?
There is no way to get any form of master page in the way that you are talking about without server side scripting I'm afraid. The best you can hope for is a JavaScript file that loads other JavaScript files, and external stylesheets (one unusual method I saw was the creation of a universal stylesheet that imported many others - but I didn't see all that much benefit to organisation myself). You could always use iframes... but iframes, as you point out aren't designed for that sort of functionality. That sort of functionality was within the scope of frames, and that had unpleasant results.
If you want to use something like php your server will naturally have to support php, but it is a simple way to produce easy organisation of your pages without having to dive neck deep into a complicated framework like Rails. In my experience adopting a CMS, particularly that developed by somebody else can be more trouble than it's worth.

Becoming a Web Designer: CMS, or by hand [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'm biting the bullet and becoming a Web Designer, there are just too many good opportunities out there. I'm a professional SW engineer, so I want approach this correctly. So far I'm fairly good at HTML/CSS/Javascript all completely by hand. I'm also good with jQuery and Django with mySql. I've made some cool sites but it takes TOO LONG if I want to do this for many sites.
Here is my question: Do I learn a CMS really well and use it (and be stuck with it) or do I spend that time developing some reusable HTML/CSS templates and do everything by hand?
So far my CMS experience is that there is overhead setting it up, and it you want a lot of customization you're doing CSS anyway.
If I go the CMS route -- which one?
What is the "best method" for Web Dev? I intend on creating a very diverse array of sites as well...
Thanks!!!
The future of web publishing is clearly in Content Management Systems for everything larger than a small personal site. People are not buying sites anymore for which they have to pay a professional every time a paragraph needs changing.
Make sure you know your HTML, CSS, and Javascript, but get familiar with one or more CMS's on the market, preferably one of the big ones that get you a big community, and the advantage of a widely known standard that it is easy to find people for. Learn how to customize it, how to build templates for it quickly and effectively.
One of the biggest flagships in enterprise-level CMS'es is certainly Drupal. From personal experience, I also know Joomla, but I'm not sure whether I'd recommend it to get started with - it tends to be a bit dirty on the code side sometimes. WordPress is successfully used as a CMS by many.
Look around on SO what systems people are happy with; if you want to get to know the concept of a certain CMS check out openSourceCMS who provide live demos of many CMS'es. There are also very robust commercial products out there that are better maintained than the open source projects.
There isn't a single correct answer for this IMHO. Basically, it comes down to:
Use the best tool for the job.
The best thing you can do for yourself is learn about what tools are available, and what they are capable of. Try to match each one to a scenario you think might be particularly suitable for a given solution.
You will find that if you invest a lot of time in learning something like Python / Django you will be able to create just about any site you can imagine, but then you might find that if all your client requires is a simple, mostly static company info site that something like Drupal might be more appropriate.
The baseline technologies like (X)HTML, JavaScript, CSS and SQL are used across all of them, so knowing these tools well in a generic context is also extremely valuable.
A truly well-equipped toolbelt is invaluable.
If you need a little number of pages, without any dynamics, render your site with your favorite language and numerous templates to html files and don't deal with anything but www-server.
Once you need a rather big site - use a tool which you already know well. (I using django and happy with it).
When a site is really huge - make your own CMS. But at first have a practice with tool like django. Until you know how it works - try not to deal with big projects at all.
I can advice to use statically typed language for anything, but i'm sure that you know benefits and caveats.
Python and Django is suitable almost for anything.
I am a Web Designer and recently I began using Wordpress. I've found it great so far, once I have my site ready in xHTML and CSS it only takes me a couple of hours to make the content editable.
I have also created about 3-5 themes my self, I've found creating Child Themes and using Themes like Twenty Ten as a parent, so I can use their functions etc.
I would highly suggest that you look into wordpress, especially if you want to speed up the process for creating websites.
Those two choices aren't mutually exclusive.
You should build reusable code regardless of which option you choose. With a CMS, there will already have some design decisions made for you of course, but I find myself building APIs and interfaces using Drupal all the time. In fact it's a measurement of quality.
There are also some frameworks that you might like too that will let you custom build and increase productivity. See The Zend PHP framework, Ruby on Rails, Kohana, Nanoc and the 960 CSS/HTML grid. You could say they are the best of both worlds!
If you are going to implement web sites for the general public, I'll go with Joomla. I managed to implement 9 websites in one year with this CMS. In my opinion, it is important to know PHP, HTML, CSS and Javascript pretty well before using Joomla (which you seem to know), or any other open source CMS for that matter. This way, you will be able to customize all aspects of the website (both frontend and backend) with ease. For example, when I don't find a plugin which does what I need, I just create the plugin myself.
However, if your aim is more on Web Applications rather than web sites, I'd go with ASP.NET and ExtJS, which seems to be today's trend for web applications since you will be combining the power of ASP.NET with the power of AJAX (ExtJs).
IMO, Python is more targeted for very large and complex projects (look at Google or Amazon).