Skip to content

emanuelegurini/django-todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Questo progetto ha scopo puramente didattico.

TODO:

  • add auth (JWT)

  • improve error handling

  • create a new entity

python manage.py startapp <entity name>
  • create a new migration
python manage.py makemigrations 
  • apply migrations
python manage.py migrate
  • run server
python manage.py runserver  
  • genera secret key per auth
python -c "import secrets; print(secrets.token_urlsafe(32))"
# Output: kJ8Hn3L9pQ2mR5tW7xZ1aB4cD6eF8gH0
  • Crea un superuser (impostazione guidata):
python manage.py createsuperuser
# Username: admin
# Email: admin@example.com
# Password: ****

SQLite

  • Inspect db throught Django
python manage.py dbshell
  • Inspect db
sqllite3 db.sqlite3 # db is the db name
  • Format code
ruff format .
  • Check imports
ruff check .
curl -X GET http://127.0.0.1:8000/tasks/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <access_token>"
curl -X POST http://127.0.0.1:8000/api/token/ \
-H "Content-Type: application/json" \
-d '{"username": "USER_NAME", "password": "PASSWORD"}'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages