Code Monkey home page Code Monkey logo

pygotham's Introduction

PyGotham

'Stories in Ready'

Requirements Status

Requirements

or

Getting started

The simplest way to create an environment for working on PyGotham is to use Docker and Docker Compose. Installing Docker is beyond the scope of these instructions, but once you have each tool installed, a new environment can be created by executing the following commands from within the folder where you've closed this repository:

$ docker-compose build
$ docker-compose up -d

Alternate setup

If you choose not to use Docker, you'll need access to Python 3.5 and PostgreSQL.

The easiest way to manage multiple versions of Python is with pyenv. A .python-version file is included in this repository to ensure that the correct version is always used with the project. Just make sure you install the appropriate version:

$ pyenv install 3.5.1

We recommend using a virtual environment to install PyGotham's dependencies. The easiest way to manage your virtual environments is with virtualenvwrapper. If you are using pyenv, you'll want to install pyenv-virtualenvwrapper.

You'll also need to install the project's requirements:

$ python -m pip install -r dev-requirements.txt

Project configuration

An example configuration file is included in the repository. It can be used as the basis for your local settings:

$ cp instance/example_settings.cfg instance/settings.cfg

If you are using Docker, this file can be used as-is. If you aren't, make sure you update SQLALCHEMY_DATABASE_URI to include the correct URI for your database.

Database initialization

If you are using Docker, make sure to run the commands in this section through docker-compose run web.

When you first get started, you'll need to create the database:

$ createdb pygotham

Note

If you are using Docker, Compose will take care of for you.

Then you'll need to create the tables:

$ python manage.py db upgrade

Next, you'll need to create a user account. To create a user with access to the admin:

$ python manage.py create_admin
Email: <email>
Name: <name>
Password: <password>
Confirm Password: <password>

The last step is to create an event:

$ python manage.py create_event
Name: <name>
Slug (optional): <slug>
Event start date: <YYYY-MM-DD>
Event end date: <YYYY-MM-DD>
CFP start date: <YYYY-MM-DD HH:MM:SS>
Activate the event [n]: <y|n>

Running the site locally

The SERVER_NAME environment variable must be set to develop locally. Because of how web browsers treat cookies on domains, this value must have a . in it. Before launching a development server:

$ export SERVER_NAME=pygotham.local:5000

Now you're ready to start your PyGotham server:

$ python wsgi.py

You should see the PyGotham site at:

http://<slug>.$SERVER_NAME

where <slug> is the slug of the event created by the create_event management command.

Note

If you're using Docker, Compose will take care of running the site for you.

Adding requirements

New requirements should be added to requirements.in. An updated requirements.txt can be generated using:

$ pip-compile requirements.in

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.