https://github.com/iScrE4m/Dispenser
https://github.com/iScrE4m/Dispenser
https://github.com/iScrE4m/Dispenser
Goal
/* parser generated by jison 0.4.13 */ | |
/* | |
Returns a Parser object of the following structure: | |
Parser: { | |
yy: {} | |
} | |
Parser.prototype: { | |
yy: {}, |
I've come to a point where I had to swap django's user model with a custom one, at a point when I already had users, and already had apps depending on the model. Therefore this guide is trying to provide the support that is not found in the django docs.
Django warns that this should only be done basically at the start of a project, so that the initial migration of an app includes the creation of the custom user model.
It took a while to do, and I ran into problems created by the already existing relations between other models and auth.User
.
There were good and not so good things regarding my project state, that influenced the difficulty of the job.
id
field, that's just a usual default django idvar Col = require('react-bootstrap/lib/Col') | |
var PageHeader = require('react-bootstrap/lib/PageHeader') | |
var React = require('react') | |
var Row = require('react-bootstrap/lib/Row') | |
var {connect} = require('react-redux') | |
var {reduxForm} = require('redux-form') | |
var DateInput = require('./DateInput') | |
var FormField = require('./FormField') | |
var LoadingButton = require('./LoadingButton') |
var axios = require("axios"); | |
var axiosDefaults = require("axios/lib/defaults"); | |
axiosDefaults.xsrfCookieName = "csrftoken" | |
axiosDefaults.xsrfHeaderName = "X-CSRFToken" |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
# -*- coding: utf-8 -*- | |
from django import forms | |
from myapp.models import DataGroup # Overwrite this to your model | |
from django.utils.encoding import force_text | |
from django.utils.safestring import mark_safe | |
from django.utils.html import format_html | |
class DataGroupSelect(forms.widgets.Select): | |
def render_option(self, selected_choices, option_value, option_label): |
from celery import Task | |
from celery.task import task | |
from my_app.models import FailedTask | |
from django.db import models | |
@task(base=LogErrorsTask) | |
def some task(): | |
return result | |
class LogErrorsTask(Task): |
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
###Let's install Vagrant###
###Select a Vagrant Box from https://vagrantcloud.com###
#add it to your list of boxes
vagrant box add hashicorp/precise32
#create a new folder for your project & init vagrant