Code Monkey home page Code Monkey logo

pytest-django-tutorial's Introduction

pytest-django-tutorial

Meme generator app for the pytest-django talk at the San Francisco Django meetup.

Slides for this talk are here

Running the Project Remotely

Deploy to Heroku with the button below

Deploy

Local Project Setup

Clone this repo:

git clone [email protected]:wesleykendall/pytest-django-tutorial.git

And change into the main directory:

cd pytest-django-tutorial

Notes for Mac Users

Be sure to install brew in order to set up some of the dependencies for local development.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

If that doesn't work, you may need to install xcode:

xcode-select --install

Pyenv Setup

The local setup assumes you have pyenv installed. In order to install pyenv, either view instructions here or try the following if you are on Mac and have brew installed:

brew install pyenv

Update your ~/.bash_profile with the following lines:

echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bash_profile

After that, do:

source ~/.bash_profile

Django App Setup

This project assumes you have a running version of Postgresql. If you are on a Mac, it will automatially install and run Postgres with brew.

Type make setup to initialize the virtualenv (with pipenv), install all dependencies, and provision the Postgres database for this project. Migrations will also be executed.

Running the Project Locally

In order to run the project locally, you'll need to set some environment variables in your .env file. Open your .env file and adjust the DJANGO_IMG_FLIP_USER value to be the value of your imgflip.com username. Do the same for the DJANGO_IMG_FLIP_PASSWORD field. You need an imgflip.com account in order to run the project.

Activate your pipenv shell with pipenv shell and then type python manage.py runserver. You can also type pipenv run python manage.py runserver. The website can be accessed at 127.0.0.1:8000

Running Tests

Activate your virtualenv with pipenv shell and type pytest to run tests. You can also type pipenv run pytest

pytest-django-tutorial's People

Contributors

wesleykendall avatar

Watchers

 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.