bucket
Setup for Windows
- Make sure you have installed Python 3.6 or newer, make sure you have the right one (32/64 bits). Source. During installation please pay attention to the following details :
- Tick/Select Add Python 3.6 to PATH
- Select Customize Installation (this is important)
- Tick/Select pip (others, leave as default), this is important
- Tick install for all users
- Tick add Python to environment variables
- Tick create shortcuts for installed applications
- Precomplie standard libary
- Select install location and hit install
-
Run
pip install virtualenv
using windows command line -
You would have to install PostgreSQL. Download from official location or alternative location, you could lookup some PostgreSQL tutorials online if you are completely blank on this.
-
Fork and clone the repo, and cd into the
bucket
directory. Use git CMD or git Bash(unix-like terminal) to do so. -
Create a virtual environment with Python 3 and install dependencies, using CMD :
$ virtualenv venv $ ./venv/Scripts/activate $ pip install -r requirements.txt
-
Create
bucketdb
database, wherebucketdb
might be any suitable name.
-
Open the SQL Shell for postgresql from the windows start menu or wherever accessible
$ Server [localhost]: Just press enter, leave this empty $ Database [postgres]: Just press enter, leave this empty $ Port [5432]: This is the default port just press enter, leave this empty $ Username [postgres]: This is the default username just press enter, leave this empty $ Password for user postgres: Input password you created during installation and press enter $ CREATE USER <anyname you want e.g bucket> WITH PASSWORD 'your password'; $ CREATE DATABASE bucketdb; $ \c bucketdb; $ GRANT ALL PRIVILEGES ON bucketdb TO <username created above>;
- Fill in the database details in
bucket/bucket/settings/dev.py
. - Run
git update-index --assume-unchanged bucket/manage.py bucket/bucket/wsgi.py
. Inmanage.py
andwsgi.py
change'bucket.settings.production'
to'bucket.settings.dev'
. - Run
set SECRET_KEY=foobarbaz
in your terminal, ideally the secret key should be 40 characters long, unique and unpredictable. - You will need a TMDB API key, which you can register and get from here. Run
set TMDB_API_KEY=apikey
in your terminal. - Add both the keys to your virtualenv's activate file.
- Run
python bucket/manage.py migrate
. - Run
python bucket/manage.py createsuperuser
to create a superuser for the admin panel. Fill in the details asked. - Run
python bucket/manage.py runserver
to start the development server. When in testing or production, feed the respective settings file from the command line, e.g. for testingpython bucket/manage.py runserver --settings=bucket.settings.testing
. - Run
python bucket/manage.py test --settings=bucket.settings.testing
to run all the tests.