Website for DjangoGirls.org
Python HTML CSS JavaScript Shell
Latest commit fde8830 Feb 20, 2017 @patjouk patjouk committed on GitHub Merge pull request #412 from patjouk/eventlistpictures
Edit of setup instruction
Permalink
Failed to load latest commit information.
applications Optimize applications page basing on initial work of beratdogan Jan 19, 2017
coach coach app added. Jan 24, 2017
core Merge pull request #412 from patjouk/eventlistpictures Feb 20, 2017
djangogirls Create pictures app Feb 2, 2017
githooks Bash 💻 🔥 💩 Oct 14, 2015
gulp Add triaging buttons and custom EventApplication admin view to handle… Jan 7, 2017
jobs Remove jobs and meetups Jan 7, 2017
organize Add random picture to new events Feb 2, 2017
patreonmanager Use VCR.py to freeze all external HTTP calls Jan 7, 2017
pictures add new test Feb 18, 2017
sponsor sponsor app added. Jan 20, 2017
static/source Remove unneeded js files Jan 20, 2017
story Move fetch_stories command to the story app. Make the title longer fo… Jan 15, 2017
templates Merge pull request #403 from madjar/fix-markdown Feb 14, 2017
.coveragerc Attempt to fix coverage report Dec 16, 2016
.editorconfig Add editor config to enforce tab/spaces in files Jan 7, 2017
.gitignore Add required style in all places in the form Jan 18, 2017
.travis.yml Update travis settings. Jun 17, 2016
LICENSE Fixing intro May 24, 2016
README.md Move Gmail Apps integration from prototype code into production ready… Jan 21, 2017
codecov.yml Revert "Revert "Add core.gmail_accounts to codecov ignores"" Feb 18, 2017
gulpfile.js Add versioning and compiling of css files via gulp Apr 16, 2016
manage.py Added Django to the project Jul 30, 2014
package.json Add tasks for scripts, add css bundling Apr 17, 2016
pytest.ini Move to py.test Jun 17, 2016
requirements.in Keep requirements.in updated after merge Jan 21, 2017
requirements.txt Keep requirements.in updated after merge Jan 21, 2017
sample_db.json Remove jobs and meetups Jan 7, 2017

README.md

Django Girls website

Build Status codecov

This repository contains sources of Django application that powers DjangoGirls.org.

What's in it?

It's a simple CMS that contains 4 models:

  • Event - a list of events and their website configuration
  • EventPageContent - blocks of content that are visible on the website
  • EventPageMenu - items of menu of every website

How to create new event?

Simply go to command line and run this command:

python ./manage.py new_event

And then follow the instructions.

How to manage your website?

Event

http://djangogirls.org/admin/core/event/

Here you can change:

  • Meta tags - title and description of the website
  • Main color - main color on the website in HEX (default is FF9400)
  • Custom CSS - customize CSS on the website
  • URL - url that goes after the domain (http://djangogirls.org/__url__)
  • Is live? - live website is available on the homepage and can be accessed by anyone

EventPageContent

http://djangogirls.org/admin/core/eventpagecontent/

Each website comes with some default content that you can adjust to your needs. Each object is a "block" on the website that you can modify in following ways:

  • Name - it's also a permalink that you can link to like this: #name
  • Content - HTML is allowed
  • Background - there are two available types of blocks: without background and with background. By uploading image you're choosing the type with background.
  • Is public - check this if you want this block to be visible

EventPageMenu

http://djangogirls.org/admin/core/eventpagemenu/add/

To manage menu available on the website, you can add objects to EventPageMenu. Available options:

  • Title
  • URL

Contributing to Django Girls website

The website is hosted on PythonAnywhere and is available here: http://djangogirls.org/

Please note that we use Python 3 only, so make sure that you use correct version when running commands below.

Setting up a development environment

First, clone the repository:

git clone git@github.com:DjangoGirls/djangogirls.git

Step into newly created djangogirls directory:

cd djangogirls

Create a new virtual environment if needed. Then, install all the required dependencies:

pip install -r requirements.txt

Start the PostgreSQL database server and enter the psql shell (you need to have PostgreSQL installed):

psql

In the psql shell, create a database and a role with the necessary permissions:

CREATE DATABASE djangogirls;
CREATE ROLE postgres;
GRANT ALL privileges ON DATABASE djangogirls TO postgres;
ALTER ROLE postgres WITH LOGIN;

Exit the psql shell:

\q

Run the migration to create database schema:

./manage.py migrate

Load sample data to the database

./manage.py loaddata sample_db.json

Create a user so you can login to the admin:

./manage.py createsuperuser

Install dependencies for static files:

npm install

Compile CSS and JS files:

gulp watch

Run your local server:

 ./manage.py runserver

🎉 You're done.

Run the tests

You can run the tests like this:

py.test

Or if you want coverage reports:

py.test --cov

For a coverage report with information about missing lines, run this:

py.test --cov-report term-missing --cov

Update requirements.txt

You will need to install pip-tools:

pip install pip-tools

Then compile requirements.in into a new list of requirements:

pip-compile

To try and update a particular dependency:

pip-compile -P django

You can also tell it to try and update all the dependency versions:

pip-compile -U

Please note that pip-compile will not install or upgrade any packages. You still need to install them separately.

pip-tools also provides a tool that will install all required packages and uninstall all packages that are not explicitly required. This can prove useful when removing dependencies to make sure no code tries to import them:

pip-sync

Static files

We're using a Stylus as our CSS pre-processor. Get styling with Stylus.

This means you shouldn't change any css files, but .styl files. They're in /static/source/css/ directory.

Autocompiling of .styl files to .css:

gulp watch

We're also using gulp for our static files builds. To build static files for production, run this:

gulp build

For local development:

gulp local

Hosting on PythonAnywhere

Key bits of config and secrets are stored in environment variables in two places:

  • in the WSGI file (linked from the Web Tab)
  • in the virtualenv postactivate at ~/.virtualenvs/djangogirls.com/bin/postactivate

Google Apps API integration

We're using Google Apps Admin SDK for creating email accounts in djangogirls.org domain automatically.

Several things were needed to get this working:

  1. Create an app in Developer Console
  2. Create a service account to enable 2 legged oauth (https://developers.google.com/identity/protocols/OAuth2ServiceAccount)
  3. Enable delegation of domain-wide authority for the service account.
  4. Enable Admin SDK for the domain.
  5. Give the service account permission to access admin.directory.users service (https://admin.google.com/AdminHome?chromeless=1#OGX:ManageOauthClients).