Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
memopol
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
32
Issues
32
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Political Memory
memopol
Commits
72a829b0
Commit
72a829b0
authored
Apr 23, 2017
by
Archerfou
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into search_update
parents
0b000357
df377f9b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
13 deletions
+73
-13
.gitignore
.gitignore
+3
-0
bin/dev.sh
bin/dev.sh
+41
-0
bin/quickstart.sh
bin/quickstart.sh
+1
-0
docs/development.rst
docs/development.rst
+24
-13
src/memopol/settings.py
src/memopol/settings.py
+4
-0
No files found.
.gitignore
View file @
72a829b0
...
...
@@ -33,3 +33,6 @@ data/
# editors
*~
# local setup
.memopol.alias
bin/dev.sh
0 → 100755
View file @
72a829b0
#!/bin/bash
# Script to setup few usual aliases to facilitate the development
# This aliases should work if you've installed memopol throught the quickstart
# script or the documentation
# It :
# - Setup automaticaly the venv
# - Setup Django in DEBUG mode
# You just need to add a line in you're .bashrc or .zshrc to load them:
REPOROOT
=
"
$(
readlink
-m
"
${
BASH_SOURCE
[0]
}
"
/../..
)
"
ALIASROOT
=
$REPOROOT
"/.memopol.alias"
echo
$ALIASROOT
echo
"Create a dedicated alias file in
$ALIASROOT
"
echo
"alias memopol-code=
\"
cd
$REPOROOT
&& source
$REPOROOT
/memopol_env/bin/activate && DJANGO_DEBUG=True
\"
"
>
$ALIASROOT
echo
"alias memopol-launch=
\"
memopol-code && memopol runserver
\"
"
>>
$ALIASROOT
echo
"alias memopol-update-all=
\"
memopol-code && bin/update-all
\"
"
>>
$ALIASROOT
echo
"alias memopol-refresh-scores=
\"
memopol-code && memopol refresh_scores
\"
"
>>
$ALIASROOT
if
[
$SHELL
=
"/bin/bash"
]
then
echo
"Bash detected"
echo
"Update
$HOME
/.bashrc file"
RCSHELL
=
"
$HOME
/.bashrc"
elif
[
$SHELL
=
"/bin/zsh"
]
then
echo
"Zsh detected"
echo
"Update
$HOME
/.zshrc file"
RCSHELL
=
"
$HOME
/.zshrc"
else
echo
"SHELL don't supported. Try using BASH or ZSH, or manually."
fi
echo
"source
$ALIASROOT
"
>>
$RCSHELL
source
$ALIASROOT
echo
-e
"You can use the following aliases :
\n
"
echo
-e
"
\t
memopol-code : Go into the repository and activate the virtualenv"
echo
-e
"
\t
memopol-launch : Run the development server"
echo
-e
"
\t
memopoll-update-all : Get all the production data"
echo
-e
"
\t
memopol-refresh-scores : Refresh all scores"
bin/quickstart.sh
View file @
72a829b0
...
...
@@ -41,6 +41,7 @@ memopol migrate
# Import sample data
memopol loaddata data_sample.json
memopol refresh_scores
echo
echo
"You're all set!"
...
...
docs/development.rst
View file @
72a829b0
...
...
@@ -6,8 +6,8 @@ Local development tutorial
decisions.
This tutorial drives through a local installation of the project for
development on Linux. It requires git, a fairly recent version of python2
and
virtualenv.
development on Linux. It requires git, a fairly recent version of python2
,
virtualenv
and PostgreSQL
.
Quickstart
==========
...
...
@@ -19,13 +19,19 @@ that's how you will learn most.
Here's how to try it::
$ git clone
https://git.laquadrature.net/
memopol/memopol.git
$ git clone
gitlab@git.laquadrature.net:
memopol/memopol.git
$ cd memopol
$ source bin/quickstart.sh
If you want more control or if it doesn't work for you, then follow the steps
below or have a look at what the quickstart script does.
.. note::
If you are using python 3 on your system, the quickstart script will install
the virtualenv with this version. You'll need to remove the directory
'memopol_env' and recreate it with the python version 2.7 in parameter
'virtualenv -p /usr/bin/python2.7 memopol_env'
Make a virtual environment
==========================
...
...
@@ -52,17 +58,18 @@ Alternatively, use the tox command::
Clone the repository
====================
You should fork the project on git laquadrature.net and use the fork's clone url. For the
sake of the demo, we'll use the main repository URL::
The project is hosted on https://git.laquadrature.net/memopol/memopol
You can get the code with git ::
$ git clone https://git.laquadrature.net/memopol/memopol
.git
Clon
ing into
'memopol'...
remote: Counting objects:
2516
, done.
remote: Compressing objects: 100% (
109/109
), done.
remote: Total
2516 (delta 44), reused 0 (delta 0), pack-reused 2402
R
eceiving objects: 100% (2516/2516), 4.40 MiB | 79.00 KiB/s, done
.
R
esolving deltas: 100% (1103/1103), done
.
Checking connectivity... done
.
$ git clone https://git.laquadrature.net/memopol/memopol
Clon
age dans
'memopol'...
remote: Counting objects:
7972
, done.
remote: Compressing objects: 100% (
2668/2668
), done.
remote: Total
7972 (delta 5203), reused 7830 (delta 5099)
R
éception d'objets: 100% (7972/7972), 4.88 MiB | 4.73 MiB/s, fait
.
R
ésolution des deltas: 100% (5203/5203), fait
.
Vérification de la connectivité... fait
.
$ cd memopol/
...
...
@@ -160,6 +167,10 @@ You can load a small data sample for quick setup:
$ memopol loaddata small_sample.json
If you launch memopol for the first time, you need to launch this command :
$ memopol refresh_scores
Or actual data (takes a while)::
$ bin/update_all
...
...
src/memopol/settings.py
View file @
72a829b0
...
...
@@ -300,11 +300,15 @@ with open(SECRET_FILE, 'r') as f:
#
# Add allowed hosts from environment
# Automaticaly add 127.0.0.1 in ALLOWED_HOSTS on DEBUG
#
if
'DJANGO_ALLOWED_HOSTS'
in
os
.
environ
:
ALLOWED_HOSTS
+=
os
.
environ
.
get
(
'DJANGO_ALLOWED_HOSTS'
).
split
(
','
)
if
DEBUG
:
ALLOWED_HOSTS
+=
[
'127.0.0.1'
,
'localhost'
]
#
# Raven configuration
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment