Tyler Bell
Tyler Bell

Reputation: 897

Python and Django Insert Strings into a Database

I am using Django and Python for the "framework" of a website. What I am trying to do is create a database that stores user input. The main purpose here is to find out the most common inputs for analytics, etc.

I thought about just making a CSV file and inserting into it via Python. But having to open the file and write to it each time seems inefficient. Maybe I'm wrong.

Are there any best practices out there that could help achieve this?

Thanks

Upvotes: 1

Views: 166

Answers (1)

Thomas Schwärzl
Thomas Schwärzl

Reputation: 9917

With Django you can create a model which gives you the abillity to use forms - which get displayed as a HTML form on your website.

All you now need to do is to save it. :)

To start: There's a good tutorial at the Django documentation especially this part (Django: Playing with the API) is interesting for you - but I recommend to start from the beginning of the tutorial first.

Upvotes: 2

Related Questions