django cms tries to import unrelated project - django-cms

Following this tutorial on windows: https://github.com/divio/django-cms-tutorial/blob/master/Step%201%20-%20Initial%20Setup.md
typing this line:
djangocms -p . my_site
I have this error:
OSError: Could not import settings 'ira_site.settings'
(Is it on sys.path? Is there an import error in the settings file?):
No module named 'ira_site'
ira_site is the name of an unrelated django (no-cms) project.
I've grepped (using ransack) the whole "c:\python34" and "virtual_env" folders to look for "ira_site". Not a trace of it.
I've opened every settings.py file I could open. To check of installed apps.
Not trace of it. Why would djangocms installer try to import the settings of a totally unrelated django project ? What am I missing ?

Allright, it was quite stupid. In case someone has the same problem:
your environment variables:
DJANGO_SETTINGS_MODULE
Must be set so django-admin.py can find it ( as the installer is also creating the project ). What I did is:
reset it to global-settings.py
run the installer.
And once installation was over, put it back to the settings.py file of the newly created site.

Related

"Components" folder not included in project structure

I have a strange issue with nextJS.
I created new directory components in the root folder and added some test component files.
While I try to import it, the pass exists, but at localhost I have error:
Module not found: Can't resolve '../../components/admin/AdminBoLayout'
The path is correct, and the component works 100% (tested this code with another nextJs project).
Why does problem appear?
P.S. according to this article, components directory exist in nextJs project structure.
Solved: just Ctrl+C and npm run dev in terminal
(restart localhost)

header.css file not importing

I have been creating a site on my IDE and it has been working perfectly. But I ran into problems when deploying to Netlify. After changing all my file names to lowercase, now my 'header.css' file is not importing into header.js. I have checked the file path and it is correct. Can anyone please help me?
https://github.com/genesis16/alphaomega
changed file names to lowercase.
changed npm versions
installed css loader
changed file path to './components/header.css'
import './header.css' import '..components/header.css'
warning in ./src/components/Card.js ⠀ There are multiple modules with
names that only differ in casing. This can lead to unexpected behavior
when compiling on a filesystem with other case-semantic.
I have saved the file as card.js to pass Netlify's casing requirements. But it is still showing in my error log with capital Card.js.
I expected to run Gatsby develop and have my site load up properly with the header.css file imported.

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

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

Symfony Warning : rename (../app/cache/dev , ../app/cache/dev_old ) : Access Denied . (Code : 5)

I am working on Symfony project.
When i try to do :
php app/console cache:clear
i get the following ErrorException:
Warning : rename (../app/cache/dev , ../app/cache/dev_old ) : Access Denied . (Code : 5) in ../vendors/Symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php on line 76
What is the problem here? I have given all permissions to the user on my machine (Windows 7 OS). Any ideas why it is happening?
Thank You.
Be sure that the files are not in use (as meze pointed out). If you're using something like TortoiseGit or Netbeans, etc - be sure to mark the cache folder as ignored so that they are not accessed.
If all else fails, download a free program like Unlocker that will allow you to quickly and easily detach running processes from the files/folders you are trying to modify.
To expand on leek's post, Symfony 2 cache-clearing operations shuffle the cached items across different folders during the cleanup. Part of this process includes creating cache/dev-new/ and cache/dev-old/ folders.
If you are using Eclipse or another IDE that dynamically monitors subfolders within your project, the IDE will nearly instantly spot the new folder creation and look in those folders for new files (in Eclipse, I noticed the DLTK module constantly doing this in the Progress View). This may unfortunately get in the way of Symfony, which wants to rename and/or delete these folders.
Specifically with Eclipse Indigo on Windows 7 64-bit, you can remove the cache/, cache/dev/, cache/dev_old/ and cache/dev_new/ folders from the build path by right-clicking your project and selecting "Build Path > Configure Build Path...". This originally had no effect for me; I kept seeing the DLTK module trying to index the cache folders. I ended up uninstalling the Aptana Studio plug-in, closing all Editor documents, shutting down Eclipse, manually deleting the sub-folders in the cache/ folder, running Symfony cache:clear, then starting up Eclipse and reinstalling Aptana. Seems to have worked thus far.
It's an issue with Symfony 2.0.x and Symfony 2.1.x. These a workaround for this:
Open the file: src\Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand.php
and add the statement sleep(1); where the directory creation is failing, in the execute() function:
//...
rename($realCacheDir, $oldCacheDir);
sleep(1);
rename($warmupDir, $realCacheDir);
//...
You might have to re-open the CLI twice and run cache:clear, but it will fix the problem after that
If you're using text editors as Sublime Text try to ignore path of cached files
Go to Preferences/Setting
edit config file
{
...
"folder_exclude_patterns": ["var","node_modules", ".git"],
...
}
in my case
Cache folders containers.
Symfony 4
/var
Symfony 2
/app/cache
Nice coding!
I had the same issue with Symfony 4.1.13 and the root cause was that the VS Code was using the file "var/cache/dev/srcDevDebugProjectContainer.xml4QSKuA".
The issue was Cannot rename "var/cache/dev/srcDevDebugProjectContainer.xml4QSKuA".
I fix it adding **/var on the fields "Files to Exclude"
See the following steps:
1º Step:
2º Step search for "exclude" word, then add **/var/cache as the following image:
It's worked for me.
To have tranquility once and for all I create clear.bat file in MyProject folder under Windows 7 .
rmdir d:\symfony\framework-standard-edition\app\cache\ /S /Q
I guarantee 100% effectiveness for cleaning cache. Some minor problems can occurred after first time refresh website: Symfony must recreate some folders they need.
SYMFONY AND ANTIVIRUS
Multiple symfony calling in local windows machine get cross with some Antivirus software such as NOD in my case. Exclude symfony cache folder from real time protection

file or directory not found for "UIConstants.js"

In Hamattan Application Project in Qt Creator. when I'm trying to import:
import "UIConstants.js" as UIConstants
I always get file or directory not found error after building. It tried to copy the file into my project, the same error pops out.
What could have gone wrong? Please Help, Thank you.
It's either of these two:
forgot to add it in res.qrc
it was located at a different directory(but is included in the project)

Resources