Giter Site home page Giter Site logo

sarath-pm / django-sample-code Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ndagistanley/django_girls_complete

0.0 0.0 0.0 21 KB

Sample code for testing DevOps pipeline.

Home Page: https://bit.ly/2MHirJU

License: Other

Shell 2.53% Python 73.01% CSS 5.13% HTML 17.84% Dockerfile 1.48%

django-sample-code's Introduction

Complete Django Girls Tutorial

This repository contains the code that one would eventually have were they to go through the Django Girls tutorial.

CircleCI

Differences

Expressing my authorial rights, some things are a bit different from the tutorial:

  • A Log in and Log out links on the page header

  • A Back link within the blog-detail and blog-edit pages

  • A more extensive .gitignore file

  • A .editorconfig file

  • An additional python package in the requirements.txt: pycodestyle

  • Within mysite/settings.py,

    • Use of Africa/Nairobi as my TIME_ZONE
    • Use of en-us as my LANGUAGE_CODE
    • Addition of 0.0.0.0 and .herokuapp.com to the ALLOWED_HOSTS list

Setup

In a python virtual environment, run:

  • pip install -r requirements.txt
  • python manage.py migrate blog
  • python manage.py createsuperuser (to create user that you'll use to log in)

Run the application

python manage.py runserver

Now, you are good to go. Your blog is ready.

Test

python manage.py test

Docker

NB: The app instance will run off the a preset admin user as set in init.sh.

To spin up the application using docker, ensure that Docker is installed. Then run:

docker-compose up

Or in detached mode:

docker-compose up -d

The application will be live at 0.0.0.0:8000

Log in/ out

  • Click on Log in (you'll be redirected to the Admin page)
  • On the admin page, fill in the credentials of the superuser created in Setup
  • Click on the Log in button (You'll be redirected back to the page)
  • Click on Log out to log out.

Blog entry

  • Log in
  • Click on the + button, enter the title and text
  • Finally hit the Save button

django-sample-code's People

Contributors

dependabot-preview[bot] avatar ndagistanley avatar sarath-pm 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.