Coder Social home page Coder Social logo

metakermit / generator-django-rest Goto Github PK

View Code? Open in Web Editor NEW
84.0 8.0 19.0 680 KB

Yeoman generator for a Django REST/GraphQL API, an optional React SPA & lots more!

License: MIT License

JavaScript 14.41% Python 59.49% Shell 20.24% HTML 5.42% Dockerfile 0.44%
yeoman yeoman-generator django django-rest-framework react create-react-app heroku monorepo

generator-django-rest's Introduction

generator-django-rest npm Build Status GitHub license Updates

A Yeoman generator for easily bootstrapping a Django REST API with some common settings and quickly deployable to Heroku/Dokku. Check out this quick screencast showing you how to deploy a full-fledged Django REST API to Heroku in 5 minutes:

asciicast

The goal is to keep you efficient and include features you need in a typical modern web app, yet keeps things simple and not too bloated. You can see an example generated Django project here. For some background on how and why the project was created, read this article.

Note: the project is still considered to be in beta until I get a chance to test it on more apps. That said, I am using it in my own projects :)

Features

Some of the cool features that come with generator-django-rest are:

  • ๐Ÿš€ quick to launch โ€“ start a new project and deploy it to Heroku in 3 commands:

    yo django-rest
    ./scripts/install.sh
    ./scripts/deploy.sh
  • โšก๏ธ productive โ€“ start the Django, DB & optionally frontend dev servers easily

    ./scripts/start.sh
  • ๐Ÿณ Docker support โ€“ get a complete environment with Django, Postgres & Redis in a single command:

    docker-compose up
  • ๐Ÿฆ„ modern JS โ€“ serve static files on / using django-spa for nice single-page apps using React / Angular / Vueโ€ฆ

  • โš›๏ธ GraphQL โ€“ interactive API with filtering and nested queries using Graphene

  • โ›ต๏ธ monorepo - option to automatically set up a create-react-app frontend for you in the same git repo with everything integrated under the mantra one app, one repo, one dyno

  • ๐Ÿ“ฆ Heroku-friendly packaging โ€“ if you're using the built-in React frontend, deploy.sh minifies the frontend and packages it up with Django into a separate prod branch ready for deployment as a Django web app (that gets deployed to Heroku by default)

  • ๐Ÿฃ Dokku support โ€“ quick to deploy to Dokku, a DIY alternative to Heroku

  • ๐Ÿค“ 12-factor config โ€“ environment variable configuration using django-environ

    • define a variable in .env for dev e.g. REDIS_URL=redis://localhost:6379/0
    • use it in settings.py, e.g. CELERY_RESULT_BACKEND = env('REDIS_URL')
    • set variables on the prod server (just worksโ„ข with Redis on Heroku)
  • ๐Ÿ”‹ batteries included

    • Celery with a Redis backend โ€“ cause you'll need an async task queue
    • Backblaze B2 media file storage backend (optional)
  • ๐Ÿ“œ sane logging โ€“ defaults to fail nicely

  • ๐Ÿถ familiar โ€“ check out the rough project file layout, it's much like django-admin startproject myproject would set it up (only repeats the project name twice, i.e. ~/code/myproject/myproject/settigns.py). An example generated app is published as metakermit/hellodjango.

See CHANGELOG.md for a full release history with all the features.

Getting Started

To begin, you need to install node.js. Once you have that, you need Yeoman pre-installed. Yeoman lives in the npm package repository. You only have to ask for him once, then he packs up and moves into your hard drive.

npm install -g yo

Then, we need the django-rest generator, i.e. plug-in. You install generator-django-rest from npm.

npm install -g generator-django-rest

Finally, for every new project you would initiate the generator in an empty folder.

mkdir myproject
cd myproject
yo django-rest

Now check the HACKING.md file in the generated code project for extra instructions (generated from this template if you're curious).

Contributing

If you have some ideas for contributions, suggestions are always welcome. Note, however, that the goal of the project is to stay minimalist, so we'll try to keep the number of dependencies small.

As a reminder to myself, I release a new version of generator-django-rest by running:

npm run release:patch # or :minor or :major
npm publish

License

MIT

generator-django-rest's People

Contributors

demonno avatar dependabot[bot] avatar metakermit avatar ohld avatar pyup-bot avatar zbyte64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-django-rest's Issues

Error on docker-compose

i get this error when run docker-compose up!

`Creating network "myproject_default" with the default driver
Building worker
Step 1/3 : FROM kennethreitz/pipenv

Executing 3 build triggers

ERROR: Service 'worker' failed to build : COPY failed: stat /var/lib/docker/tmp/docker-builder695948829/Pipfile.lock: no such file or directory`

Broken project? celery

I would really like to use this project as a foundation but am bashing my head against the wall getting this and a clone of the demo repository running. Here are the steps I performed verbatim with a fresh setup:

โ•ฐโ”€ mkdir foo

โ•ญโ”€ ๏…น ๎‚ฐ ๏ผ โ€ฆ/code/projects ๎‚ฐ
โ•ฐโ”€ cd foo

โ•ญโ”€ ๏…น ๎‚ฐ ๏ผ โ€ฆ/projects/foo ๎‚ฐ
โ•ฐโ”€ yo django-rest

     _-----_     โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
    |       |    โ”‚    Mess with the best,   โ”‚
    |--(o)--|    โ”‚   Django likes REST...   โ”‚
   `---------ยด   โ”‚          Yeah...         โ”‚
    ( _ยดU`_ )    โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
    /___A___\   /
     |  ~  |
   __'.___.'__
 ยด   `  |ยฐ ยด Y `

? What is the name of your project? foo
? You want a create-react-app frontend that compiles to a separate prod branch? No
? Optionally give us the git remote url of your repo:
? ...and if you want to deploy to Heroku, the Heroku git url too:
   create docker-compose.yml
   create Dockerfile
   create HACKING.md
   create manage.py
   create Pipfile
   create Pipfile.lock
   create Procfile
   create Procfile.dev.example
   create README.md
   create scripts/deploy.sh
   create scripts/dev.sh
   create scripts/setup.sh
   create scripts/util/check-os-deps.sh
   create scripts/util/env.sh
   create scripts/util/install.sh
   create scripts/util/prod-commit.sh
   create scripts/util/prod-gitignore
   create scripts/util/prod-package.sh
   create scripts/util/prod-prepare.sh
   create scripts/util/setup-custom.sh
   create foo/__init__.py
   create foo/celery.py
   create foo/gunicorn.conf.py
   create foo/logger.py
   create foo/middleware.py
   create foo/schema.py
   create foo/settings.py
   create foo/tests.py
   create foo/urls.py
   create foo/wsgi.py
   create foo/static/index.html
   create .dockerignore
   create .editorconfig
   create .env.example
   create .npmignore

โ•ญโ”€ ๏…น ๎‚ฐ ๏ผ โ€ฆ/projects/foo ๎‚ฐ
โ•ฐโ”€ ./scripts/setup.sh
* creating initial .env file
* install dev requirements
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing dependencies from Pipfile.lock (a74bd1)โ€ฆ
  ๐Ÿ   โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰ 71/71 โ€” 00:00:08
* creating initial Procfile.dev file
* initialising the DB
The files belonging to this database system will be owned by user "wylesj".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory tmp/postgres ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    pg_ctl -D tmp/postgres -l logfile start

2019-05-25 01:05:30.623 PDT [19642] LOG:  listening on IPv6 address "::1", port 5433
2019-05-25 01:05:30.623 PDT [19642] LOG:  listening on IPv4 address "127.0.0.1", port 5433
2019-05-25 01:05:30.623 PDT [19642] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5433"
2019-05-25 01:05:30.637 PDT [19644] LOG:  database system was shut down at 2019-05-25 01:05:30 PDT
2019-05-25 01:05:30.640 PDT [19642] LOG:  database system is ready to accept connections
CREATE ROLE
CREATE DATABASE
Loading .env environment variablesโ€ฆ
Warning: There was an unexpected error while activating your virtualenv. Continuing anyway...
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying sessions.0001_initial... OK
* DB ready
2019-05-25 01:05:38.456 PDT [19642] LOG:  received smart shutdown request
* frontend already linked
2019-05-25 01:05:38.457 PDT [19642] LOG:  background worker "logical replication launcher" (PID 19650) exited with exit code 1
2019-05-25 01:05:38.457 PDT [19645] LOG:  shutting down
* git repo detected, won't commit anything automatically
* DONE :)
2019-05-25 01:05:38.492 PDT [19642] LOG:  database system is shut down

โ•ญโ”€ ๏…น ๎‚ฐ ๏ผ โ€ฆ/projects/foo ๎‚ฐ
โ•ฐโ”€ docker-compose up
Creating network "foo_default" with the default driver
Building worker
Step 1/10 : FROM python:3.7
 ---> a4cc999cf2aa
Step 2/10 : ENV PIPENV_VENV_IN_PROJECT=1
 ---> Using cache
 ---> 9a6f935e8684
Step 3/10 : ENV PYTHONUNBUFFERED 1
 ---> Using cache
 ---> bb6e66a2a84c
Step 4/10 : RUN mkdir /code
 ---> Using cache
 ---> 79eed3bae9bc
Step 5/10 : WORKDIR /code
 ---> Using cache
 ---> 3ef30f14be2f
Step 6/10 : RUN pip install pipenv
 ---> Using cache
 ---> ed8d6a40d378
Step 7/10 : COPY Pipfile Pipfile
 ---> 7839a9e8e53b
Step 8/10 : COPY Pipfile.lock Pipfile.lock
 ---> 358cc4ef746b
Step 9/10 : RUN pipenv install --system --dev
 ---> Running in d9cdd9bf2375
Installing dependencies from Pipfile.lock (a74bd1)โ€ฆ
Ignoring appnope: markers 'sys_platform == "darwin"' don't match your environment
Looking in indexes: https://pypi.python.org/simple
Removing intermediate container d9cdd9bf2375
 ---> 0c03af0c3dcd
Step 10/10 : COPY . /code
 ---> fe8de0db8048
Successfully built fe8de0db8048
Successfully tagged foo:latest
WARNING: Image for service worker was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating foo_db_1    ... done
Creating foo_cache_1 ... done
Creating foo_worker_1 ... done
Creating foo_cli_1    ... done
Creating foo_web_1    ... done
Attaching to foo_db_1, foo_cache_1, foo_worker_1, foo_web_1, foo_cli_1
db_1      | The files belonging to this database system will be owned by user "postgres".
db_1      | This user must also own the server process.
db_1      |
db_1      | The database cluster will be initialized with locale "en_US.utf8".
db_1      | The default database encoding has accordingly been set to "UTF8".
db_1      | The default text search configuration will be set to "english".
db_1      |
db_1      | Data page checksums are disabled.
cache_1   | 1:C 25 May 2019 08:06:57.441 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
cache_1   | 1:C 25 May 2019 08:06:57.441 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
cache_1   | 1:C 25 May 2019 08:06:57.441 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
db_1      |
cache_1   | 1:M 25 May 2019 08:06:57.442 * Running mode=standalone, port=6379.
cache_1   | 1:M 25 May 2019 08:06:57.442 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
cache_1   | 1:M 25 May 2019 08:06:57.442 # Server initialized
cache_1   | 1:M 25 May 2019 08:06:57.443 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
worker_1  | Traceback (most recent call last):
worker_1  |   File "/usr/local/bin/celery", line 6, in <module>
db_1      | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_1      | creating subdirectories ... ok
cache_1   | 1:M 25 May 2019 08:06:57.443 * Ready to accept connections
db_1      | selecting default max_connections ... 100
db_1      | selecting default shared_buffers ... 128MB
db_1      | selecting dynamic shared memory implementation ... posix
worker_1  |     from pkg_resources import load_entry_point
worker_1  |   File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3241, in <module>
db_1      | creating configuration files ... ok
db_1      | running bootstrap script ... ok
db_1      | performing post-bootstrap initialization ... ok
worker_1  |     @_call_aside
worker_1  |   File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3225, in _call_aside
worker_1  |     f(*args, **kwargs)
worker_1  |   File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
worker_1  |     working_set = WorkingSet._build_master()
worker_1  |   File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
worker_1  |     ws.require(__requires__)
worker_1  |   File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
worker_1  |     needed = self.resolve(parse_requirements(requirements))
worker_1  |   File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
worker_1  |     raise DistributionNotFound(req, requirers)
worker_1  | pkg_resources.DistributionNotFound: The 'celery' distribution was not found and is required by the application
db_1      | syncing data to disk ... ok
db_1      |
db_1      | Success. You can now start the database server using:
db_1      |
db_1      |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1      |
db_1      |
db_1      | WARNING: enabling "trust" authentication for local connections
db_1      | You can change this by editing pg_hba.conf or using the option -A, or
db_1      | --auth-local and --auth-host, the next time you run initdb.
db_1      | waiting for server to start....2019-05-25 08:06:58.631 UTC [43] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
cli_1     | Traceback (most recent call last):
cli_1     |   File "manage.py", line 15, in <module>
cli_1     |     execute_from_command_line(sys.argv)
cli_1     |   File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
cli_1     |     utility.execute()
cli_1     |   File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 317, in execute
cli_1     |     settings.INSTALLED_APPS
cli_1     |   File "/usr/local/lib/python3.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
cli_1     |     self._setup(name)
cli_1     |   File "/usr/local/lib/python3.7/site-packages/django/conf/__init__.py", line 43, in _setup
cli_1     |     self._wrapped = Settings(settings_module)
cli_1     |   File "/usr/local/lib/python3.7/site-packages/django/conf/__init__.py", line 106, in __init__
cli_1     |     mod = importlib.import_module(self.SETTINGS_MODULE)
cli_1     |   File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
cli_1     |     return _bootstrap._gcd_import(name[level:], package, level)
cli_1     |   File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
cli_1     |   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
cli_1     |   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
cli_1     |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
cli_1     |   File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
cli_1     |   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
cli_1     |   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
cli_1     |   File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
cli_1     |   File "<frozen importlib._bootstrap_external>", line 728, in exec_module
cli_1     |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
cli_1     |   File "/code/foo/__init__.py", line 5, in <module>
cli_1     |     from .celery import app as celery_app
cli_1     |   File "/code/foo/celery.py", line 3, in <module>
cli_1     |     from celery import Celery
cli_1     | ModuleNotFoundError: No module named 'celery'
web_1     | [2019-05-25 08:06:58 +0000] [1] [INFO] Starting gunicorn 19.9.0
web_1     | [2019-05-25 08:06:58 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
web_1     | [2019-05-25 08:06:58 +0000] [1] [INFO] Using worker: sync
web_1     | [2019-05-25 08:06:58 +0000] [9] [INFO] Booting worker with pid: 9
web_1     | [2019-05-25 08:06:58 +0000] [9] [ERROR] Exception in worker process
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
web_1     |     worker.init_process()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
web_1     |     self.load_wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
web_1     |     self.wsgi = self.app.wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
web_1     |     self.callable = self.load()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
web_1     |     return self.load_wsgiapp()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
web_1     |     return util.import_app(self.app_uri)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
web_1     |     __import__(module)
web_1     |   File "/code/foo/__init__.py", line 5, in <module>
web_1     |     from .celery import app as celery_app
web_1     |   File "/code/foo/celery.py", line 3, in <module>
web_1     |     from celery import Celery
web_1     | ModuleNotFoundError: No module named 'celery'
web_1     | [2019-05-25 08:06:58 +0000] [9] [INFO] Worker exiting (pid: 9)
db_1      | 2019-05-25 08:06:58.762 UTC [44] LOG:  database system was shut down at 2019-05-25 08:06:58 UTC
db_1      | 2019-05-25 08:06:58.768 UTC [43] LOG:  database system is ready to accept connections
web_1     | [2019-05-25 08:06:58 +0000] [1] [INFO] Shutting down: Master
web_1     | [2019-05-25 08:06:58 +0000] [1] [INFO] Reason: Worker failed to boot.
db_1      |  done
db_1      | server started
db_1      |
db_1      | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db_1      |
db_1      | waiting for server to shut down...2019-05-25 08:06:58.821 UTC [43] LOG:  received fast shutdown request
db_1      | .2019-05-25 08:06:58.824 UTC [43] LOG:  aborting any active transactions
db_1      | 2019-05-25 08:06:58.826 UTC [43] LOG:  background worker "logical replication launcher" (PID 50) exited with exit code 1
db_1      | 2019-05-25 08:06:58.827 UTC [45] LOG:  shutting down
db_1      | 2019-05-25 08:06:58.840 UTC [43] LOG:  database system is shut down
db_1      |  done
db_1      | server stopped
db_1      |
db_1      | PostgreSQL init process complete; ready for start up.
db_1      |
foo_worker_1 exited with code 1
db_1      | 2019-05-25 08:06:59.012 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1      | 2019-05-25 08:06:59.012 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1      | 2019-05-25 08:06:59.016 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1      | 2019-05-25 08:06:59.187 UTC [52] LOG:  database system was shut down at 2019-05-25 08:06:58 UTC
db_1      | 2019-05-25 08:06:59.193 UTC [1] LOG:  database system is ready to accept connections
foo_cli_1 exited with code 1
web_1     | [2019-05-25 08:07:01 +0000] [1] [INFO] Starting gunicorn 19.9.0
web_1     | [2019-05-25 08:07:01 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
web_1     | [2019-05-25 08:07:01 +0000] [1] [INFO] Using worker: sync
web_1     | [2019-05-25 08:07:01 +0000] [9] [INFO] Booting worker with pid: 9
web_1     | [2019-05-25 08:07:01 +0000] [9] [ERROR] Exception in worker process
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
web_1     |     worker.init_process()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
web_1     |     self.load_wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
web_1     |     self.wsgi = self.app.wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
web_1     |     self.callable = self.load()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
web_1     |     return self.load_wsgiapp()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
web_1     |     return util.import_app(self.app_uri)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
web_1     |     __import__(module)
web_1     |   File "/code/foo/__init__.py", line 5, in <module>
web_1     |     from .celery import app as celery_app
web_1     |   File "/code/foo/celery.py", line 3, in <module>
web_1     |     from celery import Celery
web_1     | ModuleNotFoundError: No module named 'celery'
web_1     | [2019-05-25 08:07:01 +0000] [9] [INFO] Worker exiting (pid: 9)
web_1     | [2019-05-25 08:07:01 +0000] [1] [INFO] Shutting down: Master
web_1     | [2019-05-25 08:07:01 +0000] [1] [INFO] Reason: Worker failed to boot.
foo_web_1 exited with code 3
web_1     | [2019-05-25 08:07:02 +0000] [1] [INFO] Starting gunicorn 19.9.0
web_1     | [2019-05-25 08:07:02 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
web_1     | [2019-05-25 08:07:02 +0000] [1] [INFO] Using worker: sync
web_1     | [2019-05-25 08:07:02 +0000] [9] [INFO] Booting worker with pid: 9
web_1     | [2019-05-25 08:07:02 +0000] [9] [ERROR] Exception in worker process
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
web_1     |     worker.init_process()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
web_1     |     self.load_wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
web_1     |     self.wsgi = self.app.wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
web_1     |     self.callable = self.load()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
web_1     |     return self.load_wsgiapp()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
web_1     |     return util.import_app(self.app_uri)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
web_1     |     __import__(module)
web_1     |   File "/code/foo/__init__.py", line 5, in <module>
web_1     |     from .celery import app as celery_app
web_1     |   File "/code/foo/celery.py", line 3, in <module>
web_1     |     from celery import Celery
web_1     | ModuleNotFoundError: No module named 'celery'
web_1     | [2019-05-25 08:07:02 +0000] [9] [INFO] Worker exiting (pid: 9)
web_1     | [2019-05-25 08:07:02 +0000] [1] [INFO] Shutting down: Master
web_1     | [2019-05-25 08:07:02 +0000] [1] [INFO] Reason: Worker failed to boot.
foo_web_1 exited with code 3
web_1     | [2019-05-25 08:07:05 +0000] [1] [INFO] Starting gunicorn 19.9.0
web_1     | [2019-05-25 08:07:05 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
web_1     | [2019-05-25 08:07:05 +0000] [1] [INFO] Using worker: sync
web_1     | [2019-05-25 08:07:05 +0000] [8] [INFO] Booting worker with pid: 8
web_1     | [2019-05-25 08:07:05 +0000] [8] [ERROR] Exception in worker process
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
web_1     |     worker.init_process()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
web_1     |     self.load_wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
web_1     |     self.wsgi = self.app.wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
web_1     |     self.callable = self.load()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
web_1     |     return self.load_wsgiapp()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
web_1     |     return util.import_app(self.app_uri)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
web_1     |     __import__(module)
web_1     |   File "/code/foo/__init__.py", line 5, in <module>
web_1     |     from .celery import app as celery_app
web_1     |   File "/code/foo/celery.py", line 3, in <module>
web_1     |     from celery import Celery
web_1     | ModuleNotFoundError: No module named 'celery'
web_1     | [2019-05-25 08:07:05 +0000] [8] [INFO] Worker exiting (pid: 8)
web_1     | [2019-05-25 08:07:05 +0000] [1] [INFO] Shutting down: Master
web_1     | [2019-05-25 08:07:05 +0000] [1] [INFO] Reason: Worker failed to boot.
foo_web_1 exited with code 3
web_1     | [2019-05-25 08:07:07 +0000] [1] [INFO] Starting gunicorn 19.9.0
web_1     | [2019-05-25 08:07:07 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
web_1     | [2019-05-25 08:07:07 +0000] [1] [INFO] Using worker: sync
web_1     | [2019-05-25 08:07:07 +0000] [8] [INFO] Booting worker with pid: 8
web_1     | [2019-05-25 08:07:07 +0000] [8] [ERROR] Exception in worker process
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
web_1     |     worker.init_process()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
web_1     |     self.load_wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
web_1     |     self.wsgi = self.app.wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
web_1     |     self.callable = self.load()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
web_1     |     return self.load_wsgiapp()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
web_1     |     return util.import_app(self.app_uri)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
web_1     |     __import__(module)
web_1     |   File "/code/foo/__init__.py", line 5, in <module>
web_1     |     from .celery import app as celery_app
web_1     |   File "/code/foo/celery.py", line 3, in <module>
web_1     |     from celery import Celery
web_1     | ModuleNotFoundError: No module named 'celery'
web_1     | [2019-05-25 08:07:07 +0000] [8] [INFO] Worker exiting (pid: 8)
web_1     | [2019-05-25 08:07:07 +0000] [1] [INFO] Shutting down: Master
web_1     | [2019-05-25 08:07:07 +0000] [1] [INFO] Reason: Worker failed to boot.
foo_web_1 exited with code 3
web_1     | [2019-05-25 08:07:10 +0000] [1] [INFO] Starting gunicorn 19.9.0
web_1     | [2019-05-25 08:07:10 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
web_1     | [2019-05-25 08:07:10 +0000] [1] [INFO] Using worker: sync
web_1     | [2019-05-25 08:07:10 +0000] [8] [INFO] Booting worker with pid: 8
web_1     | [2019-05-25 08:07:10 +0000] [8] [ERROR] Exception in worker process
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
web_1     |     worker.init_process()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
web_1     |     self.load_wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
web_1     |     self.wsgi = self.app.wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
web_1     |     self.callable = self.load()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
web_1     |     return self.load_wsgiapp()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
web_1     |     return util.import_app(self.app_uri)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
web_1     |     __import__(module)
web_1     |   File "/code/foo/__init__.py", line 5, in <module>
web_1     |     from .celery import app as celery_app
web_1     |   File "/code/foo/celery.py", line 3, in <module>
web_1     |     from celery import Celery
web_1     | ModuleNotFoundError: No module named 'celery'
web_1     | [2019-05-25 08:07:10 +0000] [8] [INFO] Worker exiting (pid: 8)
web_1     | [2019-05-25 08:07:10 +0000] [1] [INFO] Shutting down: Master
web_1     | [2019-05-25 08:07:10 +0000] [1] [INFO] Reason: Worker failed to boot.
foo_web_1 exited with code 3
web_1     | [2019-05-25 08:07:14 +0000] [1] [INFO] Starting gunicorn 19.9.0
web_1     | [2019-05-25 08:07:14 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
web_1     | [2019-05-25 08:07:14 +0000] [1] [INFO] Using worker: sync
web_1     | [2019-05-25 08:07:14 +0000] [9] [INFO] Booting worker with pid: 9
web_1     | [2019-05-25 08:07:14 +0000] [9] [ERROR] Exception in worker process
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
web_1     |     worker.init_process()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
web_1     |     self.load_wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
web_1     |     self.wsgi = self.app.wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
web_1     |     self.callable = self.load()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
web_1     |     return self.load_wsgiapp()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
web_1     |     return util.import_app(self.app_uri)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
web_1     |     __import__(module)
web_1     |   File "/code/foo/__init__.py", line 5, in <module>
web_1     |     from .celery import app as celery_app
web_1     |   File "/code/foo/celery.py", line 3, in <module>
web_1     |     from celery import Celery
web_1     | ModuleNotFoundError: No module named 'celery'
web_1     | [2019-05-25 08:07:14 +0000] [9] [INFO] Worker exiting (pid: 9)
web_1     | [2019-05-25 08:07:14 +0000] [10] [INFO] Booting worker with pid: 10
web_1     | [2019-05-25 08:07:14 +0000] [10] [ERROR] Exception in worker process
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
web_1     |     worker.init_process()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
web_1     |     self.load_wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
web_1     |     self.wsgi = self.app.wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
web_1     |     self.callable = self.load()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
web_1     |     return self.load_wsgiapp()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
web_1     |     return util.import_app(self.app_uri)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
web_1     |     __import__(module)
web_1     |   File "/code/foo/__init__.py", line 5, in <module>
web_1     |     from .celery import app as celery_app
web_1     |   File "/code/foo/celery.py", line 3, in <module>
web_1     |     from celery import Celery
web_1     | ModuleNotFoundError: No module named 'celery'
web_1     | [2019-05-25 08:07:14 +0000] [10] [INFO] Worker exiting (pid: 10)
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 203, in run
web_1     |     self.manage_workers()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 545, in manage_workers
web_1     |     self.spawn_workers()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 617, in spawn_workers
web_1     |     time.sleep(0.1 * random.random())
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 245, in handle_chld
web_1     |     self.reap_workers()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
web_1     |     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
web_1     | gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
web_1     |
web_1     | During handling of the above exception, another exception occurred:
web_1     |
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/bin/gunicorn", line 10, in <module>
web_1     |     sys.exit(run())
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 61, in run
web_1     |     WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 223, in run
web_1     |     super(Application, self).run()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 72, in run
web_1     |     Arbiter(self).run()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 232, in run
web_1     |     self.halt(reason=inst.reason, exit_status=inst.exit_status)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 345, in halt
web_1     |     self.stop()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 393, in stop
web_1     |     time.sleep(0.1)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 245, in handle_chld
web_1     |     self.reap_workers()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
web_1     |     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
web_1     | gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
foo_web_1 exited with code 1
web_1     | [2019-05-25 08:07:21 +0000] [1] [INFO] Starting gunicorn 19.9.0
web_1     | [2019-05-25 08:07:21 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
web_1     | [2019-05-25 08:07:21 +0000] [1] [INFO] Using worker: sync
web_1     | [2019-05-25 08:07:21 +0000] [9] [INFO] Booting worker with pid: 9
web_1     | [2019-05-25 08:07:21 +0000] [9] [ERROR] Exception in worker process
web_1     | Traceback (most recent call last):
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
web_1     |     worker.init_process()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
web_1     |     self.load_wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
web_1     |     self.wsgi = self.app.wsgi()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
web_1     |     self.callable = self.load()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
web_1     |     return self.load_wsgiapp()
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
web_1     |     return util.import_app(self.app_uri)
web_1     |   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
web_1     |     __import__(module)
web_1     |   File "/code/foo/__init__.py", line 5, in <module>
web_1     |     from .celery import app as celery_app
web_1     |   File "/code/foo/celery.py", line 3, in <module>
web_1     |     from celery import Celery
web_1     | ModuleNotFoundError: No module named 'celery'
web_1     | [2019-05-25 08:07:21 +0000] [9] [INFO] Worker exiting (pid: 9)
web_1     | [2019-05-25 08:07:22 +0000] [1] [INFO] Shutting down: Master
web_1     | [2019-05-25 08:07:22 +0000] [1] [INFO] Reason: Worker failed to boot.
foo_web_1 exited with code 3

App Idea: Graphene Django

Would like to add an option during generation to add Graphene support. Doing so would add a schema.py with a query and mutation imported from django-graph-auth, and mount the schema in the urls. Cool with this and any advice?

Any active users? Dead project?

I'd like to adopt this project for my personal workflow but it doesn't work out of the box. Is anyone utilizing this with docker? The install scripts are failing at multiple points.

Dockerfile / requirements path

There is a small issue with docker file. Line 6 fails because path to requirements file is not correct.

ADD requirements* /code/
RUN pip install -r requirements/dev.txt

Step 6/7 : RUN pip install -r requirements/dev.txt
---> Running in b4af27b5bab2
Could not open requirements file: [Errno 2] No such file or directory: 'requirements/dev.txt'
ERROR: Service 'web' failed to build: The command '/bin/sh -c pip install -r requirements/dev.txt' returned a non-zero code: 1

I have tried to change Line 5 like this, which fixed the issue.

ADD requirements* /code/requirements/

generator-django-rest - is awesome, thanks ๐ŸŽ‰๐Ÿ‘

No HACKING.md

At the bottom of the Readme.md there is a reference to HACKING.md file. But I can't find it in the repo.

./scripts/utils/install.sh breaks apt

Trying to bootstrap a new project and i'm getting hung up on adding the ppa.

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.5 LTS
Release:        20.04
Codename:       focal
$> ./scripts/util/install.sh
...
...
E: The repository 'http://ppa.launchpad.net/pypa/ppa/ubuntu focal Release' does not have a Release file

I've had to manually remove pypa/ppa/ubuntu to get apt working again.

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.