Coder Social home page Coder Social logo

django-app's Introduction

Table of Contents

Short Description

Simple web application with Django (SSR and REST API) applying good development practices and TDD.

Project Dependencies

The project dependencies are listed in the requirements.txt file.

Django==2.0.4
flake8==3.5.0
mccabe==0.6.1
pep8==1.7.1
pycodestyle==2.3.1
pyflakes==1.6.0
pytz==2018.4

Notes

Python version used is 3.6.5.

To create the virtual environment for the project, when this version of Python it is not the default in the system but it is installed, you can do:

  • virtualenv -p /usr/bin/python3.6 env

Once the virtualenv is activated you can install the dependencies:

  • pip install -r requirements.txt

Testing tools

unittest Python standard library module used by Django’s unit tests. This module defines tests using a class-based approach. Django offers django.test.TestCase, which is a subclass of unittest.TestCase that runs each test inside a transaction to provide isolation.

Project Structure

The code of the application, the "src" folder, is organized in the following directories:

env/
src/
    app/
        settings.py
        urls.py
        wsgi.py
    db.sqlite3
    manage.py
.gitignore
README.md
requirements.txt

Execution

In the django project directory (src folder), you can run:

python manage.py migrate

To run model and data migrations into the sqlite3 database.

python manage.py runserver

Runs the app in the development mode. Open http://localhost:8000 to view it in the browser.

The page will reload if you make edits. You will also see any errors in the console.

python manage.py test

Launches all tests in the project.

To include a coverage report:

  • coverage run --source='.' manage.py test plans
  • coverage report

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.