Skip to content

JahodaPaul/sixtribution

Repository files navigation

SIXTribution

This is the API Server for the SIXTribution Project created for the HackaTUM 2022 Sixt Challenge.

Contributing

The “micro” in microframework means Flask aims to keep the core simple but extensible. Flask won’t make many decisions for you, such as what database to use.

By convention, templates and static files are stored in subdirectories within the application’s Python source tree, with the names templates and static respectively.

Dependencies

Virtual environments

$ sudo apt-get install python-virtualenv
$ python3 -m venv venv
$ . venv/bin/activate
$ pip3 install Flask

Install all project dependencies using:

$ pip3 install -r requirements.txt

Running

$ FLASK_APP=app.py FLASK_ENV=development python3 -m flask run --host=0.0.0.0

This launches a very simple builtin server, which is good enough for testing but probably not what you want to use in production.

If you enable debug support the server will reload itself on code changes, and it will also provide you with a helpful debugger if things go wrong.

If you have the debugger disabled or trust the users on your network, you can make the server publicly available simply by adding --host=0.0.0.0 to the command line:

flask run --host=0.0.0.0

Running using Manager

This app can be started using Flask Manager. It provides some useful commands and configurations, also, it can be customized with more functionalities.

python manage.py runserver

Alembic Migrations

Use the following commands to create a new migration file and update the database with the last migrations version:

flask db revision --autogenerate -m "description here"
flask db upgrade head

This project also uses the customized manager command to perform migrations.

python manage.py db revision --autogenerate -m "description here"
python manage.py db upgrade head

To upgrade the database with the newest migrations version, use:

python manage.py db upgrade head

For more information, access Auto generating migrations.

References

This API was developed based on:

Flask documentation

REST APIs with Flask and Python

The Ultimate Flask Course

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Code written for HackaTUM 2022

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors