Giter Site home page Giter Site logo

website-django's Introduction

personal website

Repository for my website

starting off

  • Cd to root directory and run pip3 install -r requirements.txt
  • In websiteDjango/settings.py change Debug = False to Debug = True so that django will serve static files.
  • Make the file gitapi/secrets.py in this file define token as a github auth token with the scopes repo and user:
# gitapi/sectrets.py
token = '<your github auth token>'
  • Create a token here
  • Cd to the root directory and run python3 manage.py migrate
  • Then run python3 manage.py runserver this will start the server on http://localhost:8000
  • If you recieved an error this might be due to some sort of error with gitapi/secrets.py
  • After these changes the server should start up. Although, it will display your github repository info on the projects page

front end

  • The front end of this site is done reactjs and just plain html.
  • Django handles the routing and rendering of templates.
  • React is used to fetch information from the api endpoints (api/projects/). Once it does so, it renders the inforamtion that you see in the project pages.

back end

  • The backend of this site was done in Django.
  • When using the "api" django is communicating with the GitHub API via the python wrapper PyGitHub.
  • When it gets a response, it will return the information need for react to render the page.
// basic example of how react and django communicate
fetch('/api/projects/website-django')
    .then(res => res.json())
    .then(data => {
        this.setState({data: data});
    });

directories

  • about — about page
  • homepage — home page
  • projects — project page
  • static — contains css, js, and images
  • templates — all HTML files
  • websiteDjango — main configuration files like routing and settings
  • gitapi — contains code for the api endpoints

website-django's People

Contributors

greerpage avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.