Code Monkey home page Code Monkey logo

startproject's Introduction

Flask Project Builder

This script will start a new Flask project on the application factory model.

Structure provided

<project name>/
+-- <project name>/
|   +-- ext/ 
|   |   +-- site/
|   |   |   +-- __init__.py
|   |   |   +-- main.py
|   |   +-- __init__.py
|   +-- static/
|   |   +-- ccs/
|   |   +-- img/
|   |   +-- js/
|   +-- templates/
|   +-- __init__.py
|   +-- app.py --> project entry point
+-- tests/
|   +-- conftest.py
|   +-- test_app.py --> with 3 tests
+-- LICENCE
+-- Makefile
+-- README.md
+-- requirements.txt
+-- requirements-dev.txt
+-- setup.py

How to use

  1. Copy the file startproject.py to the directory where you will create the flask project.
  2. Run with the command:
$ python3 startproject.py your_project_name --venv --sqlal

IMPORTANT

  • Do not use spaces in your project name. Prefer underscores instead spaces.
  • The --venv argument indicates that you want to create a virtual environment. It will be created inside the project's root folder as .venv.
  • The --sqlal argument indicates that you want to install SQLAlchemy in your project.
  • If you don't pass any arguments, they will be asked for you.

In the Makefile file, we have some useful commands, which we use with the make command, such as:

command what he does
make clean clears the project folder
make install install our project as a package python
make install-dev similar to install, but with requirements-dev.txt
make test run tests
make run run flask
make run-dev run flask in the development environment

This python script was created by Cesar and Jady Godoi during Curso de Desenvolvimento Web taught by Bruno Rocha.

startproject's People

Contributors

cesargodoi avatar jady-sm-godoi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.