Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khilnani/template-django
Postgres, RabbitMQ, Memcached, Django & Docker template
https://github.com/khilnani/template-django
celery django docker postgresql python rabbitmq scaffolding template ubuntu
Last synced: 4 days ago
JSON representation
Postgres, RabbitMQ, Memcached, Django & Docker template
- Host: GitHub
- URL: https://github.com/khilnani/template-django
- Owner: khilnani
- License: gpl-3.0
- Created: 2014-09-14T22:12:25.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-11-23T19:33:53.000Z (about 6 years ago)
- Last Synced: 2024-12-02T22:13:16.739Z (2 months ago)
- Topics: celery, django, docker, postgresql, python, rabbitmq, scaffolding, template, ubuntu
- Language: Python
- Homepage:
- Size: 107 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
To use this Template:
- Install Django - `pip install Django==1.10.3 --upgrade`
- Generate the project from the template
- Creates a new directory
- Replace `project_name`
```
PROJECT_NAME="project_name"; mkdir $PROJECT_NAME && django-admin startproject $PROJECT_NAME $PROJECT_NAME --template=https://github.com/khilnani/template-django/zipball/master --extension=py,md,yml,ini,sh --name=Makefile,.coveragerc,.gitignore
```- Manual / Ubuntu
- Ubuntu dependencies:
- Run - `apt-get install -y build-essential libpq-dev python-dev postgresql-server-dev-all`
- Initialize the project
- Create Virtual Env and install dependencies
- Run - `make init`
- Switch to Virtual Env - `workon {{ project_name }}`
- Update settings:
- Services:
- Requires a running RabbitMQ, Postgres and Memcached service
- Docker
- Use docker compose to start up needed services and python dependencies already setup
- `docker-compose up`
- Check the `Makefile` for docker specific shortcuts for psql, ssh into containers etc.
- Setup DB
- Update DB schema - `make migrate`
- Admin user setup - `make admin`
- Run the App
- Common:
- Start Celery worker - `make worker`
- Start Celery schedular - `make beat`
- Export `ENV=development` or `ENV=production`
- Export `PORT=8080`
- Development:
- `make run`
- Production:
- Collect static files - `make static`
- Start - `make start`
- Stop - `make stop`
- Urls
- Admin
- http://127.0.0.1:8080/admin/ - Use user/pass created earlier
- http://127.0.0.1:8080/swagger/ - API browser
- Apis
- http://127.0.0.1:8080/api/detail/ - Mock, No Auth
- http://127.0.0.1:8080/api/list/ - Mock, with Token Auth created in the Admin
- http://127.0.0.1:8080/api/task/ - Run a task
- http://127.0.0.1:8080/api/task/ID - Fetch the task result