Giter VIP home page Giter VIP logo

xisbn_project's Introduction

overview

Template runserver and passenger-compatible django project.


todo checklist

(eventually pieces of this could be scripted)

  • assumes python 3.6.x

  • main

    • make 'stuff' dir

    • make env

        /path/to/python3 -m venv /path/to/project_x_stuff/env_x
      
      • source new env, and run: pip install --upgrade pip
    • git clone existing app, or...

      • git clone https://github.com/birkin/xisbn_project.git ./project_x
        • remove the .git/ dir
      • set up in SourceTree (git init)
      • push to GitHub
    • make sublime project

    • update names

      • change all xisbn_project references to name of project
      • change all xisbn_app references to actual name of app
      • include in above xisbn_app and xisbn_app_templates directories
      • change all XISBN__ settings references to name of project-settings prefix
    • with new env activated, pip update it from requirements.txt

      • note that version of Django is partially specified -- this is the latest long-term-support version
      • update requirements.txt with versions
      • suggested: pip install ipython -- it'll make experimentation lots easier
  • log

    • make log dir, ensuring permissions are correct
    • touch a project_x.log file, and update 'owner/group', and update group-permissions
      • note, if setting up on a production-server, make the owner the apache user, and the group the shared-group
    • add log to system's logrotate
    • add dir to sublime project
    • Note: initial run may create an empty logfile with an incorrect owner, causing an error. If this happens, simply update the owner -- the subsequent system's logrotate will ensure the log-file's permissions remain correct.
  • settings

    • make settings dir and .sh file

    • update env/bin/activate.py in two areas:

      • add this to the last line of the deactivate function...

          unset $(env | grep PREFIX__ | cut -d= -f1 | xargs)
        

        (this will remove any application-specific env-vars when the virtual-environment is deactivated or re-sourced)

      • add this to the end of the activate file...

          export PREFIX__SETTINGS_PATH="/path/to/project_env_settings.sh"
          source $PREFIX__SETTINGS_PATH
        

        (this sets an env-var needed by passenger_wsgi.py)

      • notes...

        • substitute the app-specific env-var prefix for PREFIX__ above
        • be sure the exported-path env-var matches the environmental-variable accessed by the ENV_SETTINGS_FILE entry in config/passenger_wsgi.py
    • add dir to sublime project

    • add needed items along the way; eg, in django:

      • one way to see what needs set: source the environment and run python ./manage.py check
      • new secret-key (helpful code)
      • db if needed
      • project's django_media directory
  • update

    • add git-pull script (w/set-permissions) & run it
    • once this works, source the env and try a python ./manage.py check
  • other

    • webapp
      • create db if necessary

        • django:
          • run python ./manage.py makemigrations --empty name_of_app to initialize stuff
          • run python ./manage.py makemigrations --dry-run to see what will be done with the real command
          • run python ./manage.py makemigrations
          • run python ./manage.py migrate to actually create tables
            • if expected tables aren't created, may need to run python ./manage.py migrate --run-syncdb
          • run python ./manage.py createsuperuser for the admin user prompt
      • django:

        • test with python ./manage.py check and then...

        • python ./manage.py runserver host:port, and hit host/port with browser or curl

        • add session-clearance crontab entry in format:

            random_minute 01 * * * cd /path/to/project_stuff/project/; source ../env_prj/bin/activate > /dev/null; ../env_prj/bin/python ./manage.py clearsessions
          
      • https-ify project & shib-ify admin & login urls

      • setup apache handoff to python

      • restart apache if web-app

    • site-checker entry
    • software-tracker entry
    • cron work if necessary (besides possible django session work listed above)
      • update crontab via (one-line):

          cd /to/main/dir; source ../env/bin/activate; ../env/bin/python ./the_script.py
        

other


xisbn_project's People

Contributors

birkin avatar

Watchers

James Cloos 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.