I'm new to the Django. I am currently use VS code as my code editor.
In order to work on the Django project, in the user settings of the VS code, I include the following code to use pylint_django as the default linter.
"python.linting.pylintArgs": [
"--load-plugins=pylint_django", "--errors-only"
],
However, in another python file, which is just a regular python file, I got an error, saying "Django is not available on the PYTHONPATHpylint(django-not-available)"
If I comment the above code in the user setting, the error goes away. I think the problem is pylint-django is used as default linter, even for non-Django python file.
My question is I didn't find the solution to solve this problem. Could you please help me on this? Thank you so much. I really appreciate it.
The problem is solved when I uninstall the globally installed pylint_django.
Related
I'm struggling to implement AppsFlyer on Android using Java.
I have looked into a couple of posts already such as this, this.
Here is the entire error message: [org.gradle.api.Project] AGPBI: {"kind":"error","text":"Program type already present: com.appsflyer.AFExecutor","sources":[{}],"tool":"D8"}
The version
AppsFlyer SDK: 5.+
Android Studio: 3.5.2
Situation
I have done till 4.1 of this guide so far so good.
On AndroidManifest.xml, the main class name of AF has implemented with android.name attribute.
On AndroidManifest.xml, receiver tag commented out (because in this phase I don't believe I do not need a precise data tracking feature.)
What I have tried.
./gradlew app:dependencies | less To find out AFExecutor in other dependencies
To exclude the program
implementation ('com.appsflyer:af-android-sdk:5.+'){
exclude module: 'com.appsflyer'
}
implementation ('com.appsflyer:af-android-sdk:5.+'){
exclude module: 'AFExecutor'
}
If you have any insights, I'd love to hear that.
Try ./gradlew clean, clean project and invalidate caches and restart. If does not help than delete all build and .idea folders, .iml files.
After exploring a bunch of dependencies, I found the solution. The reason was there was a conflict between com.appsflyer:af-android-sdk:5.+ and AF-Android-SDK.jar which had installed manually. After removing the JAR file and built again, I could make it at last! Thank you so much for sharing your experiences, however, the solution was simple!
In my project, I just added new security methods, separating the .env from the project into another folder and adopting the use of new processes. To do this, I followed the python-dotenv lib documentation, which I use in my app.
But even following the suggestion I can not find all the parameters, since I end up having the following error:
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty
My settings:
from dotenv import load_dotenv
env_path = Path('/home/user/configs') / '.env'
load_dotenv(dotenv_path=str(env_path))
How can I resolve this problem from the specific path?
Note: I use in my project, python 3.4.5 and django 1.9.4, but I do not believe that the problem is caused by the old versions adopted in the project.
Another important detail is that the .env file is correct, because when I use it in the same folder where I find the file settings.py it works without problems!
I'm also using this approach and from past few months I'm following a very good developer and he also writes about a python dependency "python-decouple" and you will going to get it in detail at this link
I think this will definitely going to solve your problem.
Python-decouple github repo : here
You can add the folder containing .env to the path. Here's how I did it:
load_dotenv(os.path.join(BASE_DIR, "project", ".env"))
Answered it here.
I want to run pylint recursively on all my project apps from the root of the app. If i use : pylint . on the root of the project base, it gives me the error that there is no init.
How can I run the pylint from my project root without having to specify all the apps one by one.
EDIT
Thank you heartily for the downvotes. But since I am a novice at that and still couldnt find a solution to my issue, can the downvoters please explain or the give the oh-so-obvious solution? If this is how pylint is designed to be called recursively on each app, then can you point me to the documentation?
So by default the pylint is requires the module name or the file name to be linted to be provided to it as args and it does not automatically recursively search from the pwd. It would however lint every python file in a module if a module name is provided.
In order to run the pylint without the hassle of having to maintain the apps, I am using :
PyCQA/prospector
I am trying to create a simple hello world extension using HipHop version 2.1.0. I read the docs in doc/extension.development. However, I believe these are now outdated. I followed the instructions anyways
EXT= make -C idl install
cmake .
make
error: ‘q_UConverter$$EBCDIC_STATEFUL’ was not declared in this scope
Except there are a lot of these. The file that generates these errors seem to be the class_map.cpp file. Any help would be appreciated, thanks.
So, from what it looks like it seems that the make files are outdated.
sometime simplest things are so complex!
I have some javascript which works fine. I decided to put it in a seperate javascript file that I want to link to my template.
I have put it in folder scripts/a_ajax.js off the root of the application.
Whatever folder structure I've tried has not worked.
I've also read something about that I must put a reference in urlpatterns but I'm not sure what I had to do.
Can anyone help tell me what I have to do to embed this code as a file?
thx
If your Django version is 1.3+: https://docs.djangoproject.com/en/dev/howto/static-files/
If your Django version 1.2.* or lower: https://docs.djangoproject.com/en/1.2/howto/static-files/