Giter Site home page Giter Site logo

18f-django-project-template's Introduction

18F Django project template

Django project templates are a little-known option that allows you to create new Django projects based on your own preferences and boilerplate. This means you can pre-install apps, templates and dependencies and have them already in place, predictably and consistently, when you start a new project.

This (currently WIP) project template is designed to make starting a new USWDS-based Django project as simple as possible, while including additional government-related boilerplate such as federated analytics tags.

Starting a new project

  1. Be sure pipenv is installed: pip install pipenv
  2. Create or navigate to the directory you're building your Django project in. Typically, this should be your Git repository.
  3. Grab the pipfile from this repo: wget https://raw.githubusercontent.com/18F/18f-django-project-template/master/Pipfile
  4. Then use it to install Django and other dependencies you'll want for your project: pipenv install
  5. Activate the pipenv shell (virtualenv) with pipenv shell
  6. Now you'll start your project pulling from this repo for the template: django-admin.py startproject --template=https://github.com/18F/18f-django-project-template/archive/master.zip project_name. Be sure to replace project_name with whatever your project should be named.
  7. Move into the project_name directory you just created.
  8. Create a .env for your environment variables. The example.env included here is one good example.
  9. Run python manage.py runserver and go take a look at your new project.

What's next

In development, the project template will create a simple sqlite db. When you prep your staging and prod environments, you'll want to be sure postgresql is ready for you.

Remember to go into your admin and set the site variables, so you don't show up as example.com

By default your AGENCY setting (used for analytics) is set to the project name. Since that's probably not what you want, you'll want to change that.

What's included with the project template

  • Django 2.0+ support
  • base.html based on HTML5 Boilerplate, optimized for USWDS, accessibility and best practices.
  • Uses Pipenv - the officially recommended Python packaging tool from Python.org.
  • Get value insight and debug information while on Development with django-debug-toolbar.
  • HTTPS and other security related settings.
  • Some additional context processors.
  • Cloud.gov integration, including Cloud UAA and database readiness.

Additional docs

Additional documentation is available in the /docs folder.

Upcoming additions

  • USWDS integration (NPM? Submodule? Preferences?)
  • Improved Cloud.gov readiness

Deployment

(Coming) It is possible to deploy to Cloud.gov or to your own server.

License

TBD

Notes

18f-django-project-template's People

Contributors

tbaxter-18f 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.