Hugo site isn't starting locally - github-pages

I'm currently trying to build a Hugo site locally, and no content is showing. I'd love more trouble-shooting steps or anything that can help me do a clean rebuild so I don't have to transfer all my posts over to a Google site.
I've tried re-instantiating the site, rebuilding it with hugo, starting the server with hugo server and hugo server -D, but I'm only getting a blank screen.
I have pages that aren't drafts, so something should definitely be showing. It's possible the public or index folder are goofed, but I'm not sure.
hugo version: Hugo Static Site Generator v0.48/extended darwin/amd64
go version: go version go1.11.2 darwin/amd64
config.toml:
baseURL = ""
languageCode = "en-us"
title = ""
theme = "ananke"
[menu]
[[menu.main]]
identifier = "Posts"
name = "Posts"
pre = "<i class='fa fa-road'></i>"
url = "/posts/"
weight = -100
[params]
featured_image = "images/space-cat-wallpaper.jpg"
twitter = ""
When building the pages with hugo:
| EN
+------------------+----+
Pages | 72
Paginator pages | 0
Non-page files | 0
Static files | 21
Processed images | 0
Aliases | 1
Sitemaps | 1
Cleaned | 0
Total in 88 ms
When starting the local instance with hugo server -D:
| EN
+------------------+-----+
Pages | 117
Paginator pages | 5
Non-page files | 0
Static files | 21
Processed images | 0
Aliases | 1
Sitemaps | 1
Cleaned | 0
Total in 120 ms
Watching for changes in /Users/jschalz/Desktop/hugo-jschalz.github.io-2/{content,data,layouts,static,themes}
Watching for config changes in /Users/jschalz/Desktop/hugo-jschalz.github.io-2/config.toml
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
After running hugo -v --debug -D I get the following warnings and then a LOT of debug noise:
WARN 2019/06/16 16:33:21 No translation bundle found for default language "en"
WARN 2019/06/16 16:33:21 Translation func for language en not found, use default.
WARN 2019/06/16 16:33:21 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
Navigating to localhost:1313 gives me a blank screen.

First hugo -v --debug -D could tell you more
Second, to be really sure something is generated, try:
hugo server --renderToDisk --gc --cleanDestinationDir
Check that files are created (as opposed to be served in memory)
Note: I always prefer adding in my config.toml
builddrafts = true
It is useful when starting a project, to be sure everything is generated.
The OP ladygremlin confirms in the comments:
I think the builddrafts = true in the config.toml fixed it!
I also upgraded to the newest version of hugo.

Related

Unable to login ECR web page and show error message

Could you check why user kcizek is not able to login to either hub.tess.io nor ecr? This is first time login but it should work with corp and PIN + Yubi. Login works for me just fine.
I am unable to access https://ecr.vip.ebayc3.com/repository/
When I log in, I am faced with this. The ‘contact us’ link doesn’t have any contact information, so I’m trying here. Any ideas? Thanks.
Potentially relevant background: this is my first time attempting to get access.
enter image description here
It's found the email info is absent in user account.
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | default |
| email | |
| enabled | True |
| id | e69fe5b9d9384b338b3c397c7c84e33f |
| name | kcizek |
+-----------+----------------------------------+
Solution is to contact Tess oncall to add email info.
Related Command
openstack user set kcizek --email kcizek#ebay.com

Registered URL not found

We had implemented a two-in-one backend with Flask. For the website itself (which we call it tekid), we're having no trouble. But for the management portal (which we call it tekid-admin), even though using the same view registries, the WSGI server (both dev and prod) returns 404 NOT FOUND for all requests.
Related Codes
The CLI entries are registered as
tekid -> tekid.cli.www:cli
tekid-admin -> tekid.cli.adm:cli
Following is the code we used to hold Flask application object:
# -*- coding: utf-8 -*-
"""Module entrypoint of TekID website."""
# in `tekid/app/www.py` for `tekid`
from tekid.urls.www import app
# in `tekid/app/adm.py` for `tekid-admin`
from tekid.urls.adm import app
Following is the code we used for CLI entry:
# -*- coding: utf-8 -*-
"""CLI for TekID website."""
import click
import flask
import tekid.core.typing as typing
# in `tekid/cli/www.py` for `tekid`
from tekid.app.www import app
# in `tekid/cli/adm.py` for `tekid-admin`
from tekid.app.adm import app
__all__ = ['cli']
#click.group(cls=flask.cli.FlaskGroup, create_app=lambda: app)
def cli() -> typing.NoneType:
"""Management script for the TekID website."""
Following is the code we used for routing registry (we're using a centralised registering mechanism as proposed by Flask itself):
# tekid/urls/www.py & tekid/urls/adm.py (same when testing)
# -*- coding: utf-8 -*-
"""URL routing for TekID website."""
# pylint: disable=wrong-import-position
from tekid.core.macro import FLASK as app
__all__ = ['app']
###############################################################################
# load HTML pages
from tekid.urls.pages import * # pylint: disable=unused-wildcard-import
# index.html
app.add_url_rule('/', view_func=load_index)
... # same routing registry codes
Expected Behavior
NB: tekid and tekid-admin should give the same output
The routes command would give like this:
$ tekid routes
# or
$ tekid-admin routes
Endpoint Methods Rule
-------------- ----------------- -----------------------------------
load_contact GET, POST /contact/
load_expertise GET /expertise/
load_index GET /
load_news GET, POST /news/
...
static GET /static/<path:filename>
We try curl http://127.0.0.1:5000/ after run on the website (tekid):
$ tekid run
* Environment: development
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 332-955-135
/fakepath/.venv/lib/python3.7/site-packages/flask/sessions.py:220: UserWarning: The session cookie domain is an IP address. This may not work as intended in some browsers. Add an entry to your hosts file, for example "localhost.localdomain", and use that instead.
"The session cookie domain is an IP address. This may not work"
127.0.0.1 - - [07/Nov/2019 17:20:03] "GET / HTTP/1.1" 200 -
$ curl http://127.0.0.1:5000
<!--
_______ _ _____ _____ _ _ _
|__ __| | | |_ _| __ \ | | | | | |
| | ___| | __ | | | | | | | | | |_ __| |
| |/ _ \ |/ / | | | | | | | | | __/ _` |
| | __/ < _| |_| |__| | | |___| || (_| |_
|_|\___|_|\_\_____|_____/ |______\__\__,_(_)
-->
... (the actual HTML page)
Actual Behavior
With the same configs as above, we try curl http://127.0.0.1:5000/ after run on the management portal (tekid-admin):
$ tekid-admin run
* Environment: development
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: ***-***-***
/fakepath/.venv/lib/python3.7/site-packages/flask/sessions.py:220: UserWarning: The session cookie domain is an IP address. This may not work as intended in some browsers. Add an entry to your hosts file, for example "localhost.localdomain", and use that instead.
"The session cookie domain is an IP address. This may not work"
127.0.0.1 - - [07/Nov/2019 17:06:25] "GET / HTTP/1.1" 404 -
$ curl http://127.0.0.1:5000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>
Environment
Python version: 3.7.4
Flask version: 1.1.1
Werkzeug version: 0.16.0
So, basically from the Flask and/or Werkzeug documentation (which I could not recall the original source), Flask can only recognise the imported application instance from no more than 2 (?) layers recursively.
That is to say, the application failed to identify which one was the actual instance to be used and rather make an empty instance without any registered URLs.
The solution was to simply reconstruct the code and just import the application instance in each file and do the same thing to import the URL registries in the CLI files as for tekid/urls/www.py & tekid/urls/adm.py.

Why are most of my project's Django files missing from the PyTest Coverage report?

I'm running pytest-cov and pytest-django using tox. I have a very simple tox.ini file with limited omit files. The problem is when I run pytest using tox -e unit, I get a limited Coverage report:
---------- coverage: platform darwin, python 3.7.4-final-0 -----------
Name Stmts Miss Cover Missing
----------------------------------------------------------------------------
components/__init__.py 0 0 100%
components/client/__init__.py 0 0 100%
components/client/admin.py 27 0 100%
components/client/factories.py 57 0 100%
components/client/models.py 62 0 100%
components/controller/__init__.py 0 0 100%
components/controller/admin.py 62 6 90% 96-97, 109-110, 122-123
components/controller/management/__init__.py 0 0 100%
components/controller/models.py 107 6 94% 19, 31, 54, 92, 105, 132
components/personal/__init__.py 0 0 100%
components/personal/admin.py 24 0 100%
components/personal/factories.py 39 0 100%
components/personal/models.py 81 16 80% 23, 36, 49, 62, 72, 75-76, 92-104
server/__init__.py 3 0 100%
server/celery.py 10 1 90% 30
server/config/__init__.py 1 0 100%
server/settings.py 52 0 100%
server/test.py 56 33 41% 16-19, 43, 48-49, 63-88, 94-105, 112-115
----------------------------------------------------------------------------
TOTAL 589 62 89%
All of my Django apps under components have many files that should be covered in the report, including apps, serializers, signals, urls, and views (the standard Django structure). Anyone have any idea what I'm missing? Everything I've got in the tox.ini seems to follow pretty much exactly what I've read in the various documentation for pytest, pytest-django, pytest-cov, and coverage, but I must be missing something important!
tox.ini
[tox]
; The only reason we'd want to `sdist` is if we distributed this as a Python package in PyPI, so let's skip it:
skipsdist = True
envlist =
{py37}-django{2}
lint
skip_missing_interpreters = true
[testenv]
whitelist_externals = *
passenv = *
deps = -rrequirements-test.txt
commands = {[testenv:unit]commands}
[testenv:unit]
deps = {[testenv]deps}
commands = pytest {posargs:--cov=project-name}
[pytest]
DJANGO_SETTINGS_MODULE = server.settings
python_files = tests.py test_*.py *_tests.py
addopts =
-v -s
--color=yes
--cov
--cov-append
--cov-report=term-missing
--cov-config=tox.ini
[coverage:report]
show_missing = True
omit =
*/usr/*
*/.tox/*py
*/.virtualenvs/*
*/migrations/*
*/tests/*
[report]
omit =
*/usr/*
*/.tox/*
*/migrations/*
*/tests/*
The answer seems quite trivial and obvious, but amazingly, it was quite difficult to come by. coverage will only report on code that is actually run. So if your tests don't call a bit of code and it doesn't get run during normal loading of the application, coverage will not show a report for that code. Code that doesn't run does not cause bugs :)
As per the Coverage.py documentation:
Only importable files (ones at the root of the tree, or in directories with a __init__.py file) will be considered. Source
So you either have to make sure that the code is executed by your tests OR ensure that the directories where your code resides have __init__.py.
I found the problem too,and i changed the tox.ini like below and it works!
[pytest]
DJANGO_SETTINGS_MODULE = server.settings
python_files = tests.py test_*.py *_tests.py
addopts =
-v -s
--color=yes
--cov=.
--cov-append
--cov-report=term-missing
--cov-config=tox.ini
--cov=. means the entire project.
Remember to put tox.ini in the root directory of the project.
I don't know how did you run the Django app and the pytest command,
here is mine
coverage run manage.py runserver --noreload 0.0.0.0:8000 --settings=djangoproject.settings.local &
pytest
pgrep -f 9000 | xargs kill -2
coverage report
coverage html

scrapyd: curl error `unknown or corrupt egg`

I'am trying to update version of my spider, i wrote:
curl http://localhost:6800/addversion.json -d project=comicvn -d spider=comicvn2 -d version= 141667324 -d egg=14116674324.egg
It made error : {"status"": error,"message": "ValuesError: Unkow or corrupt egg"
What's egg paramerter ? and what should I set values for it ? Thank so much !
I created '14116674324.egg' by ussing command bdist_egg. After that, it made a 14116674324.egg file in path :C:\Python27\Scripts\eggs\comicvn2 , so i copy this file to root folder of my project like C:\Python27\Scripts\comicvn2.
curl http://localhost:6800/addversion.json -d project=comicvn -d spider=comicvn2 -d version= 141667324 -d egg=#14116674324.egg
you must be add '#'
see scrapy.cfg format at scrapy deploy doc page. change version entry to update the spider version
[deploy]
url = http://scrapyd.mydomain.com
username = john
password = secret
project = project1
version = 123

CloudFoundry - Application 'controlealunos' does not exist

I think that i'm suffering a bug problem. I created a application on Cloud Foundry with the name "controle*A*lunos" with the upper case letter A.
When i execute the command
cf-apps
i get this result:
+----------------+----+---------+---------------------------------+---------------+
| Application | # | Health | URLs | Services |
+----------------+----+---------+---------------------------------+---------------+
| controleAlunos | 1 | RUNNING | controlealunos.cloudfoundry.com | mysql-86d568b |
+----------------+----+---------+---------------------------------+---------------+
But when i try to update my project whit the command :
prod cf-update controleAlunos controleAlunos-0.1.war
i receive an error
Error Application 'controlealunos' does not exist.
I think that it should be the name of my application. I put it with one Upper Case letter controle*A*lunos and i'm receving the error with no upper case letter controlealunos.
I tried to rename it, but i still get the error.
Any Sugests ?
I guess the project name you created is "controlealunos" which resulted in the app.name property in application.properties is a lower case name, while the name used to push onto CF is "controleAlunos". You can try change the value in the properties file and update again.