Skip to content

Commit

Permalink
Update code base for Flask 1.0 and more
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjj committed May 22, 2018
1 parent 1754eb5 commit c16b419
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 35 deletions.
Empty file modified .dockerignore
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
COMPOSE_PROJECT_NAME=snakeeyes
PYTHONUNBUFFERED=true
1 change: 1 addition & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
.coverage
.cache
.pytest_cache

# Translations
*.mo
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM python:2.7-slim
MAINTAINER Nick Janetakis <nick.janetakis@gmail.com>
LABEL maintainer="Nick Janetakis <nick.janetakis@gmail.com>"

ENV INSTALL_PATH /snakeeyes
RUN mkdir -p $INSTALL_PATH
RUN apt-get update && apt-get install -qq -y \
build-essential libpq-dev --no-install-recommends

WORKDIR $INSTALL_PATH
WORKDIR /app

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
Expand Down
Empty file modified LICENSE
100644 → 100755
Empty file.
17 changes: 10 additions & 7 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## Welcome to The Build a SAAS App with Flask Course
## Welcome to The Build a SAAS App with Flask Course!

*Learn how to build a production ready web app with Flask and Docker. Level up
and win that dream software developer job.*
*A video course where you'll Learn how to build a real world web application
with Flask, Celery, Redis, PostgreSQL, Stripe and Docker.*

**Full details on the course can be found here:**
http://nickjanetakis.com/courses/build-a-saas-app-with-flask
[https://buildasaasappwithflask.com](https://buildasaasappwithflask.com/?utm_source=github&utm_medium=bsawf&utm_campaign=readme-top)

Free sample videos **(including what we'll build)** can be found here:
http://nickjanetakis.com/blog/build-a-saas-app-with-flask-free-sample-videos
https://nickjanetakis.com/blog/build-a-saas-app-with-flask-free-sample-videos

### How does this source code differ than what's in the course?

Expand Down Expand Up @@ -44,13 +44,16 @@ The rest of the course covers topics such as:
- Dealing with database migrations
- Converting your app to support multiple languages (i18n)

**By the time you finish my course, you'll have all the confidence you need to
**By the time you finish the course, you'll have all the confidence you need to
build a large web application with Flask**.

---

There's over 150 video lectures, 9.5 hours of content, coding exercises and an
e-book that's included.

Also as a bonus, there's an additional 3 hours of content that covers building a
separate RESTful API driven application that uses web sockets.

**Everything you'd want to know about the course can be found here:**
http://nickjanetakis.com/courses/build-a-saas-app-with-flask
[https://buildasaasappwithflask.com](https://buildasaasappwithflask.com/?utm_source=github&utm_medium=bsawf&utm_campaign=readme-bottom)
22 changes: 16 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
version: '2'

services:
postgres:
image: 'postgres:10.4-alpine'
env_file:
- '.env'
volumes:
- 'postgres:/var/lib/postgresql/data'
ports:
- '5432:5432'

redis:
image: 'redis:3.0-alpine'
image: 'redis:4.0-alpine'
command: redis-server --requirepass devpassword
volumes:
- 'redis:/var/lib/redis/data'
Expand All @@ -16,20 +25,21 @@ services:
--access-logfile -
--reload
"snakeeyes.app:create_app()"
environment:
PYTHONUNBUFFERED: 'true'
env_file:
- '.env'
volumes:
- '.:/snakeeyes'
- '.:/app'
ports:
- '8000:8000'

celery:
build: .
command: celery worker -l info -A snakeeyes.blueprints.contact.tasks
command: celery worker -B -l info -A snakeeyes.blueprints.contact.tasks
env_file:
- '.env'
volumes:
- '.:/snakeeyes'
- '.:/app'

volumes:
postgres:
redis:
25 changes: 11 additions & 14 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
Flask==0.10.1
Flask==1.0.*

# Application server for both development and production.
gunicorn==19.4.5
gunicorn==19.8.*

# Testing and static analysis.
pytest==2.9.1
pytest-cov==2.2.1
flake8==2.5.4

# CLI.
Click==6.4
pytest==3.5.*
pytest-cov==2.5.*
flake8==3.5.*

# Data and workers.
redis==2.10.5
celery==3.1.23
redis==2.10.*
celery==4.1.*

# Forms.
Flask-WTF==0.9.5
WTForms-Components==0.9.7
Flask-WTF==0.14.*
WTForms-Components==0.9.*

# Extensions.
flask-debugtoolbar==0.10.0
Flask-Mail==0.9.1
flask-debugtoolbar==0.10.*
Flask-Mail==0.9.*
4 changes: 2 additions & 2 deletions snakeeyes/blueprints/contact/forms.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from flask_wtf import Form
from flask_wtf import FlaskForm
from wtforms import TextAreaField
from wtforms_components import EmailField
from wtforms.validators import DataRequired, Length


class ContactForm(Form):
class ContactForm(FlaskForm):
email = EmailField("What's your e-mail address?",
[DataRequired(), Length(3, 254)])
message = TextAreaField("What's your question or issue?",
Expand Down
4 changes: 2 additions & 2 deletions snakeeyes/extensions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from flask_debugtoolbar import DebugToolbarExtension
from flask_mail import Mail
from flask_wtf import CsrfProtect
from flask_wtf import CSRFProtect

debug_toolbar = DebugToolbarExtension()
mail = Mail()
csrf = CsrfProtect()
csrf = CSRFProtect()

0 comments on commit c16b419

Please sign in to comment.