/django_crowdfight

A KittenWar like Django application, written in Python with Django >= 1.8 in 2017/04 for a college project.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Crowdfight


A KittenWar like Django application, written in Python with Django >= 1.8 in 2017/04 for a college project.

License

Crowdfight is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.

Crowdfight is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

Requirements

	django >= 1.8
	django-graphos >= 0.3.41

Run the following command from terminal for a quick installation:

	pip install -r requirements.txt

Installation

Create the project

	django-admin startproject <your_project>

Enter the newly created folder

	cd <your_project>

In settings.py, add the following to INSTALLED_APPS:

   INSTALLED_APPS = [
      ...
      'graphos',
      'crowdfight'
   ]

Edit the ALLOWED_HOSTS for granting access to the website

Edit the internationalization options

     LANGUAGE_CODE = 'it-it'
     TIME_ZONE = 'CET'
     USE_I18N = True
     USE_L10N = True
     USE_TZ = True

Edit the serializer for allowing JSON serialization of the images

     SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'

Edit the paths for static and multimedia files

     STATIC_ROOT = BASE_DIR + '/crowdfight/static/'
     STATIC_URL = '/static/'
     MEDIA_URL = 'media/'
     LOGIN_URL = '/login'
     LOGIN_REDIRECT_URL = '/'

In urls.py, add the following

     from django.conf.urls import include, url
     ...
     urlpatterns = [
     	...
     	url(r'^', include('crowdfight.urls'))
     ]

Migrate the database

	python manage.py makemigrations crowdfight
	python manage.py migrate

Run the server

	python manage.py runserver