-
Notifications
You must be signed in to change notification settings - Fork 1
Install
The fastest way to get fanarchive
running is to deploy it to Heroku. To do that, click this neat little button:
And either login to heroku so that it can spin up an app for you, or make a new heroku account. Once heroku has built the app and started it up for you, you should be able to navigate to https://your-app-name.herokuapp.com/ and see the archive's index page pop up.
Then, to properly secure your fanarchive
install:
- Go to this django secret key generator site, and generate a new key.
- Copy the new key you just generated.
- Go to https://dashboard.heroku.com/apps/your-app-name/settings
- Scroll till you see "Config Variables", and then click on "Reveal Config Vars"
- Add a new variable with "SECRET_KEY" as the key, and then paste the new key you just generated into the "VALUE" field.
- Click the "Add" button to finish adding the variable.
Click here for further reading, or go back to top.
First, install Python 3.6 by following the appropriate tutorial from the Hitchhiker's Guide to Python's install page. If you have a package manager (e.g. Brew, Chocolatey) or have an IDE installed (e.g. one of the many versions of Visual Studio), or have already previously installed this version of Python, you may be able to skip this step.
To check if Python is installed properly, and has been added to your PATH
:
- open Command Prompt (search for 'cmd' or 'command prompt' in the Start menu)
- type in
python
and hit enter - python should tell you its version and offer you an interpreter prompt.
If you want to use virtual environments to make it easier to work on this project, this is the time to set them up.
If you're on Windows, follow this tutorial, omitting the Flask-related stuff, and you should be all set.
NOTE: If you get a permissions error during the process e.g. trying to update pip, you need to run the command prompt as administrator (right-click on icon in start menu > Run as administrator).
If you're on Mac or Linux, you'll want to open up a Terminal/Bash prompt and do:
$ pip install virtualenvwrapper
If you get permissions errors trying that, then do:
$ sudo pip install virtualenvwrapper
Once virtualenvwrapper
is installed, running workon
will give you an empty list of virtual environments (because you haven't made any yet). To make a new environment, run:
$ mkvirtualenv env-name
And a new environment, env-name
will be created and activated. To exit the environment, type deactivate
and hit enter. To open the environment again, type workon env-name
and hit enter.
To learn more about the virtualenvwrapper
package, check out the docs for it here.
First, you'll likely want to set up an account at GitHub if you don't already have one.
Next, if you don't already have Git installed, check out the Github tutorial for Setting up Git and follow along with the instructions for your platform.
Important Note: If you want to be able to contribute to fanarchive
, make sure that your commit email address is one that you are comfortable having out on the internet. Note that you can use your Github-provieded no-reply
email address as your commit email address.
Once you have Git installed, and your Git client of choice also downloaded (e.g. the official Github client, Sourcetree, etc), you'll want to sort out authentication. If this is your first time working with Git/Github, it is HIGHLY recommended to set up Git to use SSH authentication; it's fiddly and a bit of a daunting process, but it's a lot easier to scrub out old settings or switch to a new Github account while using SSH.
If you're using a GUI Git client, you'll want to pull up their instructions for cloning repositories here. The fanarchive
repo urls are below:
Protocol | URL |
---|---|
SSH | git@github.com:quivop/fanarchive.git |
HTTPS | https://github.com/quivop/fanarchive.git |
To clone the repo using Git on the command line:
- Open Command Prompt, Terminal or Bash.
- (optional) enter
workon project_name
to start your virtual environment, if needed - To clone the project into, say, your home directory:
- Type
cd your\home\directory\path
and hit enter.
On Mac/Linux, that would be something likecd ~/
.
On Windows, it would be something likecd C:\Users\your_username\
- Type
git clone <repo url>
and hit enter.
- Type
By default, this will pull a copy of all files in the fanarchive
repo to your local machine under home_directory\fanarchive
.
To install the extra python packages needed to run fanarchive
:
- (Optional) Start your virtual environment with
workon project_name
if you haven't already. - In a command prompt (or bash prompt, or Terminal window), change to the directory you cloned the
fanarchive
repo into. E.g.~\fanarchive
,~\projects\fanarchive
, or whatever directory you used above. - Type
pip install -r requirements.txt
and hit enter.
- Open the directory you cloned the
fanarchive
repo into. - Open the file named
.sample_env
in your preferred text editor or IDE - Edit the file according to the comments in it, and save it as
.env
Now, when you run Django locally using runsslserver
, your test server will automatically look in the .env
file for certain important environment variables. All .env
files are ignored by git in this project, so any variables you set there will not be pushed to the repo.
If you've got everything installed properly, you should be able to spin up the site using Django's test server, like so:
-
Open Command Prompt, Bash or Terminal
-
Change to the directory you cloned the fanarchive repository into. Examples:
- Mac/Linux:
cd ~\fanarchive
- Windows:
cd C:\Users\your_username\fanarchive
- Mac/Linux:
-
Type
python manage.py runsslserver
and hit enter. -
The Django test server should end up saying something like:
Django version 2.1.0, using settings 'archive.settings' Starting development server at https://127.0.0.1:8000/ Quit the server with CONTROL-C.
-
You can now navigate to https://127.0.0.1:8000/. You should see whatever default page
fanarchive
is currently set up to use.
Before you do any testing or make changes to the archive software, you will likely want to make sure your local db is set up properly. To do that, simply:
- Open up Command Prompt again
- Change to your local clone of the repo
-
cd archive
and hit enter. -
python manage.py migrate
and hit enter. This will run all stored db migrations in$project_root\archive\fanarchive\migrations\
, as well as elsewhere in the project. -
python manage.py loaddata <fixture_name>
, where<fixture_name>
will be the current path to the current load of test data, which is currently stored in$project_root\archive\fanarchive\fixtures\
.
TBA