cookiecutter-flask/cookiecutter-flask

Configuration option for datatables with sample data

uBadRequest opened this issue · 4 comments

This may just be due to the fact that i'm a noob when it comes to some of this stuff, but setting up datatables previously with flask and mongodb took me so long to do. I feel as if this is something that most web applications would have, a datatable, whether its for some administration process or simply viewing data.

During the configuration process, I think it would be very cool if there was the option to have datatables configured, the database populated with sample data, with a page that has a table. I would personally have been very excited if I saw that as an option because I currently wonder how long its going to take me to set it up.

Let me know what you guys think or if this isn't the type of thing that would be supported as part of the cookiecutter.

Thanks!

When I've needed to do this in the past, I've used flask-admin. Is that similar to what you've used, or did you do something custom?

I agree this would be useful: I can take a look at adding something like this when I have some free time, but also feel free to submit a PR any time!

I used mongo_datatables. I'll have to look into flask-admin though!

I kind of specifically looked for datatables because i've noticed a few web apps using it lately and it seems really flexible. I have a lot of data so I had to setup server side processing too. All I have right now is really a single page.

I just learned about cookiecutters while trying to find a quicker way to get this app up and going with user authentication and everything else. I really wanted to figure out how to setup user authentication with saml or AD. I looked at django's cookiecutter but was so comfortable with how flask works that I figured id just try to stick with it. This is my first web app so I really have no idea what i'm doing when it comes to the front end.

I just don't know if it makes sense to have 2 databases, all the data my python scripts are gathering and enriching are currently using a mongodb. I'm thinking about converting it to postgres but thats going to be a pain in the ...

Your cookie cutter is really going to help me out though! Thanks! If I can figure out something, and think its PR worthy, I'll be sure to send one.

Since the cookiecutter has the option to create a User Registration page, this might be a natural option to configure the database connection and a data table for the user.

Something like:
Create database and tables for user registration? [y/n]
Which database do you want to use: [sqlite / postgres / mongdb ... ]

... and then set up the model and database connection for the registration table, along with some CRUD admin views to view and edit / delete user registration.

It would be nice to also add the fields FirstName and LastName as optional fields for user registration, since most real-world applications require them.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.