I want to update/rewrite a small (10 page), simple website; 8 pages are entirely static and could be written in html, 1 page has a contact form and the other has to display a filterable list of clubs. At the moment the site is written in classic asp and uses dreamweaver templates for consistent pages.
My requirements are
A "masterpage" / Templating system, so all shared page elements are written in only 1 place.
Lightweight / low overhead framework
To learn a new language
I could use ASP.NET Webforms or ASP.NET MVC to get the masterpage, but they both come with overhead that isn't necessary for such a small site and on my godaddy hosting spinning up a site from cold is noticeably slower than a pure html page.
The clubs page will show a list of clubs filterable by location, but I don't want to use a database to store this list - there is another site that has the official list of clubs, but the system isn't capable of providing this as a service or other consumable resource so I would need to scrape the details periodically and cache them locally or use an iframe or something
I thought maybe Python or django might be good candidates but don't know enough to know. I now think that what I'm looking for is a "micro web framework". I've taken a quick look at the Mercurial Web Server which is written in python and that looks quite straightforward, but I don't have access to the hosted web server on Go Daddy, so can't install python...
Edit
I need this to run on my current shared hosting with GoDaddy on (IIS7)
Edit2
The list of clubs is maintained by the official HQ website, they occasionally add / remove clubs. I just need to keep my list up to date with theirs. I have been checking every few months (if I remember) and updating an MS SQL database, but that's hugely over the top. I was thinking of just pulling the details down into a json format and persisting it in a text file (once a month, or something) which I could then use as the basis of a table with jQuery filtering on. The club details are just text; Name of Club, Main contact, phone number, address and email address.
I would also like publishing to be simple, commit the code to Mercurial (or git) and have that run the site. I know bitbucket (and github) both serve static page sites (I'm not sure how I would get a contact us form to work in that environment - but it's the deployment model I would like)
The site I am looking to update is Seika Dojo
There is no need to run monsters to serve 10 almost static pages. If you plan to pull and cache some data out of the web, it is a way to go to update static HTML.
As another author mentioned HTML5 can help you. Take a look at jQuery for table filtration. As for page regeneration with common elements consider either jekyll/hyde or org-mode (using batch processing mode with emacs). You have a plenty of languages to choose from.
Well, I don't know about the other frameworks, but I have good experiences building a small site in NancyFx.
NancyFx supports multiple view engines. You could use the SuperSimpleViewEngine; masterpages come out of the box.
Getting started with Nancy is super easy.
I think you already know .NET/C#, but Nancy takes a lot of advantage of new dynamic features which are fun to play with.
Python is my favorite language, but I wouldn't use it for creating a simple website. I would recommend you to go with ready made CMS solutions, like Wordpress.
You would learn something new.
You won't have to implement any features (CMS + plug-ins will provide all you need).
You will get all the support you need.
It is easy to deploy on any hosting (since it's PHP based -yeap, sorry, php-).
Cactus:
https://github.com/koenbok/Cactus
is my current favourite static site generator - it uses Django templates to create a set of pages (in the 'build' directory) from a set of templates (in the 'pages' directory) and all the usual images and css in a 'static' directory.
Do your filterable table with Javascript on the client - it doesn't sound too complex. This lovely table grid component:
http://datatables.net/
might be just the ticket.
Pelican wasn't mentioned. It produces static pages and is done in Python. It meets all of the stated criteria.
See http://wiki.python.org/moin/WebFrameworks and play with a couple of the choices that tickle your fancy. I would tend toward the lighter frameworks based on what you described.
Although not exactly on the topic, since you don't need entirely static website, StaticMatic
may be of interest as one of the best lightweight tools for static content generation.
Flask and web.py would both be good choices. I don't think that Django is really suited for such a small project but you can definitely use it.
Perhaps look at cherrypy or webpy? They are very minimalist, python web frameworks designed for something like this. (I think django is too big for this small of an app, IMHO)
Also, take a look at Sinatra if you want to learn some ruby.
Express is good for some javascript experience.
For single-page apps, backbone.js is popular and really powerful, but might not be what you want.
But most importantly, have fun learning a new language!
I've been looking around further and the goal of a templating system can be met by just using xml includes, or Embedded JavaScript to pull in the header / footer / menu sections. All the 'work' is then done on the client browser, so the web server only needs to serve up static files which is about as lightweight as you can get.
Based on my experience, any 8 page static website someday needs dynamic features so it is always a good idea to start from something extensible.
Then the first decision is to use a Framework or a CMS. This depends on your expectation of the site getting bigger in the future, your ability to develop custom codes to achieve dynamic features and the structure and the requirements of the project in hand.
When we need a CMS we use,
Orchard if ASP .NET MVC 3: Take a look at our site www.dreamrain.com which looks like a static website but actually uses Orchard themes and modules for the dynamic features. If you don't need themes and modules, you can still create a 8 page website and then you can extend it in the future. Btw, we built this site in 5 days with 4 hours of development effort
Note: Orchard may need Full Trust so check its documentation and ask GoDaddy if they allow it.
WordPress if PHP,
When we need a Framework we use,
ASP .NET MVC 3 for .NET,
Django or Pyramid for Python,
Zend for PHP,
Grails for Groovy/Java/J2EE,
Play for SCALA
Related
I am a front-end web developer learning Python and decided to try to create a website for a friend. The website contains an astrology calculator that will generate a chart image and reading based on a person's birth date, birth time, and birthplace. I can use either Python CGI or Django to build this. Which one is appropriate for this project?
The chart calculator will:
1. generate an image of a chart with the correct houses and signs lined up.
2. plot the planets in the correct houses in the chart
3. show the connections between the stars, like a trine, square, or conjuction.
To render images, I think HTML5 can probably work. For the server-side scripting I am leaning towards CGI because it seems like you can write real Python programs with it and just output the results with something like print "sun conjunct jupiter". Django seems to limit you to that weird syntax that forces you to write every Python expression in these <% ... %> brackets and it doesn't seem like you can import Python modules easily.
I am not extremely familiar with Django, but these seem to be some of the limitations I noticed in the Django tutorial.
What do others in the community think? Should I use CGI or Django to create this website?
I checked out other questions, but not sure if a Python mini-framework is appropriate here.
Not really sure what you're hoping to glean from this (or what the question is exactly), but you seem to be misinterpreting what the Python CGI functions and Django are.
Django is a web framework meant to expedite the process of developing a website, so you can focus on specific issues (like the chart problem you described) rather than have to tend to the infrastructure of a site. It's meant to abstract away CGI (to oversimplify it a bit). If you're looking for something less heavy than Django, perhaps try Flask or Bottle.
PS: A quick Google search showed a similar question from a few years back: My first web app (Python): use CGI, or a framework like Django?
For a long time I have been wanting to start a blog. But knowing myself, I know I won't update it often. So, I would like to club my blog with an "ebook". I'd like to write some beginner level ebook/course on Biostatistics.
Here are some examples of other blogs (+ebooks) that follow this approach:
A Byte of Python: http://www.swaroopch.com/notes/Python
BabyPips (FX trading): http://www.babypips.com/school/
Learn Python the Hard way (ebook only): http://learnpythonthehardway.org/book/
I could simply use WordPress or Tumblr or some blog site to create a blog and write my tutorials there. One post for each tutorial. BUT I am leaning towards creating a more structured book with table-of-contents, sequential chapters, prev/next navigation, and even quizzes (if possible) etc. Blog-post style is better suited for independent tutorials that don't follow a structured course/book format.
For Blog section, there is WordPress etc. But I haven't figured out how to create a structured ebook like these guys have created. What software/plugin/CMS/wiki plugin to use for this?
PS: eventually, I'd also like to convert my web ebook to PDF, MOBI, EPUB format. But that is probably not hard. Most important is to publish a web ebook like these guys have done it.
UPDATE:
Ideally, I just want to be able to login and click create-> new book or new chapter or something and just write like I'd write in a WYSIWYG editor. That script should take care of generating table of content and navigation etc. I think this probably resemebles wiki script but wiki-script probably won't take care of next/prev navigation.
http://www.swaroopch.com/notes/Python uses MediaWiki, which is okay for writing books. If you want to publish in several formats, a sophisticated markup language like Markdown or reStructuredText might be more appropriate. You can use different utilities to create static web pages using those, like Sphinx, Hyde or Jinja.
In search of technologies for developing web applications and portals, I recently dabbled into Ruby and Python (from a non-sysadmin point of view .. ie, towards web application development) and immediately fell in love with python. I have since wanted to only spend time on python based technology for everything (LOL). I have an immediate need to build a weblog that is also able to function as a corporate website, so I started seeking possible python solutions.
I have researched all the major frameworks and like zope/plone on the enterprise, so I will eventually do a lot in plone. However, I also need an 'instant' sort of framework that I can roll out very rapidly and use to test out some concepts in a weblog.
Given the amount of excellent python projects out there, that ought to be easy right? .. Well, WRONG. That has been real tough, and in the end I could never figure out whether to go with Django or web2py. Each had excellent advantages. In the end, I have decided to spare myself the agony and play with both of them initially .. with a hope to quickly discovering the strengths of each of them that are better suited to different projects.
I am going with:
Django --> Django-cms, other plugins
web2py --> InstantPress ?, KPax?, other
plugins?
My my main beef is that there seems to be very little extra information about the web2py based Kpax and Instant press, beyond being listed under 'free appliances' in web2py website. I have also not seen a well-established alternative to kpax and instantpress.
Question (to those familiar and experienced with web2py): where can I read more about instantpress or kpax beyond watching 3-year old movies of them? Or is the idea that I should just get on with it by installing and playing with them?
Thanks in advance for all suggestions and info ..
Make sure you've got the current version, Instant Press 2.0. Here's a recent video. Unfortunately, I don't think there's much documentation, though I believe Martin (the creator) is working on that. Note, IP 2.0 is based on Powerpack 2.0 (see video).
More basic options are web2py-cms and VCMS. You might also consider making use of plugin_wiki.
Also, a few text editing plugins that may be useful: web2py_ckeditor, elRTE WYSIWYG Widget, and plugin_managed_html
KPAX is fairly old -- probably not the best option at this point.
Also, there was a recent discussion among some folks who are interested in joining forces to build a full-featured CMS, so hopefully this will receive some attention right after the upcoming release of web2py 2.0 (very soon).
UPDATE: There are also a few new efforts under development:
web2cms
Movuca (a social CMS)
nanahoshi-cms
I am developing a Social-CMS, By now I don't have too much working besides the core compoments. But the plan is to release the 'alpha' in one month. (my deadline with a client)
https://github.com/rochacbruno/Movuca
The project is inspired in vikuit.com (but will work outside GAE)
While mine social-CMS is not ready, you can go with InstantPress or PowerPack (best options for web2py by now)
Here is a link to the demo. Movuca Demo Link
I was in a similar dilemma, but at the end decided to use Django & Django-CMS or FeinCMS.
Although web2py community is nice, there is simply not a single actively developed CMS with some significant number of developers, community etc.
Here is my post to web2py mailing list about it:
It might be that it's not difficult to write decent CMS and/or strong blog engine using web2py framework, but I consider there are more important things to do (or write) than writing Yet Another CMS/blog. ;)
I'm exploring many technologies, but I would like your input on which web framework would make this the easiest/ most possible. I'm currently looking to JSP/JSF/Primefaces, but I'm not sure if that is capable of this app.
Here's a basic description of the app:
Users log in with their username and password (maybe I can somehow incorporate OPENID)?
With a really nice UI, they will be presented a large list of questions specific to a certain category, for example, "Cooking". (I will manually compile this list and make it available.)
When they click on any of these questions, a little input box opens up below it to allow the user to put in a link/URL.
If the link they enter has the same question on that webpage the URL points to, they will be awarded one point. This question then disappears and gets added to a different page that has a list of all correctly linked questions.
On the right side of the screen, there will be a leaderboard with the usernames of the people with the top ten points.
The idea is relatively simple - to be able to compile links to external websites for specific questions by allowing many people to contribute.
I know I can build the UI easily with Primefaces. [B]What I'm not sure is if JSP/JSF gives the ability to parse HTML at a certain URL to see if it contains words.[/B] I can do this with python easily by using urllib, but I can't use python for web GUI building (it is very difficult). What is the best approach?
Any help would be appreciated!!! Thanks!
The best approach is whatever is best for you. If Python isn't your strength but Java is, then use Java. If you're a Python expert and know little Java, use Python.
There are so many resources on the Internet supporting so many platforms that the decision really comes down to what works best for you.
For starters, forget about JSP/JSF. This is an old combination that had many problems. Please consider Facelets/JSF. Facelets is the default templating language in the current version of JSF, while JSP is there only for backwards compatibility.
What I'm not sure is if JSP/JSF gives the ability to parse HTML at a certain URL to see if it contains words.
Yes it does, although the actual fetching of data and parsing of its content will be done by plain Java code. This itself has nothing to do with the JSF APIs.
With JSF you create a Facelet containing your UI (input fields, buttons, etc). Then still using JSF you bind this to a so-called backing bean, which is primarily a normal Java class with only one or two JSF specific annotations applied to it (e.g. #ManagedBean).
When the user enters the URL and presses some button, JSF takes care of calling some action method in your Java class (backing bean). In this action method you now have access to the URL the user entered, and from here on plain Java coding starts and JSF specifics end. You can put the code that fetches the URL and does the parsing you require in a separate helper class (separation of concerns), or at your discretion directly in the backing bean. The choice is yours.
Incidentally we had a very junior programmer at our office use JSF for something not unlike what you are requesting here and he succeeded in doing it in a short time. It thus really isn't that hard ;)
No web technology does what you want. Parsing documents found at certain urls is out of the scope of building web interfaces.
However, each of Java's web technologies will give you, without limits, access to a rich and varied (if not too rich and much too varied) set of libraries and frameworks running on JVM. You could safely say that if there is a library for doing something, there will be a Java version available. Downloading and parsing a document will not require more than what is available in the standard library (unless you insist on injecting your dependencies or crosscutting your concerns), so no problems with doing your project with JSP, or JSF/Primefaces, or whatever.
Since you claim to already know Python, and since you will have to add some HTML/CSS anyway, I suggest you try Django. It's dead simple, has a set of OpenID plugins to choose from, will give you admin interface for free (so you can prime the pump with the first set of links).
What are my choices for frameworks for doing Python web development and having a nice language for writing templates for CSS/HTML? A key goal for me is not to have to run a server or install many extra dependencies -- I'd like something that works just by using CGI and hopefully does not force me to do any fancy reconfiguration of Apache etc.
My goal is to write pages that look pretty very easily using templates for generating nice looking HTML with CSS, as opposed to painfully writing out HTML using print statements, and have it be modular. I don't need fancy database support and I am not planning to complex forms for user input that I need to process.
The ideal framework will also have a set of templates written in it that I can use for my website.
I essentially just want to make pages programmatically from Python that look good using CSS/HTML without much work.
How can I do this? Something like Django for example would be overkill, since what I am doing is very simple. (Django is great, don't get me wrong, but my purposes are way too simple).
More specifics about my app:
I want to make a gallery of photos and also display Python code next to each photo. So I'd like to have a way to easily get syntax highlighting etc. in HTML for Python code. Just like Wordpress has many nice templates for blogs, I'd like a combination of web framework and templating language that has a gallery examples of components I can reuse, so that I don't have to write my own CSS/HTML for making menus/headers/other components of a page look good.
thanks.
Well, you're probably not going to find a framework with templates like that included, simply because that's out of most frameworks' scopes. The page structure, variables, and the like of any given Web application are going to be considerably different from each other, so good generic templates are hard to write. The reason people have so many templates and themes for Wordpress (which, though its authors sometimes promote it as a framework, is just an application) is because there are limits on what you can do with it. Frameworks don't have as many such limits. You are probably going to have to find the templates somewhere else and adapt them to the template language you want to use.
On the subject of template languages, as far as a good, modular template language is concerned, Jinja2 is hard to beat. It's fast, easy to write in, and powerful. I have taken quite a few templates from other Web sites and added the Jinja2 markup relatively effortlessly. Flask is a nice, light framework that works well with it, and it can deploy to CGI. And as for syntax highlighting, I'm going to have to go with Ignacio and recommend Pygments. All of these libraries are well-documented, so you should be able to figure them out easily.
Unfortunately, as much as I would like to have a gallery of reusable theme components, those are not easy to find. You're going to have to scrounge around the Web and hack stuff together yourself.
There's some docs, some tools, and some more tools. Plus, flup can turn any WSGI framework into a CGI app. And there's Pygments for syntax highlighting.