forked from CodeRaising/coderaising
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The output of the mezzanine-project command
- Loading branch information
Showing
14 changed files
with
1,141 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
*.pyc | ||
*.pyo | ||
*.db | ||
.DS_Store | ||
.coverage | ||
local_settings.py | ||
/static |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
syntax: glob | ||
*.pyc | ||
*.pyo | ||
*.db | ||
.DS_Store | ||
.coverage | ||
local_settings.py | ||
|
||
syntax: regexp | ||
^static/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,30 @@ | ||
coderaising.org | ||
=============== | ||
|
||
The main website for CodeRaising.org | ||
You can contribute to the CodeRaising.org site by forking this repo, editing the local_settings.py file, and running the following commands:: | ||
|
||
$ pip install -r requirements/project.txt | ||
|
||
This will install Mezzanine (including all dependencies such as Django), and South (for migrations) and psycopg2 (to interface with PostgreSQL). If you want to use MySQL instead, then add MySQL-python to the project.txt file. | ||
|
||
Create the database, sync and migrate all with this one convenience management command. This will also create some sample data, such as contact form, gallery and demo content:: | ||
|
||
$ python manage.py createdb | ||
|
||
If you don't want it to create sample data, use the ```no-data``` option:: | ||
|
||
$ python manage.py createdb --nodata | ||
|
||
This will also work:: | ||
|
||
$ python manage.py syncdb --migrate | ||
|
||
Collect all the static assets to a top level ```static``` dir:: | ||
|
||
$ python manage.py collectstatic | ||
|
||
Start up the Django server:: | ||
|
||
$ python manage.py runserver | ||
|
||
|
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*/5 * * * * %(user)s %(manage)s poll_twitter |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import os | ||
|
||
bind = "127.0.0.1:%(gunicorn_port)s" | ||
workers = (os.sysconf("SC_NPROCESSORS_ONLN") * 2) + 1 | ||
loglevel = "error" | ||
proc_name = "%(proj_name)s" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
DATABASES = { | ||
"default": { | ||
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle". | ||
"ENGINE": "django.db.backends.postgresql_psycopg2", | ||
# DB name or path to database file if using sqlite3. | ||
"NAME": "%(proj_name)s", | ||
# Not used with sqlite3. | ||
"USER": "%(proj_name)s", | ||
# Not used with sqlite3. | ||
"PASSWORD": "%(db_pass)s", | ||
# Set to empty string for localhost. Not used with sqlite3. | ||
"HOST": "127.0.0.1", | ||
# Set to empty string for default. Not used with sqlite3. | ||
"PORT": "", | ||
} | ||
} | ||
|
||
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTOCOL", "https") | ||
|
||
CACHE_MIDDLEWARE_SECONDS = 60 | ||
|
||
CACHE_MIDDLEWARE_KEY_PREFIX = "%(proj_name)s" | ||
|
||
CACHES = { | ||
"default": { | ||
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache", | ||
"LOCATION": "127.0.0.1:11211", | ||
} | ||
} | ||
|
||
SESSION_ENGINE = "django.contrib.sessions.backends.cache" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
upstream %(proj_name)s { | ||
server 127.0.0.1:%(gunicorn_port)s; | ||
} | ||
|
||
server { | ||
|
||
listen 80; | ||
listen 443; | ||
server_name %(live_host)s; | ||
client_max_body_size 10M; | ||
keepalive_timeout 15; | ||
|
||
ssl on; | ||
ssl_certificate conf/%(proj_name)s.crt; | ||
ssl_certificate_key conf/%(proj_name)s.key; | ||
ssl_session_cache shared:SSL:10m; | ||
ssl_session_timeout 10m; | ||
|
||
location / { | ||
proxy_redirect off; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Protocol $scheme; | ||
proxy_pass http://%(proj_name)s; | ||
} | ||
|
||
location /static/ { | ||
root %(proj_path)s; | ||
access_log off; | ||
log_not_found off; | ||
} | ||
|
||
location /robots.txt { | ||
root %(proj_path)s/static; | ||
access_log off; | ||
log_not_found off; | ||
} | ||
|
||
location /favicon.ico { | ||
root %(proj_path)s/static/img; | ||
access_log off; | ||
log_not_found off; | ||
} | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[group:%(proj_name)s] | ||
programs=gunicorn_%(proj_name)s | ||
|
||
[program:gunicorn_%(proj_name)s] | ||
command=%(venv_path)s/bin/gunicorn_django -c gunicorn.conf.py -p gunicorn.pid | ||
directory=%(proj_path)s | ||
user=%(user)s | ||
autostart=true | ||
autorestart=true | ||
redirect_stderr=true | ||
environment=LANG="%(locale)s",LC_ALL="%(locale)s",LC_LANG="%(locale)s" |
Oops, something went wrong.