Coder Social home page Coder Social logo

cerebrofrontend's People

Contributors

claytonbrezinski avatar

Stargazers

 avatar  avatar

Watchers

 avatar

cerebrofrontend's Issues

Create API keys for GET and POST

  • allow for GET and POST to occur behind a key that they will receive

    • make a key for GET only (regular users)
    • make a key for POST only (backend system)
    • make a key for GET and POST (testing system)
  • with get, allow for HEAD and OPTIONS

  • with POST allow for OPTIONS call

referencing issue #5

add Celery + Redis + RabbitMQ for Heroku integration

  • add redis, celery to requirements doc
  • add heroku-redis addon
  • create tasks.py file
  • update settings file
    • import os app.conf.update(BROKER_URL=os.environ['REDIS_URL'], CELERY_RESULT_BACKEND=os.environ['REDIS_URL'])
  • create .env file and add REDIS_URL=redis://
  • add to the proc file worker: celery worker --app=tasks.app
  • scale the worker worker = 1

From the celery documentation

  - manage.py
  - proj/
    - __init__.py
    - settings.py
    - urls.py

proj/proj/celery.py

import os
from celery import Celery

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings')

app = Celery('proj')

# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
#   should have a `CELERY_` prefix.
app.config_from_object('django.conf:settings', namespace='CELERY')

# Load task modules from all registered Django app configs.
app.autodiscover_tasks()


@app.task(bind=True)
def debug_task(self):
    print('Request: {0!r}'.format(self.request)) ```

proj/proj/__init__.py:
``` from __future__ import absolute_import, unicode_literals

# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app

__all__ = ['celery_app'] 

from here we can place tasks files within each of our apps

- app1/
    - tasks.py
    - models.py
- app2/
    - tasks.py
    - models.py 
  • add celery beat for allowing periodic tasks

  • ensure that timezone is set in setttings.py timezone = 'Europe/London'

    • in the proc file add: beat: celery -A proj beat
    • scale the worker beat = 1
  • add a beat task to the settings file

from celery.schedules import crontab
# Other Celery settings
CELERY_BEAT_SCHEDULE = {
    'task-number-one': {
        'task': 'app1.tasks.task_number_one',
        'schedule': crontab(minute=59, hour=23),
        'args': (*args)
    },

Fix logo on top left

Either remove it completely and use an icon or:
Use arrows icon
make the icon smaller
make the background inherit from the navbar

Create a serializer for the GET data of the REST endpoint

use the Python's requests system to communicate with the backend system
Something like this is a good base:

r = requests.get('http://api.embed.ly/1/oembed?key=' + settings.EMBEDLY_KEY + '&url=' + url)
            json = r.json()
            serializer = EmbedSerializer(data=json)
            if serializer.is_valid():
                embed = serializer.save()

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.