Wednesday, December 25, 2013

Re: Need Direction for Web App


On 2013-12-24, at 4:55 PM, zobcloud@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

No comments:

Post a Comment