Django CMS - Template Does Not Exist Error while creating first page - django-cms

I followed the instructions for installing Django CMS on my mac. When I run "manage.py cms check", everything is fine, except it says it cannot find the template_1.html. When I go into the admin to create a page, the template is in the Template drop down. When I try to save the page it gives me "TemplateDoesNotExist at /admin/cms/page/add/".
Maybe it's noteworthy, I was having issues with the url prior to this error. I was not able to open the admin or even get main page to render in the browser. After searching stack overflow I found the same issue. I changed the url patterns from the "urlpatterns = i18n_patterns" to the standard. That worked. Now I have this issue. Any assistance would be appreciated. Thanks.
Link to Traceback if needed:
http://dpaste.com/hold/1430437/

I had the same error (on Ubuntu 12.04)
Following the django-cms 2.4.3 installation instruction,
django-admin.py startproject myproject
creates a directory myproject (in which manage.py resides) and a subdirectory, also named myproject, which contains the setting files and the templates directory.
I don't know if this is the intention of the authors of the django-cms doc. But the instruction
os.path.join(PROJECT_PATH, "templates"),
in the TEMPLATE_DIRS setting points to /absolute/path/to/myproject/templates.
This should be changed to:
os.path.join(PROJECT_PATH, "myproject/templates"),
to point to the correct directory /absolute/path/to/myproject/myproject/templates

Related

Symfony 4.4 - Custom Error Templates Not Working

I've got an issue when it comes to using Custom Error Templates in Symfony 4.4 Flex. Everything has been set properly according to the guide from https://symfony.com/doc/4.4/controller/error_pages.html
I can access the Custom Error Templates via /_error/{errorCode} when I run the application with APP_ENV=dev - but if I change APP_ENV to prod (with APP_DEBUG set to false/0 of course), I get the default Symfony "500 Internal Server Error" page. I even tested it after deploying the application on the remote host, and it's the same issue when I try to access /random-unexisting-page (already got the error404.html.twig template set and it works on 'dev' via /_error/404).
I want to know, does it have anything to do with other configuration within /config/ ? Have you got any idea what the issue could be ?
I made a few tries and I think I've understood your problem.
So when you want to create a personalized error page, first you need to add, under the template directory, the following path, same as your link said
templates/
└─ bundles/
└─ TwigBundle/
└─ Exception/
├─ error404.html.twig
├─ error403.html.twig
└─ error.html.twig # All other HTML errors (including 500)
The most common error is the 500 so you can add this: error500.html.twig or just leave the generic one, it's up to you.
The importamt thing is that whenever you add a file error in the directory or you simply make a change in an existing file: you MUST launch the command to clear the cache (you can only launch this command when the project has no errors). If you don’t do this the changes wont be visualized.
STEPS:
fix the error or start from a previous working build
launch the clear command: php bin\console cache:clear,
you'll get something like that result_of_clear_cache
refresh the page and you should see the new page
PS. if you need some visual references:
path
error_file
result_on_browser

Issue with serve_site() r blogdown

I'm using blogdown and Hugo to generate a website.
I've created a new R project and have downloaded the theme using:
blogdown::new_site(dir = "Theme", theme = 'pacollins/hugo-future-imperfect-slim') and I can preview the template once downloaded. However, if I close R and then restart and I use the add-in "serve site" I get the following error message:
Error in site_root(config) :
Could not find config.toml / config.yaml under...
and then the directory that the config.toml file is saved in (and all of the rest of the theme files) are listed.
I can't understand what's changing between being able to preview the site in R Studio Viewer, then quitting R and restarting and it not being able to find the config file.
I did find this advice: https://github.com/rstudio/blogdown/issues/48 which suggests that my working directory is not the root directory of the website. There are two things I don't understand:
1) How can the the root directory and working directory work together okay when I initially download the theme, until I quit R and restart, and then they appear to not be the same?
2) How to I change the root directory of the website to fix the issue?
Thanks!
If you followed the blogdown's documentation to create a new site with the command "blogdown::new_site(dir="/your/website/dir")", it will set your working directory to "/your/website/dir".
When you restart R/Rstudio, your current working directory is reset (probably to your home directory). You can check the current working directory with getwd().
The solution is simply set up the working directory:
The simpler way is to execute setwd("/your/website/dir"), then you should be able to run blogdown::serve_site()
The recommended way is to create a Rstudio project at /your/website/dir with File-New Project-Existing Directory. It will create a .Rproj file under the root directory of your website. After that, you can "open project" and work on your website, then preview with serve_site().

Wordpress: ERROR: "Table Prefix" must not be empty

So I'm trying to build a Wordpress website using AWS using RDS Aurora. I've installed the source code provided by wordpress.org and it uploaded successfully but after putting in all the information regarding the database it loads for a minute or two then says the page isn't working, when it reloads it gives me the error ERROR: "Table Prefix" must not be empty. I've tried many solutions but none of them are working
Check the URL of the installation page. It must have a .php suffix. If it doesn't, it's likely your .htaccess page is rewriting the URL and causing your POST requests to misdirect.
Edit .htaccess so it reads RewriteEngine Off.
This bug is often the result of inheriting .htaccess rules from higher directories.
In a fresh installation rename your wp-config-sample.php file with wp-config.php.
Then define you own table_prefix. Make it meaningfull related to your project. This table_prefix will be added as a the prefix of you tables in your database.
Example: $table_prefix = abcd_

SilverStripe Swipestripe - swipestripe-gallery module error

I've installed Swipestripe module. and added swipestripe-gallery module for product images.
when I did dev/bulid?flush=1 it shows error Class 'Gallery_PageExtension' does not exists
I have seen gallery.yml file in swipestripe-gallery/_config folder, which has
Product:
extensions:
- 'Gallery_PageExtension'
but this class is not there in Product.php file in swipestripe-gallery/code folder.
After commenting above code I did dev/build?flush=1 & there was no error. But in product page the Gallery tab is not added.
Please Help.
You didn't install using composer? Your fault ;) It installs all requirements for you and you can code happy.
See https://github.com/swipestripe/silverstripe-swipestripe-gallery#requirements, you'll need to install https://github.com/frankmullenger/silverstripe-gallery for getting this gallery extension in your codebase.
I strongly encourage you to install ALL modules with composer. It may be a bit hard in the beginning, but in some days your life will be much more comfortable! A good introduction can be found in the ss docs.
Swipestripe's config does not have that code: https://github.com/swipestripe/silverstripe-swipestripe/blob/2.1/_config/swipestripe.yaml
The gallery module for it does: https://github.com/swipestripe/silverstripe-swipestripe-gallery/blob/1.1/_config/gallery.yml
These are two separate modules. If the gallery file is in swipestripe/_config as you say, then it would seem to me that the install didn't happen as it should.
There should be two folders in your installation root
swipestripe/
swipestripe-gallery/
All files relating to each module should be in each (individual) folder. It seems you're missing the swipestripe-gallery folder all together, meaning that the class in fact does not exist (When you get this error, just check that the class exists somewhere in your install. Using grep is the easiest way).

Wordpress New Post Edit Toolbar is Missing

Symptom:
When I start a new post on my Wordpress (example: http://website.com/wp-admin/post-new.php), I have the following problems:
The tinyMCE editing toolbar is missing, and
Text does not appear when typed in the body of the new post
Attempts:
Following Wordpress' guidelines, I tried the following without success:
Deactivate all plugins -- still no edit toolbar.
Use other browsers -- same error in Chrome, Firefox, and IE on multiple machines.
Enable SCRIPT_DEBUG in wp-config.php -- same error.
Viewing browser errors in Chrome -- see below.
I opened Developer Tools ("F12") in Chrome on the new post page and found the following 3 errors:
Failed to load resource: the server responded with a status of 404 (Not Found) -- [wordpress-website]/wp-includes/js/tinymce/tiny_mce.js?ver=349-20805
Uncaught ReferenceError: tinyMCE is not defined -- wp-langs-en.js:1
Uncaught ReferenceError: tinyMCE is not defined -- post-new.php:760
Question:
What must I do to get the edit toolbar back?
404 errors are an indication files may be missing. Have you verified the files haven't accidentally been moved or deleted?
You can replace the contents of the wp-includes/ directory where TinyMCE is located. You can either do this via the admin area updater, or you can do it manually.
Automatic way
Log into your WordPress admin area
Navigate to Home > Updates
Click the Re-install Now button
Manual way
Download a copy of the version of WordPress you are currently
running (if you are not running the current version you can find a copy in the release archive)
FTP into your site
Make a backup of your wp-content/ directory
Delete the wp-includes/ directory from the server
Upload the entire wp-includes/ directory from the new copy of WordPress you downloaded
You should now have a completely replaced wp-content/ directory and all of the TinyMCE files will be on your server.

Resources