I need to make an application that uses database in python

  • #1
shivajikobardan
543
34
I need to make an application that uses database in python, what should I make?

Firstly I need to tell about me. I know 0 about programming. I have learned basics of python only. What are the apps that use database that are upto my level of programming?

I am planning to use django.
-------------------------------------------
Softwares that I love to make-:

1) There is a website called slideplayer.com. I want to download the slides of that page as images and convert them to pdf. Is this doable in my level of programming? Does this uses database? What do I need to learn to make this type of application?

-------------------------------------------
What are doable projects of my level? Please guide a bit? I am thinking about todo app. Is that doable on my level? What do I need to learn to be able to make a todo app in django?
 

Answers and Replies

  • #2
FactChecker
Science Advisor
Homework Helper
Gold Member
7,720
3,389
Pick something you like that has information associated with it:
popular music: title, artist, lyricist, genre, rating, ...
photographs: title, location, f-stop, shutter speed, zoom setting, ...
TV shows: title, broadcast network, genre, ...
Cooking: ...
Exercise: ...
...

Write a program to store and look up this information.
Or you could make a database program that holds the list of possible database projects that I started above. :cool:
 
Last edited:
  • Like
Likes Janosh89, BvU and anorlunda
  • #3
shivajikobardan
543
34
Pick something you like that has information associated with it:
popular music: title, artist, lyricist, genre, rating, ...
photographs: title, location, f-stop, shutter speed, zoom setting, ...
TV shows: title, broadcast network, genre, ...
Cooking: ...
Exercise: ...
...

Write a program to store and look up this information.
Or you could make a database program that holds the list of possible database projects that I started above. :cool:
Is todo app project fine, does it uses database? I think so?
 
  • #4
FactChecker
Science Advisor
Homework Helper
Gold Member
7,720
3,389
Is todo app project fine, does it uses database? I think so?
Sure, that should be fine. If there is information to store and retrieve, then you can use a database.
You can start simple, just store and retrieve a todo list.
If you want to, you can build around the database to do more:
Have a program that occasionally looks at the list and reminds you of what needs to be done.
Warns you of items with a "drop dead" date that day.
etc.
 
  • #6
14,279
8,300
A cheap kind of database is to encode your keys as directory and filenames. with the data stored in the file.

./addrbook_db/smith/john/info.txt
./addrbook_db/washington/george/info.txt
...

then walk the directory tree to find someone that matches your criteria.
 
  • #7
FactChecker
Science Advisor
Homework Helper
Gold Member
7,720
3,389
I think that it would be good to learn to use a free relational database utility like MySQL.
 
  • #12
willem2
2,109
371
Do you mean just store and retrieve information in your own Python datastructures, or do you mean interface with a real database program like SQL?

https://searchdatamanagement.techtarget.com/definition/SQL

I already know database and sql.
It's probably best to use a python module that uses the python database api specification 2.0. (most of them) https://www.python.org/dev/peps/pep-0249/
They basically all work the same, except for the connect() method.
You need to make your own SQL queries, but it is easy to move your python data into parameters of the query, or to read the results into python structures. You will have to install a database to connect to first.
Eventually you use code like this to read records

Code:
>>> select_movies_query = "SELECT * FROM movies LIMIT 5"
>>> with connection.cursor() as cursor:
...     cursor.execute(select_movies_query)
...     result = cursor.fetchall()
...     for row in result:
...         print(row)
...
(1, 'Forrest Gump', 1994, 'Drama', Decimal('330.2'))
(2, '3 Idiots', 2009, 'Drama', Decimal('2.4'))
(3, 'Eternal Sunshine of the Spotless Mind', 2004, 'Drama', Decimal('34.5'))
(4, 'Good Will Hunting', 1997, 'Drama', Decimal('138.1'))
(5, 'Skyfall', 2012, 'Action', Decimal('304.6'))

Tutorials for mysql and postgresql.
https://realpython.com/python-mysql/
https://pynative.com/python-postgresql-tutorial/

Django, will allow you to define python classes to make a database model. (your classes will be subclassed of the django model class). Django will write the sql queries for you to create, update and query the tables in an underlying database, and you only have to interact with python objects. Its main strength is using the data on a website you create with it. It's probably best to try the python db-api first.
 
  • #13
anorlunda
Staff Emeritus
Insights Author
11,207
8,621
I hope you understand that a private scheme to saving and retrieve your own data is not the same as using an existing database.

With an existing database, there are other interfaces for people to interact with the data in addition to your program.
 
  • #14
shivajikobardan
543
34
I have an upcoming assignment that I need to make an application that uses database, that has frontend. What can I make? Things I am thinking about-:

1) User authentication

2) To do website.

What else are possible, please open my mind?
I am creating it in django.
 
  • #15
BvU
Science Advisor
Homework Helper
15,360
4,337
You are repeating yourself. Do some preparatory work first.

##\ ##
 
  • Like
Likes shivajikobardan
  • #16
shivajikobardan
543
34
You are repeating yourself. Do some preparatory work first.

##\ ##
What preparatory work should I do?
 
  • #17
BvU
Science Advisor
Homework Helper
15,360
4,337
I like your sense of humour :smile: !
What about reading post #12 by @willem2 ?
Or doing some internet research on 'how to get started with ...' ?

##\ ##
 
  • #18
ipsky
17
11
You can consider TinyDB. Look through the documentation. It stores data in the JSON format, which may allow you to extend and scale your project in the future.
 

Suggested for: I need to make an application that uses database in python

Replies
13
Views
1K
Replies
1
Views
415
Replies
0
Views
431
Replies
4
Views
688
Replies
47
Views
2K
Replies
4
Views
2K
  • Last Post
Replies
3
Views
691
  • Last Post
Replies
4
Views
3K
Replies
0
Views
375
Top