Need Direction for Web App

74 views
Skip to first unread message

zobc...@gmail.com

unread,
Dec 24, 2013, 7:55:37 PM12/24/13
to django...@googlegroups.com
I would like to create a web app / interface to manipulate and maintain my server's dhcpd.conf file. 
Background in Short:
I was asked a few years back to build a wifi network for approximately 500 users with unlimited devices. With no money (barely any money). Done. 
The only requirement/restriction is we use MAC address filtering. So I have a server, serving dhcp leases. I have to manually input each MAC address with a hostname and group. This is a terrible pain. Especially for the amount of users I have with unlimited devices. Christmas time is horrible because they all come in wanting new devices registered. 
I do have, at least, a web form through google which updates an excel sheet in google docs, which I then access, copy the MAC address, then using my server gui, add the new MAC to the dhcpd.conf file and restart the server. 
What I've done & What my hope is:
I have started the Django tutorial. I have dabbled with python. I am an enthusiast in training. I have very little to no experience. I can learn. Fast. I am just running into branches of "things to learn" and it's starting to be a little overwhelming. 
I hope to do the lion's share of creating a web app that will do the following:

1. Register a user using sqlite3 database I have already created for all users. 
2. Authenticate a user
3. Provide a display of registered devices for user to either delete or not delete
4. Provide a form to register a new device(s)
5. submit request, append to dhcpd.conf & restart dhcp server 

There is minutia I am not including in this cry for help

This app would help me gain some distance from this monumental task. 

Am I in the right place? Is there some special soul out there who wants to help a fella out? 

Many thanks to all who have read this.

Mike Roberts

Tom Lockhart

unread,
Dec 25, 2013, 9:53:04 AM12/25/13
to django...@googlegroups.com
On 2013-12-24, at 4:55 PM, zobc...@gmail.com wrote:

I would like to create a web app / interface to manipulate and maintain my server's dhcpd.conf file. 
Background in Short:
I was asked a few years back to build a wifi network for approximately 500 users with unlimited devices. With no money (barely any money). Done. 
The only requirement/restriction is we use MAC address filtering. So I have a server, serving dhcp leases. I have to manually input each MAC address with a hostname and group. This is a terrible pain. Especially for the amount of users I have with unlimited devices. Christmas time is horrible because they all come in wanting new devices registered. 
I do have, at least, a web form through google which updates an excel sheet in google docs, which I then access, copy the MAC address, then using my server gui, add the new MAC to the dhcpd.conf file and restart the server. 
What I've done & What my hope is:
I have started the Django tutorial. I have dabbled with python. I am an enthusiast in training. I have very little to no experience. I can learn. Fast. I am just running into branches of "things to learn" and it's starting to be a little overwhelming. 
I hope to do the lion's share of creating a web app that will do the following:

1. Register a user using sqlite3 database I have already created for all users. 
2. Authenticate a user
3. Provide a display of registered devices for user to either delete or not delete
4. Provide a form to register a new device(s)
5. submit request, append to dhcpd.conf & restart dhcp server 

I would use one of the Django CMS apps as a starting point (I've had good experiences with Mezzanine and I'm sure other ones would work). For example, Mezzanine out of the box can give you a blog for a home page (so you can post, say, status updates), user authentication, and other pieces you may not use right away but are available when you want them. You can also put these together individually from Django components and other available apps, but afaict that is almost guaranteed to be a bit more work.

Finish working through the Django tutorial, since that will introduce you to the building blocks.

Start your project by defining the schema in your new app with your own models.py underneath your new project. That will almost immediately give you an admin interface to play with your schema.

Think about using Postgres for the database.

You should be able to export your current spreadsheet and then perhaps read it into a python program and out into your database. Or you might be able to import it directly into a single table then use raw SQL to push the data around into the schema you need. You mentioned that you already have database content for users in sqlite; not sure what that schema looks like but although Django has enough hooks to map most existing schemas to the Django ORM, you might find it cleaner and more maintainable to define your schema in Django and then convert your existing tables over to it (they are likely to be very similar, and you may be able to do it with some raw SQL).

You will find that asking very specific questions on this mailing list will be more likely to get a response, so as you go along feel free to do so. Search first for the answer though; you will find a lot of questions have already been answered and come up in google.

hth

                     - Tom

zobc...@gmail.com

unread,
Dec 25, 2013, 2:31:20 PM12/25/13
to django...@googlegroups.com
Thank you for your response. I will start where you suggested.

Doug Ballance

unread,
Dec 26, 2013, 2:15:35 AM12/26/13
to django...@googlegroups.com
I was waiting on Christmas dinner, and had an hour to kill so  I threw together a quick, incomplete skeleton app.  Maybe it can be of use to get you started on the django side.  It relies on the django-macaddress  package, but is otherwise standalone.  It's very basic - the less there is of it, the easier to follow for someone new to django/python.  To make it functional you'd need to edit the alter_dhcp_conf() method to do the heavy lifting of securely updating your dhcpd conf and making the daemon reload.  That method will run any time a device is added or removed.

https://github.com/dballanc/dhcp-example-skel

Good luck, and welcome to the community.


zobc...@gmail.com

unread,
Dec 26, 2013, 2:12:30 PM12/26/13
to django...@googlegroups.com
Doug, 

I am speechless, but will attempt to overcome that. Thank you for doing this. Merry Christmas. I will open this bad boy up and see if I can make heads or tails. Thank you again. Very nice of you indeed. 

Mike


On Tuesday, December 24, 2013 7:55:37 PM UTC-5, zobc...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages