Giter VIP home page Giter VIP logo

texaslan.org's Introduction

texaslan.org

MIT Licensed

The main online hub for Texas LAN, built with Django. This project is heavily based on this project here

  • User system
  • Event system with QR code check-in
  • URL shortener
  • Admin panel
  • Information about LAN

Development

Local Deployment

Docker Compose will handle it for you.

docker-compose up

This will spin up a database container, apply migrations to the database, load test data, and run the application.

Development operations

Running operations on the Django application. Use this for importing fixtures, or any administrative tasks afforded by manage.py.

$ docker exec -it texaslan_web_1 bash

Running SQL operations on the Postgres instance, such as querying, updating, and deleting rows in the database.

$ docker exec -it texaslan_db_1 bash
$ su - postgres
$ psql

All included test users have the password password.

Running Tests

Run

py.test

Checking Coverage

To run the tests, check your test coverage, and generate an HTML coverage report

coverage run manage.py test
coverage html
open htmlcov/index.html

Manually manipulating data

To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. In the local environment, check your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.

To mark an existing account as superuser and staff

psql texaslan
texaslan# UPDATE users_user SET is_superuser = true AND is_staff = true WHERE id = 1;

Server Deployment

First time

Ensure that Python 3.5 and Postgres are installed, then run the below.

git clone [email protected]:texaslan/texaslan.org.git
pip3 install -r requirements/production.txt
npm install
npm install --global gulp-cli
createdb texaslan
python3 manage.py migrate

Install a Django stack on a DigitalOcean Droplet. You will need more than the base droplet as 512Mb of RAM is too little to install everything.

Get SSL certificates from Let's Encrypt, and configure Nginx to serve them. You can follow this tutorial on how to implement this on this Django stack.

Rename config.template.json to config.json in config/settings. The Django key should be a unique 50 character key. You can generate a new key here: http://www.miniwebtool.com/django-secret-key-generator/. Make sure that you generate or retrieve the other keys as well.

Updates

The LAN server is configured with an updatelan command, which is an alias for the below.

# Update and use master ( not pull, to enforce using whatever is on master )
git fetch
git reset --hard origin/master

# update pip & python packages
pip3 install --upgrade pip
pip3 install -r requirements/production.txt

# update nodejs packages
npm install

# migrate database changes
python3 manage.py migrate

# Update sass and js files
gulp

# Gather all static files and update them
python3 manage.py collectstatic --noinput

# Restart server with new code::
sudo systemctl restart gunicorn && sudo systemctl restart nginx

texaslan.org's People

Contributors

addykim avatar drewromanyk avatar hsmeans avatar ianmobbs avatar mothers-head avatar siweimao avatar stevendiaz avatar texaslan-buildbot avatar thomasgaubert avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

texaslan.org's Issues

Improvements with local environment setup

I'm currently trying to set up the Django app on my local machine. I'm going to use this issue to write down and issues I have and add any suggestions for clarifications on the setup instructions.

  • Update requirements to have psycopg2>=2.7 . I ran into this issue, which was fixed in 2.7. There doesn't seem to be any move to backport the fix.
  • Make this virtualenv friendly. Currently does not work because $ gulp depends on python pointing to python 2, but python3 is needed to run the app.

Logged in user rush application bug

When viewing an application of a new user, the user name displayed in the top right becomes the name of the applicant rather than the name of the user who is viewing the application

Simplify sign up form

I'm suggesting the following changes to the sign up form

  1. Remove gender field
  2. Make username = email
  3. Remove username field
  4. Remove nick name
  5. Add first + last name (requires migration + script in production)

Improve & revamp our testing

py.test doesn't work on a fresh install and it leads to confusing errors. I'd suggest fixing it or replacing it completely.

Remove rush application and voting from menu when not in use

Right now clicking on rush applications or voting on the top menu bar will lead to a page that says something along the lines of "voting is closed" or "applications are not open". I think we can just leave those off the menu unless voting or rush is actually in session.

Email template

Add branded email template to make things look nicer.

See: Omega's implementation of email

Email myself option

Replace webmaster test with "email self" option to allow any officer to test emails.

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.