Skip to content

diogosimao/django-docker-boilerplate

Repository files navigation

Your App

The goal of your app.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Things you need to have installed:

or

  • pipenv
  • Python3
  • PostgreSQL

Installing

This is a quick project setup for local machine and development purpose to get server up at http://0.0.0.0:8000/.

  • Clone this repo.

      $ git clone [email protected]:diogosimao/django-docker-boilerplate.git your-app
    
  • Create a virtual environment. Make sure you have pipenv installed.

      $ cd your-app
    
      $ pipenv --three && pipenv shell
    

Choose docker or continue with pipenv setup mode

If docker:

It will need some extras. See requirements_docker.txt

    $ pip install -r requirements_docker.txt
    
    $ . ./bin/start-docker-development-server.sh
If pipenv
  • Create database on PostgreSQL

      $ createdb your-app
    
  • With a shortcut just edit ./bin/start-development-server.sh with your DB system info and run the shell script.

  • Or without the script follow ahead with:

      $ pip install -r requirements.txt
    
    • Set DATABASE_URL environment variable:

        $ export DATABASE_URL=pgsql://YOUR_USER:[email protected]:5432/your-app
      
    • Run Django makemigration and migrate:

        $ python manage.py makemigrations
        $ python manage.py migrate
      
    • Run the development server

        $ python manage.py runserver
      

Administration Screen

  • Create superuser with the following line:

      $ python manage.py createsuperuser
    

Default Django administration screen should be up at http://0.0.0.0:8000/admin and you are able to login in.

Running the tests

From your-app directory with pipenv --three and pipenv shell previously executed:

$ pip install -r requirements.txt

Unittests

To run the unittests for this system locally:

$ python manage.py test

In case you want to see code coverage the htmlcov folder (which contains html output from coverage package) will be created after running:

$ . ./bin/run-tests.sh

Functional tests

Do you have geckodrive install for Firefox? If not see jq.

After than install it with:

$ . ./bin/geckodrive-install.sh

and

$ python tests/functional/tests.py

Built With

Author

  • Diogo Simão

Acknowledgments

  • My folks

About

Just as its name would suggests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published