From 3c1a9804c9858328b4b18be634f7d4dbd32b9816 Mon Sep 17 00:00:00 2001 From: lxf Date: Thu, 2 May 2019 15:44:35 +0000 Subject: added live server settings --- apps/pages/models.py | 3 +-- config/base_urls.py | 2 +- config/django.ini | 30 ++++++++++++++++++++++++++++++ config/settings.py | 1 - 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 config/django.ini diff --git a/apps/pages/models.py b/apps/pages/models.py index 0c663cb..c6080b7 100644 --- a/apps/pages/models.py +++ b/apps/pages/models.py @@ -26,8 +26,7 @@ class Page(models.Model): # run markdown md = render_images(self.body_markdown) self.body_html = markdown_to_html(md) - if not self.id: - # self.date_created = timezone.now() + if not self.slug: self.slug = slugify(self.title)[:50] super(Page, self).save() diff --git a/config/base_urls.py b/config/base_urls.py index 022fbe4..dad9836 100644 --- a/config/base_urls.py +++ b/config/base_urls.py @@ -41,7 +41,7 @@ urlpatterns += [ path(r'', NoteListView.as_view(), name='homepage',), path(r'forum/', include('forum.urls')), path(r'n/', include('notes.notes_urls')), - path(r'o/', include('outlines.urls')), + #path(r'o/', include('outlines.urls')), path(r'nb/', include('notes.notebook_urls')), path(r'api/v1/', include(router.urls)), path(r'', PageDetailView.as_view(), name="pages"), diff --git a/config/django.ini b/config/django.ini new file mode 100644 index 0000000..9f87519 --- /dev/null +++ b/config/django.ini @@ -0,0 +1,30 @@ +# django.ini file +[uwsgi] + +# maximum number of processes +processes = 4 +max-requests = 5000 +enable-threads = true +# the socket (use the full path to be safe) +uid = www-data +gid = www-data + +socket = /tmp/uwsgi-luxnotes.sock +chmod-socket = 664 +chown-socket = www-data:www-data + +# the base directory +chdir = /home/lxf/sites/luxnotes.net + +# django's wsgi file +module = config.wsgi +# the virtualenv +home = /home/lxf/sites/luxnotes.net/venv + +buffer-size =65535 +#plugin=python +limit-as = 1024 +limit-post = 0 +# clear environment on exit +vacuum = true +logto = /var/log/uwsgi/lnotes.log diff --git a/config/settings.py b/config/settings.py index d2b0b08..168319b 100644 --- a/config/settings.py +++ b/config/settings.py @@ -77,7 +77,6 @@ LOCAL_APPS = [ 'pages', 'accounts', 'notes', - 'outlines', 'forum', ] INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS -- cgit v1.2.3-70-g09d2