Skip to content

Commit

Permalink
Conflict resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
durden committed Jul 31, 2011
2 parents 155d869 + 3518720 commit 09e685a
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 42 deletions.
73 changes: 37 additions & 36 deletions INSTALL.markdown
Expand Up @@ -5,20 +5,20 @@ You can see the full hosted solution via linode at http://www.codrspace.com.
Please keep in mind that there are a few limitations to running just the local
version:

1. We are using Github OAuth for signup/authentication, which only allows a
single callback url for the final part of the OAuth process. Thus, this
callback url is set to the hosted version.
2. You will not be able to have a nice profile and missing a lot of Github
integration if you run locally without an external Internet connection.
Please connect to the Internet :)
3. Running locally will always authenticate and use the same github user.
This is because we can't get a real access token running
locally from the 'faked' instance. So, the local instance always
assumes your the same user. However, you can modify this in your
local_settings.py using `GITHUB_USER`. It defaults to user `durden`

* See section on 'Running project' for information on how to run both
* instances locally
1. We are using Github OAuth for signup/authentication, which only allows a
single callback url for the final part of the OAuth process. Thus, this
callback url is set to the hosted version.
2. You will not be able to have a nice profile and missing a lot of Github
integration if you run locally without an external Internet connection.
Please connect to the Internet :)
3. Running locally will always authenticate and use the same github user.
This is because we can't get a real access token running
locally from the 'faked' instance. So, the local instance always
assumes your the same user. However, you can modify this in your
local_settings.py using `GITHUB_USER`. It defaults to user `durden`

* See section on 'Running project' for information on how to run both
* instances locally

## General environment setup

Expand Down Expand Up @@ -65,25 +65,26 @@ version:
Due to limitation #1, we have developed a solution to 'fake' out the OAuth
callbacks for local testing. Unforunately it requires a bit of manual setup.

1. Clone the project twice (1 for the 'normal' access and 1 for faked
Github OAuth.
Example setup:
- `git clone git://github.com/durden/dash.git codrspace`
- `git clone git://github.com/durden/dash.git codrspace_oauth_instance`
- cd codrspace_oauth_instance
- cp example_local_settings.py local_settings.py
- set `GITHUB_USER` in your local settings to your github username
- python manage.py syncdb
- python manage.py runserver localhost:9000

** Now you have your local github OAuth instance running that your
main instance can authenticate against.

- cd codrspace
- python manage.py syncdb
- python manage.py runserver

Now you have two instances of the django development server running. One for
`codrspace` and one for `codrspace_oauth_instance`. The `codrspace_oauth_instance`
is only to **fake validate** the user so you don't have to set up a new application
on github. Use the site as you normally would through `http://121.0.0.1:8000`
1. Clone the project twice (1 for the 'normal' access and 1 for faked Github OAuth.

- `git clone git://github.com/durden/dash.git codrspace`
- `git clone git://github.com/durden/dash.git codrspace_oauth_instance`
- `cd codrspace_oauth_instance`
- `cp example_local_settings.py local_settings.py`
- set `GITHUB_USER` in your local settings to your github username
- `python manage.py syncdb`
- `python manage.py runserver localhost:9000`

Next sync and start the main codrspace instance.

- `cd codrspace`
- `python manage.py sncydb`
- `python manage.py runserver`

Now you have two instances of the django development server running.
One for `codrspace` and one for `codrspace_oauth_instance`.

The `codrspace_oauth_instance` is only to **fake validate** the user so you don't
have to set up a new application on github.

Use the site as you normally would through `http://121.0.0.1:8000`
31 changes: 29 additions & 2 deletions apps/codrspace/static/codrspace.css
Expand Up @@ -480,7 +480,7 @@ ol#post-list {
}

#media-form-wrap input#id_file {
width: 160px;

}

#media-list .media-item {
Expand Down Expand Up @@ -591,10 +591,37 @@ p.github_convo {
font-size: 12px;
}

.highlighttable .lineos {
.highlighttable .linenos {
vertical-align: top;

}
.highlighttable .highlight {
overflow: auto; width: 635px;
}

#guide {
text-align: left;
font-size: 12px;
background-color: #EEE;
padding: 20px 5px 5px 15px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
margin-bottom: 10px;
}

#guide h3 {
margin: 0;
margin-bottom: 5px;
}

#guide ol {
margin: 0;
margin-bottom: 15px;
padding-left: 20px;
}

#guide ol span {
display: block;
margin-bottom: 5px;
}
14 changes: 14 additions & 0 deletions apps/codrspace/templates/add.html
Expand Up @@ -48,6 +48,16 @@

<div id="media-wrap">

<div id="guide">
<h3>Shortcode and MarkDown Examples</h3>
<ol id="shortcode-list">
<li><strong>[gist 1044977]</strong> <span>Use Gist ID's from https://gist.github.com/</span></li>
<li><strong>[url http://eloyz.com/robots.txt]</strong> <span>Include any markup from any public URL.</span></li>
<li><strong>[local example.txt]</strong> <span>Upload files below and click them to insert into your post</span></li>
<li><strong>![image-name](/site_media/media/8192454cbba61.JPG)</strong> <span>Upload images below and click them to insert into your post</span></li>
</ol>
</div>

<div id="media-form-wrap">
{% include "shortcode_help.html" %}
{% csrf_token %}
Expand Down Expand Up @@ -84,6 +94,10 @@
return false;
});

$("#shortcode-examples a").click(function(){
$("#guide").toggle('slow');
});

/* slug autogenerate */
var title_field = $('#id_title');
var slug_field = $('#id_slug');
Expand Down
12 changes: 11 additions & 1 deletion apps/codrspace/templates/edit.html
Expand Up @@ -48,6 +48,16 @@

<div id="media-wrap">

<div id="guide">
<h3>Shortcode and MarkDown Examples</h3>
<ol id="shortcode-list">
<li><strong>[gist 1044977]</strong> <span>Use Gist ID's from https://gist.github.com/</span></li>
<li><strong>[url http://eloyz.com/robots.txt]</strong> <span>Include any markup from any public URL.</span></li>
<li><strong>[local example.txt]</strong> <span>Upload files below and click them to insert into your post</span></li>
<li><strong>![image-name](/site_media/media/8192454cbba61.JPG)</strong> <span>Upload images below and click them to insert into your post</span></li>
</ol>
</div>

<div id="media-form-wrap">
{% include "shortcode_help.html" %}

Expand All @@ -61,7 +71,7 @@
{% if media_set %}
<div id="media-list">
{% for media in media_set %}
<div class="media-item" title="Click to insert shortcode"><a href="javascript:;">{{ media.shortcode }}</a></div>
<div class="media-item" title="Click to insert shortcode"><a href="javascript:;"><span>{{ media.shortcode }}</span></a></div>
{% endfor %}
</div>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions apps/codrspace/views.py
Expand Up @@ -13,8 +13,8 @@
from codrspace.models import Post, Profile, Media
from codrspace.forms import PostForm, MediaForm

GITHUB_USER = getattr(settings, 'GITHUB_USER', 'durden')
GITHUB_CLIENT_ID = getattr(settings, 'GITHUB_CLIENT_ID', '33642ce3ebbadb4a8787')
GITHUB_USER = getattr(settings, 'GITHUB_USER') or 'durden'
GITHUB_CLIENT_ID = getattr(settings, 'GITHUB_CLIENT_ID') or '33642ce3ebbadb4a8787'
DEBUG = getattr(settings, 'DEBUG', False)


Expand Down
2 changes: 1 addition & 1 deletion settings.py
Expand Up @@ -182,7 +182,7 @@

# Github information
# Specific ID for app when it was registered with github
GITHUB_CLIENT_ID =''
GITHUB_CLIENT_ID = ''
GITHUB_USER = ''

# Custom profile and authentication
Expand Down

0 comments on commit 09e685a

Please sign in to comment.