Browse Source

Some cleanup and getting ready for tests, updated dependencies

pull/258/head
parent
commit
d7bb5d66f9
Signed by: hristoast GPG Key ID: 5FC7664AD47AA1C5
11 changed files with 46 additions and 73 deletions
  1. +18
    -13
      Makefile
  2. +11
    -1
      momw/momw/data_seeds/mod_data.py
  3. +1
    -1
      momw/momw/models.py
  4. +8
    -9
      momw/momw/settings.py
  5. +1
    -1
      momw/momw/urls.py
  6. +0
    -19
      momw/templates/chroniko/entry_index.html
  7. +0
    -1
      momw/templates/chroniko/entry_snippet.html
  8. +0
    -3
      momw/templates/chroniko/latest_entries_rss_link.html
  9. +0
    -18
      momw/templates/chroniko/paginate.html
  10. +0
    -0
      momw/templates/contact.html
  11. +7
    -7
      requirements.txt

+ 18
- 13
Makefile View File

@ -19,9 +19,6 @@ endif
get-versions: ## Display which SHA each environment is running
@echo PRODUCTION:
@http --print b https://modding-openmw.com/_stat/
@echo
@echo STAGING:
@http --print b --verify no https://staging.modding-openmw.com/_stat/
## App commands
clean: ## Clean the project workspace
@ -48,11 +45,7 @@ smtpd: ## Run a simple smtp server for debugging emails
reset: ## Clear and reset the local dev db
@/bin/rm -fr *.sqlite3 src && for d in $$(find . -name __pycache__); do rm -rf $${d}; done
@for app in chroniko media; do \
./momw/manage.py migrate $${app}; done \
&& ./momw/manage.py migrate
@for app in chroniko media; do \
./momw/manage.py makemigrations $${app}; done
@./momw/manage.py migrate
@./bin/seed_db.py --full
server: ## Run the Django dev server
@ -61,14 +54,26 @@ server: ## Run the Django dev server
pip-requirements: ## Install pip requirements
@pip3 install --user -r requirements.txt
test: ## Run unit tests
@./momw/manage.py test
test: ## Run all unit and selenium tests
@./momw/manage.py test chroniko momw media utilz
test-chroniko: ## Run chroniko unit and selenium tests
@./momw/manage.py test chroniko.tests
test-media: ## Run media unit and selenium tests
@./momw/manage.py test media.tests
test-momw: ## Run momw unit and selenium tests
@./momw/manage.py test momw.tests
test-utilz: ## Run utilz unit and selenium tests
@./momw/manage.py test utilz.tests
## Deploy commands
# root is needed for this and others below because of ansible quriks.
# See the below link for more info:
# https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user
django: host_check test ## Set up things for Django; app accounts and etc
django: host_check ## Set up things for Django; app accounts and etc
cd ../playbooks && \
ansible-playbook site.yml --extra-vars "control_hosts=$(HOSTS) \
control_msg='Momw Django App Setup' \
@ -86,7 +91,7 @@ django-migrate: host_check test ## Run Django migrations
db_migrate=true" \
--tags ircspam,migration
django-seeddb: host_check test ## Seed the remote database with initial data
django-seeddb: host_check ## Seed the remote database with initial data
cd ../playbooks && \
ansible-playbook site.yml --extra-vars "control_hosts=$(HOSTS) \
control_msg='Momw Django database seed' \
@ -103,7 +108,7 @@ django-warmcache: host_check ## Warm the site cache
django_warmcache=true" \
--tags ircspam,warmcache
sync: host_check test ## Update code remotely and restart the app
sync: host_check ## Update code remotely and restart the app
cd ../playbooks && \
ansible-playbook site.yml --extra-vars "control_hosts=$(HOSTS) \
control_msg='Momw Code Sync & Restart' \


+ 11
- 1
momw/momw/data_seeds/mod_data.py View File

@ -2,10 +2,12 @@ import pendulum
from datetime import datetime
from django.conf import settings
from profil.models import User
from django.contrib.auth import get_user_model
from momw.models import Category, Mod
TZ = pendulum.timezone(settings.TIME_ZONE)
User = get_user_model()
def mod_cat_factory():
@ -2740,6 +2742,14 @@ fallback=FontColor_color_count,255,255,255</code></pre>
Mod(**teamfoss_scripts).save()
# END TES3MP
# TO ADD:
# https://www.nexusmods.com/morrowind/mods/45516
# https://www.nexusmods.com/morrowind/mods/45517
# https://www.nexusmods.com/morrowind/mods/45495
# https://www.nexusmods.com/morrowind/mods/45492
# https://www.nexusmods.com/morrowind/mods/45489
# https://www.nexusmods.com/morrowind/mods/45464
# _not_yet_used = """
# The below are mods I have locally that are not yet used:
# BlightedAnimalsRetextured


+ 1
- 1
momw/momw/models.py View File

@ -143,7 +143,7 @@ class Tag(TagBase):
@property
def total_uses(self):
return self.chroniko_taggedentry_items.count()
return self.momw_taggedmod_items.count()
def get_absolute_url(self):
return reverse('tag_detail', kwargs={'slug': self.slug})


+ 8
- 9
momw/momw/settings.py View File

@ -5,7 +5,7 @@ PROJECT_NAME = 'momw'
SITE_NAME = 'Modding-OpenMW.com'
ADMINS = (('Hristos', 'h@modding-openmw.com'), )
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '0.0.0.0']
AUTH_USER_MODEL = 'profil.User'
# AUTH_USER_MODEL = 'profil.User'
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
BLOG_RSS_DESCRIPTION = "Modding-OpenMW.com news"
BLOG_RSS_TITLE = "Latest Blog Entries from {}".format(SITE_NAME)
@ -33,23 +33,22 @@ DATABASES = {
DEBUG = True
EMAIL_HOST = 'localhost'
EMAIL_PORT = 1025
FOR_HIRE = False
INSTALLED_APPS = ('django.contrib.admin',
'django.contrib.auth',
INSTALLED_APPS = ('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
# 'debug_toolbar',
'profil',
'chroniko',
'media',
# 'profil',
# 'chroniko',
# 'media',
'momw',
'search',
'taggit',
'utilz',
'zadmin', )
# 'zadmin',
)
INTERNAL_IPS = ["127.0.0.1", ]
LANGUAGE_CODE = 'en-us'
LOGIN_REDIRECT_URL = '/zEndusal/home' # TODO
@ -97,4 +96,4 @@ USE_ASCIINEMA = True
USE_I18N = True
USE_L10N = True
USE_TZ = True
_ZADMIN = {'chroniko': True, 'media': True}
# _ZADMIN = {'chroniko': True, 'media': True}

+ 1
- 1
momw/momw/urls.py View File

@ -11,7 +11,7 @@ urlpatterns = [
path('_app/', app_info, name="app-info"),
path('_stat/', app_info_json, name="app-info-json"),
path('about/', about, name='about'),
path('blog/', include('chroniko.urls', namespace='blog')),
# path('blog/', include('chroniko.urls', namespace='blog')),
path('contact/', contact, name='contact'),
path('faq/', faq, name='faq'),
path('getting-started/', getting_started, name='getting_started'),


+ 0
- 19
momw/templates/chroniko/entry_index.html View File

@ -1,19 +0,0 @@
{% extends 'base.html' %}
{% block title %}Blog{% endblock %}
{% load static %}
{% block content %}
<div>
<h1 class="bold center">The {{ this_site }} blog</h1>
{% if entry_list %}
<div class="center">
{% include 'chroniko/latest_entries_rss_link.html' %}
</div>
{% endif %}
{% for e in entry_list %}
{% include "chroniko/entry_snippet.html" with entry=e %}
{% empty %}
<h3 class="center">Coming soon!</h3>
{% endfor %}
{% include 'chroniko/paginate.html' %}
</div>
{% endblock %}

+ 0
- 1
momw/templates/chroniko/entry_snippet.html View File

@ -1 +0,0 @@
HELLO

+ 0
- 3
momw/templates/chroniko/latest_entries_rss_link.html View File

@ -1,3 +0,0 @@
<a href="{% url 'blog:latest_entries_feed' %}">
<span class="fa fa-rss-square"></span> <span class="bold text-muted">Subscribe to the blog feed!</span>
</a>

+ 0
- 18
momw/templates/chroniko/paginate.html View File

@ -1,18 +0,0 @@
{% load extra_tags %}
<div id="_paginate">
{% if page_obj.has_previous %}
<a class="fa fa-arrow-left" href="?page={{ page_obj.previous_page_number }}"></a>
{% endif %}
{% for n in page_obj.paginator.num_pages|times %}
{% if page_obj.paginator.num_pages > 2 %}
{% if page_obj.number == n %}
<span class="paginate_num">{{ n }}</span>
{% else %}
<a href="?page={{ n }}"><span class="paginate_num">{{ n }}</span></a>
{% endif %}
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
<a class="fa fa-arrow-right" href="?page={{ page_obj.next_page_number }}"></a>
{% endif %}
</div>

momw/templates/utilz/contact.html → momw/templates/contact.html View File


+ 7
- 7
requirements.txt View File

@ -1,16 +1,16 @@
beautifulsoup4==4.6.0
Django==2.0.1
django-csp==3.3
Django==2.0.4
django-csp==3.4
django-debug-toolbar
django-filter==1.1.0
django-taggit==0.22.2
djangorestframework==3.7.7
djangorestframework==3.8.2
ipython
jedi
Markdown==2.6.11
pendulum==1.3.2
psycopg2==2.7.3.2
pendulum==1.4.4
psycopg2==2.7.4
python3-memcached==1.51
uWSGI==2.0.15
uWSGI==2.0.17
https://static.bhgdo.com/rikeripsum.zip
selenium==3.8.1
selenium==3.11.0

Loading…
Cancel
Save