This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cd ~ | |
| $ sudo curl -sS https://getcomposer.org/installer | sudo php | |
| $ sudo mv composer.phar /usr/local/bin/composer | |
| $ sudo ln -s /usr/local/bin/composer /usr/bin/composer | |
| then you can run | |
| $ sudo composer install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class A(models.Model): | |
| things = models.ManyToManyField("B", through=ThroughModel) | |
| class B(models.Model): | |
| text = models.TextField() | |
| class ThroughModel(models.Model): | |
| a = models.ForeignKey(A) | |
| b = models.ForeignKey(B) | |
| extra = models.BooleanField() |
This example assumes your running a recent Ubuntu with upstart installed and you have install n from npm.
To see an example use of this ina a wider context, look at this gist for deploying node.js + nginx
Adapt as required.
- Put the
node.confin/etc/init/ - Create a folder for individual site configs to live in
/etc/node - Put the
node-test.confinside/etc/node - Create the folder for the logs
/var/logs/node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE City ( | |
| ID BIGSERIAL, | |
| Name varchar(35) NOT NULL DEFAULT '', | |
| CountryCode varchar(3) NOT NULL DEFAULT '', | |
| District varchar(20) NOT NULL DEFAULT '', | |
| Population int NOT NULL DEFAULT '0' | |
| ) | |
| ; |
NewerOlder