Following the Graphene-Django basic tutorial verbatim results in this helpful situation.
Maybe there is a dir problem or something? As soon as we add the installed app, it is not found?
Tried everything here
Try to open "cookbook/ingredients/" folder and change name in IngredientsConfig to cookbook.ingredients:
class IngredientsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'cookbook.ingredients'
Related
The gems code_teams, code_ownership should allow one to tag files/whole folders by team name but after adding them to my project, running bundle install etc, I still encounter the same error
Passed `nil` into T.must
sample team file (placed in config/teams as advised) is as following
name: Smurfs
owned_globs:
- folder/folder2/**/*
The code where I try to use the info is :
x = CodeOwnership.for_backtrace(e.backtrace)
Turns out the path was not in the format expected.
The path should not end with /*
I am trying to move an image from one folder into another folder by using:
Storage::move(storage_path('app/public/temporary/').$imageName, storage_path('app/public/profilePic/'.$imageName));
But when i run it gave me the error:
File not found at path: home/vagrant/code/avida/storage/app/public/temporary/5bfb7272e9dc9.download.jpeg
i google and found the following solution:
Storage::disk('local')->move(storage_path('app/public/temporary/').$imageName, storage_path('app/public/profilePic/'.$imageName));
but then it gave another error:
Method 'disk' not found in \Illuminate\Support\Facades\Storage
Can anyone please help me how can i move this file ?
Thank you
Storage class operate in storage directory so there is no need to use storage_path() helper.
Change your code to the one below:
Storage::move('public/temporary/'.$imageName, 'public/profilePic/'.$imageName);
I hope that helps :)
Basically, my question is, why is it putting an underscore in front of my import path?
It says import path does not begin with hostname which I'm assuming is because it starts with an underscore.
I read somewhere this may have something to do with me screwing up my GOPATH, but I've tried moving it everywhere, inside the project folder, outside the project folder, in the default location, etc.
I'm new to go and this has come up a few times recently. Would appreciate any guidance!
So I was misunderstanding where my source code had to be.
For anyone in the same boat, it needs to be within the go path in the actual src folder.
I found this helpful.
me again!!
I have a question based around the download of a file. I was helped with setting up a Firefox profile to set a download to save a file directly without a pop up window. Now I need to tell Selenium to confirm that the said downloaded file is in my downloads folder on C drive to complete the test. Is there a way to do this? I've trawled for answers and have gotten nothing.
I first tried by setting a path like so on my env.rb file but didn't get very far with it:
$download_location = 'C:/Users/User/Downloads'
def download_location(path)
$download_location + path
end
Then telling cucumber to visit this location and confirm the name of the file.
Any help on pointing selenium to the location and confirming the name of a csv file would be hugely appreciated
Thanks
If you want to use ruby instead of selenium, you can use the exists? method to check the downloads directory for a given file, and it will return a Boolean result. For example:
File.exists?('C:\Users\User\Downloads\foo.txt')
I have found a solution that worked for me:
puts Dir["C:/Users/OSAT TESTING/Downloads/**/fleet_#{export}_export_all_*.csv"]
This confirmed the download of the file by looking in my downloads folder and returning the file path + name of any file that contained "fleet_#{export}_export_all_*.csv" in cmd prompt.
Thank you all for your help
:-)
After upgrading to Django 1.4, I now get the following error message:
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'settings.py' (Is it on sys.path?): No module named py
I read that it might have something to do with pydev 2.4 eg: here, so I upgraded pydev to the latest version, 2.5. I am using eclipse indigo.
I started to have a look at the run cnofiguration, and noticed that the django 1.3 egg was still being referenced. So I went to windows/preferences/pydev/interpreter-python, and the 1.3 egg was being referenced in the system PYTHON path.
To try and correct this, I removed the existing python interpreter, and re-added a new one. My python is run from venv, so I added this. An error comes up:
I don't think this is related, but I can see that /venv/lib has appears in the System PYTHONPATH list, whereas in Windows the folder is called /venv/Lib, so I added this as well. Still the new django egg hasn't been include, so I manually added this under the 'Libraries' window.
However, I'm still receiving the error message.
The app runs fine from the command line.
Figured this out after a few hours of trying different things.
I created a new Django project using the pydev 2.5 just to see what would happen, and I noticed that the 'django settings module' entry (see below) was appname.settings. Previously I had put 'settings.py'. I removed the entry entirely, which cleared up the first problem.
After this I was getting a 'module appname not found' error, so I tried putting an empty __init__.py file in the root of my app, which seemed to work.
In a virtualenv, this is usually the case where you forgot to add the /Lib from the base python install during the install process (so, when searching in the PYTHONPATH it's not finding things such as 'threading.py' or 'traceback.py', etc.
I solved this by adding the following to manage.py:
import os
os.environ['DJANGO_SETTINGS_MODULE'] = '<django_app_folder>.settings'
os.environ['SERVER_NAME'] = '<name_of_server>'
<django_app_folder> is the name of the folder containing the settings.py file.
<name_of_server> needs to be there, but I didn't find that it matters what it's set to.
I had this problem. My project did not have a PyDev - Django property so the other solution here did not work. I think this is because I did not initially create it as a Django project. Instead, what worked was:
right click project > properties > PyDev PYTHONPATH > String substitution variables.
Add a variable named DJANGO_SETTINGS_MODULE Its value should be yourapp.settings (or edit it if it's already there)