Thursday, March 6, 2014

Standing Meeting 3: Successes and Failures

As always, we begin our standing meeting by reviewing our goals from last week.
  • Create a simple log in page for the website. 
  • Create a subversion repository for our project.
  • Implement tests to simulate Amber's success story.
  • Allow Amber to experience success in her user story.
  • Develop a mock-up of what we expect the user interface might look like.
This week, we for the first time experienced both success and failure in our goals. We were able to make a website for our users to log in to, but failed to build the framework on the back end to build our project. I think that we are still going through the stages of becoming familiar with Python and Django, which is keeping us from being able to look to the future of our project. As we become more aware of our tools and what we can do with them, we will be able to visualize how our project might form so that we can begin building that road. To make a very poor analogy, we are chefs who are cooking a dish from a foreign country. We have cooking (programming) skills already, but we are most familiar with the foods (programming language, backend infrastructure) of our own country (Java, C). Until we've had the chance to experiment with the foods from the foreign country (Python, Django, Web application programming, unit tests, subversion repositories) we won't know how to craft them into an expert dish.

With that said, we have to accept that some of our goals might be unattainable with our present skills, but they might be more accessible later on. We added to our incomplete goals a few new goals for this week.
  • Create a subversion repository for our project.
  • Implement tests to simulate Amber's success story.
  • Develop a mock-up of what we expect the user interface might look like.
  • Implement Wilbur's success story.
  • Make a preliminary structure of the models that we plan to use in our project.
What's that you say? What is Wilbur's success story? Well I'm glad you asked.
Wilbur is interested in this new craze going around his neighborhood, he's heard something about being able to turn lights on in his house without actually touching the light switch. His friend, Amber, says that he can sign up for an account with the HAM website and request that a technician visits his house to set up the system. Wilbur isn't sure about having a stranger coming into his house to fiddle with electronics, but he figures it couldn't hurt to sign up for a website. He navigates to the HAM website and creates a new account. He then logs in to the website.
While we currently aren't sure if this would be something that we would allow at our company (maybe users would have to install the system before they can have an account on the website) we hope that it will be good to experiment a little bit with the food and learn something in the process.

Monday, March 3, 2014

Amber's Success

After a long period of struggling, Amber has finally experienced success with her user story! Amber was able to access the website and log in using her name and a password. Amber is slightly confused by the website though, all that shows up is some small 12pt font in the upper left corner that lets her know that she has accessed the website. She then has to add "/login" to the address bar to bring up the log in screen so that she can enter her credentials. After logging in, a familiar mostly blank screen appears with some different text this time that says "You are now logged in!" Even more confusing, in order to log out, she has to navigate to a "/logout" page. Not the most useful website in the world, but she feels secure knowing that she has an account with this website.

Finding out how to get a standard user to log in with Django's framework proved to be a fairly complex process. After wading through seemingly endless looping links in the Django documentation, I finally stumbled on this page that seemed to be just what I needed. I found that looking at the "login_required" section was particularly helpful. Adding this redirected me to a predefined URL which should host the log in page. Unfortunately, there was an error with displaying this log in page. I was probably missing some obvious piece of code, but it seemed to me that the django directory was missing some template files. By searching in the directories for this log in template, I was able to come across another log in template for the admin half of the site. I pasted this template into the directory that the log in page was looking for the template and I had an instant (though incorrectly labelled) log in page. Using my knowledge from the Django tutorial, I put together the simple text pages that greet the user to the website and notify them that they have logged in.

I hope to come up with a more elegant solution to this log in problem in the future, but for the moment, it feels so good to have completed this first step.

Saturday, March 1, 2014

Django Woes: "You mean I don't have to write code?"

While I was going through the tutorial for Django, I have had some fairly emotional experiences (considering that all I am doing is writing computer code). The first one was when I was accessing the admin portion of the site that I had just effortlessly created. I then recreated the view of the polls so that instead of just listing the text of each of the entries in the database, it also displayed the date that they were published and whether or not they were published recently. I then edited the code so that Django was aware that the was_published_recently() method returned a boolean value. After doing this, little green check marks appeared where True was earlier displayed. This simple aesthetic change was so unexpected and pleasant, I may or may not have raised my fist in the air and screamed a little bit.

The second emotional experience I had was in tutorial 4. We wrote some pretty generic views in tutorial 3, and then we replaced a good chunk of the code in tutorial 4 with generic code that took up a lot less space. I should have been happy that there was a much easier way to do the code that I had just written, but instead I was angry that I had to erase the code that I had so carefully crafted earlier. This is something that I should learn to overcome as an extreme programmer though, because there might often be times when it will be better for me to get rid of code and write new code than stick with older code.

A final note on the Django tutorial. Since it went through the process of logging in with an admin account, I thought it would also go through the process of how you could implement user accounts. Unfortunately it didn't, leaving our project in a precarious place. There seems to already be a useful built in user account system, but I worry that we won't be able to implement it correctly and cause problems later in the development process.