Sunday, April 5, 2020

Opinion: Rails vs. Django

 Opinion: Rails vs. Django


Disclaimer: This is an ongoing piece. I'm probably going to be adding to it as time goes on.

So I spent 9 weeks at LeWagon Coding Boot Camp learning Rails. It's a wonderful framework that is easy to learn on. However, prior to my time at LeWagon my experience in coding has all been from a mathematical perspective. Because of that I'm much more comfortable writing in Python, not because of the language syntax (though I do like Python syntax better), but because there are a lot of math abilities built into Python that don't exist in Ruby. Anyway, this is my breakdown of the differences between Rails and Django, even though I might be a novice in both.

Ruby on Rails and Python + Django are very similar. They both pretty much have an MVC model (Django is technically Model - View - Template, but not much different there), and both Python and Ruby are high level, dynamically typed, scripting languages that share a lot of common syntax.

MUCH faster to get started. I only need one terminal command to get started. This one command sets up the database, installs webpacker, and installs all the gems I might need. For this I like to use Le Wagon's boiler plate.

Django is much slower at getting started. It took me a good long while to figure out how to get my databases set up.

Django is also much more "segmented" than Rails. When you start a project you also need to create Apps. In most smaller projects you probably only use one app, but bigger projects should be using multiple apps. These apps are simply ways to organize your code better.

While Django may be more complicated to start off with, one thing that really impresses me is the Admin site. If you go to [your url]/admin you get a nice pre-made site to take care of the administration of the website. Here you can manage users, create posts, and other administrative tasks (not related to coding).

These are just my preliminary thoughts, I'll be adding more soon.

Tuesday, March 31, 2020

Django Quickstart Guide

django


It may seem like I’m writing this for you, but I’m actually writing it for myself. I’m writing this so that I can better understand what I’m doing and digest the material by explaining it. Also, when I write this down it serves as notes. I’ve often written material that looks like technical writing, but is in fact a tutorial for me to look back at later.

Getting Started


First thing is to create a virtual environment. We do this so that our Python packages are localized instead of installed system wide. We do this to reduce the risk of conflicting packages, it’s easier to release, and it’s easier to switch to another Python interpreter.

First install virtualenv (on Linux):
$ sudo apt install python3-venv


Create your virtualenv:
$ python3 -m venv .env



You can name your virtualenv whatever you’d like. I prefer to call mine .env because it’s simple and hidden. This is also the naming convention from RealPython. Others prefer to call it the same name as their project.


Activate your virtualenv:
$ source .env/bin/activate



Install Django:
$ pip3 install django



Create Project:
$ django-admin startproject ‘PROJECT NAME’ .



Create a project app:
$ python3 manage.py startapp ‘APP NAME’



Run your Django server:
$ python3 manage.py runserver



In the browser navigate to http://localhost:8000 and you will see the django is up and running. Open your favorite IDE. The barebones project has been created for you. This would also be a great time time make your initial push to Github (or Gitlab or whatever you prefer).


Register the App



Navigate to ‘PROJECT NAME’/settings.py in your editor. You should see an array called INSTALLED_APPS. Add to the end of the array your app, APP NAME.











The app I’m adding in this case is called ‘blog’

Build Routes



Navigate to ‘PROJECT NAME’/urls. You can see how Django is directing traffic within the urlpatterns array. We want to create new paths that will direct to our new app(s).





If you go to http://localhost:8000/’PROJECT NAME’ you will see that nothing shows up, even though you registered your app in the previous step. In order to get this to work we need to build routes.





Django tells us how to do this:
if I’m adding a blog it’s going to look like this:




However, if you try to navigate to your project it still won’t work. If you check your terminal where your Django server is running you will see an error that says:

ModuleNotFoundError: No module named ‘blog.urls’



This is because we don’t have a file named blog/urls. So we need to create it.


This by itself isn’t enough to solve the problem. We need to configure it!

The new urls.py file looks very similar to ‘PROJECT NAME’/urls.py, but it’s going to be a little different.
remember that my app name is ‘blog’, yours might be called something different.



Right now I’m still getting an error in the terminal saying
AttributeError: module 'blog.views' has no attribute 'blog'

So I’m going to navigate to blog/views.py where I’ll need to create the blog_list function


Now this still doesn’t work because we don’t have any templates, meaning there’s no HTML for the browser to read. So if we go to localhost:8000/blog we will get an error that says:

Creating a Template



First thing to do is to add some functionality to our function blog_list.


This will still render a ValueError at /blog/ error as shown above. This is because we don’t have any HTML/CSS yet!





Inside of the blog directory I will make 2 new folders with a file inside:templates/blog/index.html


At this point we can go into index.html and start doing some HTML formatting. However, we’re going to wait on that.

Models



If you want to make a website that’s more than just static pages you’ll want to use a database. Models are how Django interacts with a database. Each database table has its own model. Sometimes tables need to reference each other. This tutorial doesn’t get into that, but will be discussed at another time.

Basically, a model is a class object that converts into SQL language. Different projects will require different types of models. For more information see Django Docs.

Different projects will require different types of models. This topic will be discussed in another post.

Wednesday, January 16, 2019

PiCademy

This article is taken from my other website wolf-math.com, while that website is about to be overhauled. Originally Posted July 29, 2017. 

PiCademy


This last weekend I had the wonderful opportunity of attending Picademy in Ann Arbor, Michigan. Picademy is a two day professional development workshop that teaches teachers how to unlock the capabilities of the Raspberry Pi single board computer.

While I’ve been using the Raspberry Pi for quite a while now, I’ve never been able to make the leap to physical computing. I’ve always wanted to be able to make robots and play with sensors and other gadgets that I knew the Pi was capable of doing, but I never knew how. In the past I taught programming in a very dry way. I expect my teaching to be very different this year from previous years. Students will be more focused on what they can make with programming instead of doing assignments in programming.
I’m really looking forward to this year and seeing what my students will accomplish.

If you’re in the giving mood, please help make sure my students have the materials they need to succeed. Donations of any size will help my students, and right now any contribution you make will be doubled by Tom’s of Maine. https://www.donorschoose.org/project/stem-physical-computing-with-raspberry-p/2664110/

What is Standardization?

This article is taken from my other website wolf-math.com, while that website is about to be overhauled. Originally Posted January 4, 2017.

What is Standardization?


During my break I’ve been thinking about the nature of school. I’ve read a lot of articles and I see a lot of posts on social media about the nature of education. The basic gist is that everybody is unique, therefore standardization is bad. This is a bit of an oversimplification, but, generally speaking, I think it’s a true statement.

Before the 1800’s Education was not free. Only elite families were able to pay for their children to attend schooling. So, in centuries past if you were a farmer, then your children were certainly also going to be farmers. The occupation of the parent was the future occupation of the child. Education was the job of the parents to impart onto their children, and only education pertinent to the occupation was going to be transmitted. Now this was not a very good system because it removed a great deal of free choice from the children since they could not choose their own occupation.
Enter public schooling:

Education was now something that was accessible (and required) to everyone; not just the elites. It’s true that students in those early public classrooms were not worried about Common Core but there was still a standardization in the classroom. There was a basic 3rd grade curriculum which differed from the basic 4th grade curriculum. Even in the workplace, when you get a new job there are certain policies and procedures that you’re expected to conform to. Even in the days prior to public schooling, the child who was destined to be a farmer was taught the “right way” to farm by his parents. Basically what I’m getting at is that everywhere there is some sort of standardization whether it be in school or home or the workplace.
So I’ll leave off with some open questions. Where do we draw the line? At what point is education too standardized? What is considered the right amount of standardization?
Leave a comment below.

Standardization

This article is taken from my other website wolf-math.com, while that website is about to be overhauled. Originally Posted February 22, 2016.

Standardization

I’ve had a lot on my mind to post about. I’ve just been too busy to actually post anything. A lot of exciting things are happening right now. However, I wanted to discuss a little bit of the opposite of that.

I just finished the Resident Educator Summative Assessment, or RESA for short (I love how this stupid buzzword “summative” still gets caught by my spell check).  In Ohio newly licensed teachers are required to go through a residency program. During this time the “resident educator” is paired up with a mentor teacher who helps guide the new and inexperienced teacher.

It’s a great idea… except it doesn’t work. The Ohio Department of Education is a bureaucracy. Therefore, in place of having a guiding figure to help and support new teachers, they get a standardized “test”. While it’s not a test per se, it’s the closest equivalent there is to having a teacher take a Common Core test. We’re required to record our classrooms, reflect on the lessons taught in the recording, submit evidence about our marking, and submit evidence that we communicate with parents, among other things. This, of course, is without any sort of feedback– which is quite hypocritical to say the least.

There is no evidence submitted, however, that a mentor has actually helped me out. In fact, in the 3 years I’ve been doing this, I’ve met my 3 different mentors only a handful of times (one of them I don’t want to ever meet again).
I’m not really complaining about all the work that I have to do (well I am, but it’s not the main point), I’m complaining about the system. This “system” that has been plaguing students and parents since NCLB was passed- the system which is only getting worse with Common Core- is now creeping its way up to assessing the teachers too. This “Summative Assessment” (seriously try spell checking it!) is just another hoop to jump through that doesn’t truly assess the quality of the educator.

Going through this process has made me wonder what’s next. Will something else come up in the future that will require even more of me and my peers? I don’t know, but I’ve seen people get dissuaded from the profession because of RESA, and although I don’t see myself actually leaving the profession anytime soon, I can’t deny that RESA has made me think about it.

Critical Thinking

This article is taken from my other website wolf-math.com, while that website is about to be overhauled. Originally Posted January 25, 2016.

Critical Thinking

Well here I am, still waiting for my computer lab pieces to come in. I’ve been having meetings with a lot of different people who are all giving me really great ideas on how to create this custom class exactly the way I want, but alas, here I am still teaching pencil to paper.
Perhaps it’s my own impatience, but my students’ questions have started to become my own, and I’m beginning to ask myself “what is the point of this.”
For most of us, the way that we do mathematics in the classroom is not the way we use mathematics in the real world. It’s cool how we can create an equation for pretty much anything, but that’s not how most of us approach it in real life. As a commenter correctly pointed out in a recent post, logarithms are used in every day life when we say things like “I make six figures.” While that may be true, I can’t legitimized a whole unit on logarithms– the meaning, properties, change of base, logarithmic equations– based on the fact that “I make six figures”.

The truth is that I’ve had misconception about my job, as I think a lot of educators do. I’m not a math teacher so that I can teach mathematics; I’m a math teacher to teach critical thinking skills. Actually, no teacher teaches in order to impart random facts onto students that the government deems important for them to know. All teachers, no matter their content, teach for the sake of imparting critical thinking, a love for learning, and method for communicating what they’ve learned. After all remembering is the lowest rank of Bloom’s Taxonomy.

As a math teacher I think my job is made difficult because mathematics is so hard to relate to the real world in meaningful ways, as opposed to some contrived word problem. Even if math is taught in a pure math type of way, many students don’t have the type of minds to be able to appreciate that.
This is why I’ve been obsessing over computer science lately. I think I’ve finally found a way to engage students the logical problem solving. We’ll see how it goes!

Performing Vs. Learning

This article is taken from my other website wolf-math.com, while that website is about to be overhauled. Originally Posted January 7, 2016.

Performing vs. Learning

I’ve been thinking a lot about the difference between performing versus learning. This seems to come up more in math than other subjects due to the obscure nature of mathematics– we always need to legitimize why students need to learn it. That’s its own conversation.


Performing is students completing a task correctly in a timely manner. Performing makes “teaching” easier. Tests and homework can be graded– we can score the student on how she has performed by giving her a letter grade. This is a metric that we have been using for decades to show what a student knows. However, everybody has had their easy teachers and their hard teachers, whether in math or in some other subject. Because of this there is an inherent problem with assessing students with this metric. Different students may have different grades for doing the same work.

Posing an equal and opposite problem is standardized testing. Students are taught to perform tasks, mathematical or otherwise, and get the correct answers. It is, for the most part, procedural thinking. The Common Core was intended to do away with this procedural method of thinking and have students actually learn instead of doing meaningless procedures. Due to the nature of The Common Core being standardized and the requirement to assess millions of students on their progress, students now need to jump through hoops by doing procedures that are more meaningless than they were in the first place.
Learning is much different than performing, especially with mathematics. We teach math that it’s about getting the correct answers, but it really shouldn’t be. The end goal should be that students get the correct answers, but the correct answers should be based on a learning experience that expands their thinking– there are a lot of methods of obtaining the correct answers.
What methods do we use to make sure that students are learning instead of just performing? I’ve got some ideas, but I’ll save them for later. Make sure you’ve seen my previous post: Thoughts from Winter Break.

Thoughts from Winter Break

This article is taken from my other website wolf-math.com, while that website is about to be overhauled. Originally Posted December 31, 2015.

 Thoughts from Winter Break


I've been doing a lot of thinking about the way I want my class to operate. For a long time now I’ve wanted to move away from the classical model of lecturing, practicing, and testing. It’s been a rough ride for me because I’ve been at 4 different schools in as many years. However, this year I have a school with excellent resources and a very supportive administration. I also expect to stay.
One thing I tell my students as they’re learning the math I’m teaching (and I’ve mentioned on this website time and time again) is that they’re not necessarily learning to be able to use math in everyday life (unless you’re a mathematician when was the last time you used a logarithm?), because they may not ever use i after the SAT and ACT. Rather, the reason they’re learning is to make connections and structure their thinking. While that works for some students it doesn’t for others.

We also live in a day in age of high stakes testing. A frustrating reality that my colleagues and I have is a lack of student curiosity– students are only concerned with getting correct answers. I can’t speak for other subjects, but an outcome of this attitude in my class is that many students can’t/won’t work unless the mathematics is procedural. Open ended thinking is something they refuse to do.
Now I could just blame the students, or I could blame that many of them are being raised in poverty, or I could blame the testing culture in which we’re raising them, but that would do no good. That’s all out of my control.
This is why I want to change my approach.

Mathematics is a real art/science that was created to solve real problems. The quadratic formula was originated (though not in its final form the way we know it) by the Ancient Babylonians (I think) to measure the areas of L-shaped fields. That’s nice. That’s neat. I can appreciate that. That makes me want to learn more. But that doesn’t usually intrigue my students. They live in the digital age! Why not use technology to drive learning? I don’t mean using technology as a toy on which they happen to learn. I mean actually learn the mathematics of the technology that they’re using.
Computer science is a field that was mostly established by mathematicians, and my school is a project based school. Let the students learn math through technological projects. With the help of pre-established curricula, like code_by_math(), Bootstrap, Code.org, and Khan Academy, I aim to develop my own curriculum that marries mathematics and computer science. Perhaps this will help students get through logarithms a little easier.

TLDR: Make mathematics relevant to the learner.

What's the point of this? (part 2)

This article is taken from my other website wolf-math.com, while that website is about to be overhauled. Originally posted October 30, 2014.

What's the point of this (part 2)

My last post was about the 3 reasons I thought it was important to learn math in school, even though students may not (probably won’t) use it in everyday life. The three reasons were 1) It’s part of the liberal curriculum that we’re trying to give students of the United States, 2) appreciation for the fact that mathematics is all around us, and 3) it allows us to think in a more organized and efficient way.
I also pointed out in my last post that my karate instructor, an attorney of 35 years, told me that he had never used the quadratic formula in his everyday life. There is another gentleman I know who is a retired attorney. He volunteers at my school, and helps me teach my math classes. Before he was an attorney he was a math teacher who worked in the Cleveland District at East High. He told me that he has used a lot of math in his work, and his background came in handy on several occasions.
Now both of these gentlemen are very intelligent individuals, and they both specialize(d) in matters of law where numbers are important, real estate law and commercial law respectively. Could it be that my karate instructor didn’t use the quadratic formula (or any other type of math like this) because he didn’t know that it could help him? Is it possible that my community volunteer only used math because he knew how to apply it, even though he could have gotten the work done without it? Maybe.
I think another answer to “what’s the point of this?”, which really plays into all three of the above sections, is jobs. Now it’s partially the fault of the schools, curriculum deciders, and teachers (I am guilty) that mathematics becomes the cold and dry subject. But it’s also the fault of the students not to apply what they know to the fields that they enter. But regardless of whether or not people use math in the workplace, the fact is that it can be used in the workplace, and it would be very beneficial to use it in the workplace.
One area of mathematics called discrete mathematics deals with logic and proofs. The world would be a much better place if everyone took discrete mathematics and understood how to apply it. There are the obvious examples like computer programming (a job), which is all logic. But then there less obvious but really important examples like noticing when a politicians make claims that are logically unsound. Sometimes is takes someone trained, but not highly trained, to see the flaw his his/her logic. Then there are geeks like me, who use logic to most efficiently make coffee in the morning (no joke).
If I can use logic, an application of mathematics, to make my coffee in the morning, then I’m sure I would find someway of applying math and logic to my occupation (if it wasn’t being a math teacher). I’m not saying that I would have to use math, nor am I saying that I’d go out of my way to use math. It would just be so ingrained in me, that I’d be using it anyways. This hits on all 3 reasons mentioned above. The logic helps you think in a more organized and efficient manner, it’s part of the curriculum because nobody knows what career path (s)he will choose and how math might play a role, and it’s extremely satisfying knowing that you have come up with a new unique solution to a problem.
This is nice and all, but what about the jobs that will really require the use of higher level mathematics? Let’s see for part 3.

What's the Point of This? (Part 1)

This article is taken from my other website wolf-math.com, while that website is about to be overhauled. Originally posted October 21, 2014.

What's the point of this?


Last night I asked my karate instructor, an attorney for 35 years, if he had ever used the quadratic formula in his professional career. His answer surprised me a bit. He said, “No, but I also took many years of French, and I never had to use that either.”
I know that the quadratic formula applies to more than simple quadratics, because quadratics are found in the most surprising of places (logarithms, differential equations, linear algebra,  etc…). But why are we learning it if students are never going to use it? You can have a great career that pays great money, but never have to use the quadratic formula, or really any math beyond algebra 1. So why learn it, or any type of higher level math if you’re never going to use it?
I think there are three answers to this question. The first answer is that math is part of the school curriculum. That may not seem like a good answer, but I think it’s an excellent answer. Why is it part of the curriculum? A lot of people have this notion that school should be trade school; strictly for obtaining employment.  However, school in the United States (up through college) is not trade school. It is set up to give a liberal education to everyone. That liberal education includes mathematics, science, English/language arts, social studies, and more. Students are learning this for 2 reasons. First of all, nobody knows for certain that they will never use math, so we might as well give them all they can get. Secondly, in a more broad sense, we want the next generation of Americans to be thoughtful and intelligent. We want them to know how to write a letter, how congress works, what The Battle of the Bulge was, how cell division works, and the quadratic formula. Knowledge doesn’t have to be the means towards the end, it can be an end all by itself. There is value in having knowledge, and value in being educated. Education enhances our personal lives by attaining values higher than our basic needs, and it advances our civic lives by being positive contributors to our communities.
We want Americans to be educated because when election time rolls around everyone should know how they’re being affected, or when something is happening in the political scene that you don’t like you can write a letter to your congressman. This answer can apply to most of the school curriculum, but not so much math, or writing haiku, or learning French.
We learn how to write Haiku because we can appreciate its beauty. You can also learn math out of appreciation. Math can be appreciated because of its massive collection of applications, or because of its purity. I’m mostly a pure math person, but I appreciate that all math has application somehow, even if we don’t know yet. What I like about applied math is that I better understand the world around me. I get satisfaction out of knowing that a Google search is a massive exercise in linear algebra, and that throwing a ball has within it the quadratic formula and calculus. Even though I frequently forget how to apply my mathematical knowledge to these applied subjects, I feel good knowing that I have some understanding of how they work. When it comes to pure math I get satisfaction by working hard on a subject and being able to solve the problem. I may not know what I’m try to solve for, but I’ve solved the problem! This leads into the third and final answer, we learn math because it makes us better thinkers.
At my last school I was the only high-school math teacher. I was told by many of my students, colleagues, and superiors that I was so smart and analytic. I sincerely do not believe that I am “smarter” than any of those people who said so. I believe, and I tell my students this, that I am not smarter than any of them, I’ve just been trained in a certain subject matter. Just as the black-belt in karate is good because he practiced his karate, I’m good at math because I’ve practiced math.  Learning this math teaches you to think in a certain way even outside of math class. The black-belt walks out of his dojo not realizing that all of his movements are different, not just his karate moves. Similarly when we walk out of math class we are unknowingly thinking differently about the world. This helps us think “smarter” about things. It hasn’t made us smarter, but we’re thinking in a more efficient way.
There is a fourth reason too, but it is an extension to the first answer. More on that in my next blog post.

Sunday, March 25, 2018

Israeli Delegation

It's not often that my boss (in this case my principal) says, "Hey I need to talk to you because you're Jewish." That could go bad in a so many ways, but my principal is really cool and I never expected anything too awkward.

Anyways, what she wanted to tell me was that she was asked by the Cleveland Jewish Federation to be on a committee for helping to improve STEM schools in Israel and she wanted me to join her. It's not often that my private and professional lives intersect in such a way, but that's exactly what I got to take part of this week.

Over the course of the week I got to show off my classroom, which one of the first FabLabs inside of a school, I was a panelist in a panel discussion, and I got to collaborate with some Israeli educators on how to implement a STEM curriculum.

We're far from done, but it was a good start. I hope to collaborate with these wonderfully dedicated educators in the future.

Wednesday, February 14, 2018

Coding Kata

I've recently come across a cool website call Codewars. Codewars is a community of developers who code in a variety of languages. Members of the community can create kata which are coding challenges that you can use to practice coding. As you complete more kata (there are hundreds) you can increase you kyu ranking. You can also level up through kumite, challenging another coder (I haven't tried this yet).

If you're not familiar with these words, they all come from karate. In karate two of the main parts of practice are kumite, and kata. Kumite is sparring. There are levels to this depending on your level, three step sparring for beginners, one step sparring for novices, semi-free and free sparring for advanced. Kata is an organized set of movies that one practices to perfect his karate form. Kata also increase in difficulty as the student advances. In Shotokan Karate there are 26 kata that are practiced in the dojo nowadays. To become a 1st degree back belt you only need to know seven of these kata. An over-simplified summary would be that kata is the ideal and kumite is the reality.

As a karateka myself I really enjoy this analogy of coding as kata. Coding challenges really get the gears turning in your head. The puzzles you might be working out may not be a challenge that a developer may encounter normally, but it helps perfect your form and thinking.

Tuesday, November 21, 2017

Teaching Computer Science



Disadvantaged students face a wide range of problems on a daily basis which they must navigate before they ever have a chance to enter the classroom. As a veteran teacher in the Cleveland Municipal School District (ranked 602 out of 608 in the state) I witness first-hand how my students face poverty, hour long commutes (one way) to school on public transportation, and persistent threats to their safety.

I'm lucky to teach in a specialized STEM-centric school. If my students were at a different high school in the district it's possible that they would go through their day without even touching a computer. And if they DID have access to a computer, it would be ancient technology locked down by antiquated and often-misguided IT governance.

By contrast, at my school all of the 11th graders take my computer science class, where they learn to program Python on Raspberry Pi computers. Nothing is locked down (unless I, the teacher, wants it to be locked down).

Learning to program hits so many educational benchmarks. Critical thinking is a huge aspect of programming. The programming projects in my class help students exercise those critical thinking skills that also help out in other classes. And while not a substitute for reading, writing, social studies, and mathematics, all of these subject areas play key roles in in my class.


Python's simple syntax makes it the ideal programming language to teach. More than any other language I've encountered, which admittedly isn't much, Python code is readable and writable. Struggling students still find that the examples make sense, and advanced students can go ahead at their own pace. It may be possible that Python is helping my students graduate from high school, and ultimately save them from a life a poverty.

Friday, November 3, 2017

PiNet DHCP Configuration

I want to thank Leon Adato, monitoring guru, for his help on this project. This answer on askUbuntu was also helpful.

Background


A few years ago I proposed a new computer lab idea to my principal. Instead of purchasing all new equipment which would have costs ten-of-thousands of dollars, my proposal costs less than three thousand. Instead of standalone desktops or laptops, I used Raspberry Pi's and hand-me-down monitors, keyboard, and mice. The lab is fantastic, and it's capable of 97% of all the things that a traditional computer lab could do (assuming no proprietary software).

I didn't want students to lose their work or fight over which computer they were working on, so I decided to install PiNet, a project based on LTSP, which allows for network booting. 

The only problem that I came across with PiNet was that students were not able to access the internet, even if the server was connected to the wifi and the wired network at the same time. I had to find a way to share the wifi with the Raspberry Pi's. 

DHCP

A DHCP is needed on the server in order to hand out IP addresses to the Pi's. PiNet documentation has you use a router connected to your switch to act as a DHCP, but this won't allow you to share the wifi connection (at least I wasn't able to figure it out). This is how I installed the DHCP on the server and shared my wifi connection with the students' Pi's.

Install and Configure DHCP

First gather your network information with

ifconfig

Take note of what your wifi IP address because you don't want to chose an IP for your local network that conflicts with your wifi network. On my computer this the sections that's under wlps03. My IP starts with a 172.

Now install DHCP server.

sudo apt-get install isc-dhcp-server


After the install you need to configure the DHCP:


sudo nano /etc/dhcp/dhcpd.conf


This is what you'll see


Uncomment the line that says "authoritative" then a little further down you'll configure your DHCP details.


Since my wifi IP starts with 172, I chose to use 192.168.... for my local network. Netmask of 255.255.255.0. The second line tells the DHCP which IP numbers to hand out. I chose .10 through .40 because I have 25 Pi's that need IP addresses, so I figured 30 IPs would be a good number.

Hit ctrl-o to save. You'll be prompted for the filename, just hit ENTER. Exit the program by hitting ctrl-x.

Next week need to set the IP address of the server. Go to the network manager for this.

Select the Wired Connection, and edit. Under IPv4 Settings set the method, "Shared to other computers", then click back on the Connection name and SAVE.



Upon going back to your PiNet main menu you'll see your new IP address. My IP is 10.41.0.1


Make sure you change the SD cards' so that the IP in cmdline.txt matches the IP at the top of the PiNet screen.

Boot and enjoy your wifi!

Opinion: Rails vs. Django

 Opinion: Rails vs. Django Disclaimer: This is an ongoing piece. I'm probably going to be adding to it as time goes on. So I spent ...