Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions DEPLOYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Here is a quick guide on how to deploy your very own LightWrite server!

First off, you have to get all the needed things. You will need Python 2.7 and django, just google search em
You will also need sqlite3, so do a quick apt-get || yum install || whatever the hell your package manager is sqlite3

Now, you will need to configure a few things.
In the directory lightwrite, which you should've gotten from the git pull, there is a file named local_settings.py. Open that.

All you have to do here is change the paths to work with your machine. Here are some templates.

MEDIA_ROOT = '/path/to/top/dir/of/this/project/static'
SITE_ROOT = '/path/to/top/dir/of/this/project'
STATICFILES_DIR = ('/path/to/top/dir/of/this/project/static')

And that should be that! Now all you have to do is from the terminal, change directory to /path/to/top/dir/of/this/project/lightwrite/ and then type ./run.sh!
If you have any problems with this, just try and figure it out. It shouldn't be that hard.

If you see something I missed, please do add on to this file.
Binary file removed lightwrite/.local_settings.py.swp
Binary file not shown.
Binary file removed lightwrite/.urls.py.swp
Binary file not shown.
Binary file added lightwrite/__init__.pyc
Binary file not shown.
12 changes: 9 additions & 3 deletions lightwrite/local_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
MEDIA_ROOT = '/home/tuttle/Projects/LightWrite/static'
SITE_ROOT = '/home/tuttle/Projects/LightWrite/'
#Change these to where you installed light write. Methinks these are sensible defaults

import os

home_path = os.getenv("HOME")

MEDIA_ROOT = '%s/LightWrite/static' % home_path
SITE_ROOT = '%s/LightWrite/' % home_path
STATICFILES_DIRS = (
'/home/tuttle/Projects/LightWrite/static/',
'%s/LightWrite/static/' % home_path,
)

Binary file added lightwrite/local_settings.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion lightwrite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', '[email protected]'),
# ('', ''),
)

MANAGERS = ADMINS
Expand Down Expand Up @@ -163,3 +163,4 @@
except:
pass

REDIR = 'w'
Binary file added lightwrite/settings.pyc
Binary file not shown.
Binary file modified lightwrite/templates/.light.html.swp
Binary file not shown.
51 changes: 43 additions & 8 deletions lightwrite/templates/light.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,56 @@
<link href="/static/light.css" media="screen" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="/static/jquery.textarea.js"></script>
<script type="text/javascript" src="/static/ZeroClipboard.js"></script>

<script>
$(document).ready(function(){
function setUpZeroClipboard()
{
ZeroClipboard.setMoviePath('/static/ZeroClipboard.swf');

var button_up = new Image();
button_up.src = "/static/copyButtons/button_up.png";
// maybe add some more images to make it look better on hover or mousedown or something
}
</script>

<script>
$(document).ready(function(){
$.getJSON('/w/t/{{wash}}', function (data, textStatus, jqXHR) {
$('#writearea').val(data[0]['fields']['text'])
});
setUpZeroClipboard();
$('#writearea').focus();
$("#writearea").tabby();
$('#footer-items').hide();
$('#footer-items').hide();
$('#writearea').focus();
jQuery("#logoo").hover(function() {
jQuery('#logoo').attr("src", "/static/gunio2.png")
}, function(){
jQuery('#logoo').attr("src", "/static/gunio.png");
});
})
});
var light = true;
</script>

<script type="text/javascript">
function sendo(){
var clip = new ZeroClipboard.Client();
clip.setText('http://gun.io/w/{{wash}}');

var width = 40;
var height = 40;
var flash_movie = '<div>'+clip.getHTML(width, height)+'</div>';

flash_movie = $(flash_movie).css({
position: 'relative',
marginBottom: -height,
width: width,
marginLeft: '49%',
height: height,
zIndex: 101
});

var writearea= $('textarea[name=writearea]');
var csrf= $('input[name=csrfmiddlewaretoken]');
var data = 'csrfmiddlewaretoken=' + csrf.val() + '&writearea=' + encodeURIComponent(writearea.val()) + '&save=Save+Online';
Expand All @@ -32,13 +63,16 @@
data: data,
cache: false,
});
smoke.signal('Saved!<br /><div id=sub>You can find this text at http://gun.io/w/{{wash}}</div> ');

smoke.signal('Saved!<br /><div id=sub>You can find this text at http://gun.io/w/{{wash}}<img id="copy-image" src="/static/copyButtons/button_up.png"> <br />(click that to copy the url)</div>');
$('#copy-image').before(flash_movie);

return false;
}
</script>
<script type="text/javascript">
function save(){
$('#bodytext').submit();
function save(){
$('#bodytext').submit();
}
</script>
<script type="text/javascript">
Expand All @@ -61,8 +95,6 @@
$('#main form div textarea#writearea').css('text-shadow', '0 0 1px #999988');
light = false;
}


}
</script>
<script TYPE="text/javascript">
Expand Down Expand Up @@ -92,6 +124,8 @@
})();

</script>
</script>

<link rel="stylesheet" href="/static/smoke.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/static/themes/dark.css" type="text/css" media="screen" />
<script src="/static/smoke.min.js" type="text/javascript"></script>
Expand Down Expand Up @@ -121,5 +155,6 @@
</div>
</div>
</center>

</body>
</html>
Binary file added lightwrite/text_db
Binary file not shown.
Binary file added lightwrite/texts/__init__.pyc
Binary file not shown.
Binary file added lightwrite/texts/models.pyc
Binary file not shown.
Binary file added lightwrite/texts/views.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions lightwrite/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'lightwrite.views.home', name='home'),
url(r'^(?P<wash>[a-zA-Z0-9_.-]+)$', 'lightwrite.texts.views.write'),
url(r'^t/(?P<wash>[a-zA-Z0-9_.-]+)/$', 'lightwrite.texts.views.json_get_text'),
url(r'^a/about/$', 'lightwrite.texts.views.about'),
url(r'^%s/(?P<wash>[a-zA-Z0-9_.-]+)$' % (settings.REDIR), 'lightwrite.texts.views.write'),
url(r'^%s/t/(?P<wash>[a-zA-Z0-9_.-]+)/$' % (settings.REDIR), 'lightwrite.texts.views.json_get_text'),
url(r'^%s/a/about/$' % (settings.REDIR), 'lightwrite.texts.views.about'),
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root':settings.MEDIA_ROOT}),
url(r'^$', 'lightwrite.texts.views.root'),
# Uncomment the admin/doc line below to enable admin documentation:
Expand Down
Binary file added lightwrite/urls.pyc
Binary file not shown.
Loading