GithubHelp home page GithubHelp logo

frankyang0529 / pycon.tw Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pycontw/pycon.tw

0.0 2.0 0.0 30.08 MB

PyCon TW official website

Home Page: https://tw.pycon.org/

License: MIT License

Python 26.35% CSS 21.05% JavaScript 2.26% HTML 50.08% Shell 0.08% Dockerfile 0.17%

pycon.tw's Introduction

codecov.io travis-ci status

PyCon TW

This repository serves the website of PyCon TW, Python Conference Taiwan. This project is open source and the license can be found in LICENSE.

Getting Started

Requirements

  • Git 1.8+
  • Python 3.6.x
  • Yarn 1.0+
  • Node.js 8.0+

Set up a Virtual Environment

Database - Docker (Optional)

Write database password in .env:

POSTGRES_PASSWORD=somepassword

Define .env location in docker-compose-dev.yml under the corresponding database service:

services:
  db:
    image: postgres:11-alpine
    env_file:
      - .env

Create and start the database for development:

docker-compose -f docker-compose-dev.yml up

Python - Built-in venv

Create your virtual environment:

python3 -m venv venv

And enable it:

. venv/bin/activate

Python - virtualenvwrapper

You need to specify your python path when creating the virtual environment:

mkvirtualenv --python=$(which python3) pycontw2016

Node.js - nvm

Switch to version specified in .nvmrc:

nvm use

Install Dependencies

Use pip to install Python depedencies:

pip install -r requirements.txt

Use Yarn to install Node dependencies:

yarn install --dev

Set up Local Environment Variables and Database

Settings are stored in environment variables via django-environ. The quickest way to start is to copy local.sample.env into local.env:

cp src/pycontw2016/settings/local.sample.env src/pycontw2016/settings/local.env

Then edit the SECRET_KEY line in local.env, replacing {{ secret_key }} into any Django Secret Key value. An example:

SECRET_KEY=twvg)o_=u&@6^*cbi9nfswwh=(&hd$bhxh9iq&h-kn-pff0&&3

If you’re using a database for the first time, create a database named pycontw2016 owned by the database user specified in the env file:

Enter pycontw_db_1 container

docker exec -it pycontw_db_1 psql -U postgres
# Replace "postgres" with your specified role.
CREATE DATABASE pycontw2016 with owner = postgres;

After that, just run the migration.

Get Ready for Development

cd into the src directory:

cd src

DB Connection

Default is sqlite3, you can change to connect postgres. Copy local.sample.env and change its parameters to your personal setting.

cp pycontw2016/settings/local.sample.env pycontw2016/settings/local.env

The format of local.env will be used by django-environ so you may refer to https://github.com/joke2k/django-environ for more details.

And migrate the database:

python manage.py migrate

Create Super User

python manage.py createsuperuser

Compile localized translation

python manage.py compilemessages

Now you’re all set!

Run the Development Server

python manage.py runserver

Run Tests

Tests are managed with pytest-django. You have two options to run tests, either with the local environment, or in an isolated one via Tox.

Testing in the Local Environment

Run the following command inside src:

pytest

To run tests with coverage report:

pytest --cov=.

Testing with Tox

Run the following inside the top-level directory (the one with tox.ini):

tox

How to Contribute

Follow the GitHub Flow, please DO NOT push the commits into master directly. Always create branch by the feature you want to update. You are encouraged to submit a pull request for reviewing before merging things into master.

We strongly recommend you configure your editor to match our coding styles. You can do this manually, or use an EditorConfig plugin if your editor supports it. An .editorconfig file has already been attached to the repository.

Deployment

For site administrators, please refer to contrib/DEPLOY.md.

pycon.tw's People

Contributors

adrianliaw avatar bill0812 avatar ccc-larc avatar ccwang002 avatar chairco avatar daikeren avatar flywindy avatar frankyang0529 avatar gtbcoding avatar hsiaoyi0504 avatar jackklpan avatar jneo8 avatar josix avatar keitheis avatar l34marr avatar lee-w avatar linmic avatar madrex2000 avatar maliaotw avatar mattwang44 avatar note35 avatar peihsuan avatar shunghsiyu avatar starwilly avatar tai271828 avatar timtan avatar uranusjr avatar yaoyy16 avatar yuhow avatar yychen avatar

Watchers

 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.