GithubHelp home page GithubHelp logo

docker-django-pipenv-mysql's Introduction

Docker-Django-Pipenv-MySQL

Awesome development environment setup Docker + Pipenv + Django Rest Framework + MySQL AWESOME TUTORIAL: https://medium.com/zeitcode/a-simple-recipe-for-django-development-in-docker-bonus-testing-with-selenium-6a038ec19ba5

Pipenv basics

https://www.techiediaries.com/pipenv-tutorial/ pipenv install getenv

More Docker Commands: coming soon

Enter into Docker-Django-Pipenv-MySQL directory

cd Docker-Django-Pipenv-MySQL

Run Docker commands

docker-compose build
docker-compose up -d

Setting up pipenv:

Install pipenv:

pip install pipenv

Create pipenv envelope:

pipenv shell --three

Install dependencies

pipenv install django
pipenv install djangorestframework
pipenv install dj-database-url
pipenv install getenv

Setting up Django:

Create the backend directory:

django-admin.py startproject backend

Database installation, Creation, and Configuration:

Install mysql: https://stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost

Start the mysql server: \

service mysql start

Note, command to stop mysql server below:\

service mysql stop

Note: command to check if server is running:

service mysql status

Setup a user:

 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypasswordissecret’';
mysql -u root -p

Create a database:

CREATE DATABASE django_db;

Change settings.py to recognize environment variables:

Add this to top: import dj_database_url
Add this below: DATABASES = {'default': dj_database_url.config()}

docker-django-pipenv-mysql's People

Contributors

akirademoss 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.