https://github.com/matheusadc/sample-flask-auth
Repository created to store the authentication API code with the database.
https://github.com/matheusadc/sample-flask-auth
docker-compose flask flask-login flask-sqlalchemy python
Last synced: 5 months ago
JSON representation
Repository created to store the authentication API code with the database.
- Host: GitHub
- URL: https://github.com/matheusadc/sample-flask-auth
- Owner: MatheusADC
- Created: 2025-02-09T12:17:06.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-02-25T12:05:33.000Z (11 months ago)
- Last Synced: 2025-05-30T17:45:46.152Z (8 months ago)
- Topics: docker-compose, flask, flask-login, flask-sqlalchemy, python
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#
Description
Repository created to store the authentication API code with the database.
#
Commands
##
Installing and updating dependencies
```
pip install -r requirements.txt --upgrade
```
```
pip install bcrypt==4.1.2
```
##
Creating a database
### Using Flask commands
```
flask shell
```
### Indicating the creation of the database
```
db.create_all()
```
### Recording the creation of the database
```
db.session.commit()
```
### Exiting the terminal
```
exit()
```
##
Deleting a database
### Using Flask commands
```
flask shell
```
### Indicating the removal of the tables
```
db.drop_all()
```
### Recording the removal of the database
```
db.session.commit()
```
### Exiting the terminal
```
exit()
```
##
Creating the user
### Using Flask commands
```
flask shell
```
### Creating a user
```
user = User(username="CHOSEN_USERNAME", password="CHOSEN_PASSWORD")
```
### Adding the user
```
db.session.add(user)
```
### Recording the creation of the database
```
db.session.commit()
```
### Exiting the terminal
```
exit()
```
##
Container
### Initialize and run a container
```
docker-compose up
```