I used to use vagrant to run my GAE Python apps, but I wanted to tried with virtualenv.
Everything worked okay, but I can't access anything in /_ah/* - I would only need /_ah/admin and also /_ah/img, where uploaded images from the admin panel are located.
I checked my app.yaml and it has everything: the admin_redirect builtin is okay, and I also tried to include the admin_redirect .py manually.
This is the file, just in case:
http://pastebin.com/eV9yTegf
(I tried with threadsafe yes and no, also).
Can anybody help? I am totally stuck, I tried everything and I don't know what to do next.
If you are running the latest version (1.8.0+) then the admin console is actually running in a different port. By default is running in http://localhost:8000/ but you can change that by running the dev_appserver.py with the an option --admin_port.
Related
It's been a while since I posted anything here, and now my problems have become more advanced. For reference, I'm running on Win10.
I'm trying to use the Django framework. Python's been installed on my computer forever; it's the latest version, and it's installed on environment variables/added to system paths. I think those are enabled by default, but I did make sure that they were checked when I reinstalled it.
pip's been updated too. Django installed successfully. I managed to get all the way to installing my new project with django-admin startproject PROJECTNAME, but when I try to run python3 manage.py runserver, I'm getting this error:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
This "Python was not found" error is the main problem that I'm trying to figure out. Nothing I do as a fix seems to get rid of it.
...Interesting. If I type in python --version, I get a response (Python 3.11.0). Here's what I get if I do pip freeze:
asgiref==3.6.0
Django==4.1.6
sqlparse==0.4.3
tzdata==2022.7
Python IDLE runs fine; all .py files run fine. Alright. So, with that in mind and in accordance to a lot of popular advice I've seen floating around, I added the Path to my Environment Variables. For space-saving reasons, my Python is installed on my D drive rather than C. I've made sure that there weren't any leftover Python files that conflicted.
I've uninstalled and reinstalled, double checked my installations, and Django is in D:\ProgramData\Python311\Scripts with pip and everything else I need. I did also disable the shortcut from Settings > Manage App Execution Aliases, but when I did that, I got this error:
python3 : The term 'python3' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Based on some other things I've seen, I've also tried:
python manage.py runserver
python3 ./manage.py runserver
I ended up having to enable the options again just to use Python correctly. And I have been closing and reopening the command line whenever I make changes. Though it updates automatically to fit what I've been doing, I wanted to make sure I didn't overlook any possibility.
I even uninstalled Django for a third time, installed the virtual environment (which I realised I skipped), and did it all again. And then, after a long series of figuring out how to activate the virtual environment and enabling scripts to run, I'm finally in (venv) D:\PROJECTNAME, and I tried... to run it again.
I'm still getting the Python not found error. orz
I've been at it for two hours or so, and I feel like I'm running into a dead end. I think I've finally met my match here.
This is my first time using frameworks like this, and it's been a while since I've installed anything through command line on Windows. I'm not very great at this, so I know that I'm making some amateurish mistakes somewhere. Please let me know if I'm doing anything wrong or missed something obvious.
Please.... I just want to use Django....
Thanks in advance!
This question really is not proper for a PowerShell Q&A, but let see if the below helps.
If you are trying to run django from PS, then:
pip install django
django-admin startproject YourProjectNamehere
lastly, hit your dev server
HTTP://YourDevServerName:YourDevServerPortNumber
Also, be sure that you've activated your virtual environment, never assume it is until you test it. Of course, be sure to change directly to the root of your project.
Again, if you are using python, directly, then, it's more prudent to stay in your pristine python shell vs executing from a PowerShell consoler/terminal, thus eliminating any PowerShell particulars.
first download manually python on your computer , therefore install django from official website , www.python.org/downloads/, https://www.djangoproject.com/download/,
if you're on linux, pip install Django==4.1.6
after installing that use ,
django-admin
I was handed a project which uses Django and Docker, but when I run Django tests Pycharm always seems to have problem finding the users application. Other people in the project have it running without problems but even though we tried to copy their settings, it wouldn't work. I also downgraded to their exact Pycharm version without success. What could be wrong?
I have Docker desktop running without any problem. It's able to create containers and all that. I've also included it in Pycharm with success.
I've also created an interpreter through Docker-compose with a valid .yml file. This file is my colleagues.
I've of course added it as my project interpreter.
I've set up a Django test configuration with appropriate interpreter and with an empty target field so that all applications in INSTALLED_APPS are run, as per documentation.
Still, the module 'users' cannot be found. Passing in DJANGO_SETTINGS_MODULE=config.settings.local to the test configuration yields the same error.
However, when I run from the terminal, all works as expected.
What might be the problem here?
I was using the modern django setup (generated from cookiecutter-django) which Pycharm seems to have trouble with. By right-clicking the folder and choosing "Mark directory as" and marking my project directory as "Sources Root" (i.e. the project/project folder), Pycharm was able to run it properly.
Did you try unchecking options related to PYTHONPATH in your run configuration?
It may override your modules path and cause such mess with finding them.
When installing python on my system I am getting this error shown in below picture.
Please help how can I fix this issue?
My account has admin rights on windows 10 pro 64 bit operating system.
I have downloaded python setup from below link:
https://www.python.org/downloads/windows/
This error manifests when installing Python as a Windows Store app, too. 🤦♂️
Open 'Manage App Execution Aliases' through Start and disable all the Python entries before installing. After installation successfully completes, enable the appropriate aliases for python.exe, python3.exe and possible other version-specific ones.
The fix for this is in the review comments for Python 3.8 on the
Microsoft Store. A review comment by someone named Jan on 11/29/2019
points back to a post from 11/19/2019 where Python Software Foundation
replied with a fix for another error and that fix also fixes this
0x80070005 error.
That fix is: "...open 'Manage App Execution Aliases' through Start and
disable all the Python entries before installing."
I just did this and it worked for me. I could successfully install.
-- https://answers.microsoft.com/en-us/windows/forum/all/error-code-0x80070005-with-microsoft-store/2377a155-8915-4674-b41f-feddd104e0bd
i assume you have admin access or you starting this installation as "Run as
Administrator"
Following are the steps that you need to try now :
1) Turn off the firewall and the anti-virus, and use the admin rights to run
2) otherwise, you have modify your BIOS options on windows to reset the permissions
3) Run this , and it will help you to identify any malwares if any
4) And final option would be like,
reset win 7 (you can keep ur file but will reinstall software)
after reset, do the windows update (otherwise you`ll get a 0*80070652 error)
reinstall again! this will work for sure.
This usually happens due to Package Cache Folder absent in your local data.
Check the python log (from your installation window; where you see the error), scroll down to the end. After Restore Point Creation point log, you would find that it is unable to transfer file from local temp cache to this location C:\Users<>\AppData\local\Package Cache.
To isolate this, check if the path exists in your system or not? If not then please create the folder name Package Cache in local folder.
Once you do, you would notice that fodler is populated with some temporary downloads.
Reinstall the python package. This time it will install.
I had the same issue in my organization where I was using VDI. The folder was not present there and thats why everytime it comes to that point, it was failing.
I was able to fix the issue.
Perhaps try running with explicit admin rights.
Right click on executable -> Run as administrator.
Although the description for the error code you mentioned is here:
https://answers.microsoft.com/en-us/windows/forum/all/windows-update-error-0x80070005-need-a-fix-click/e4cb8700-f215-4f1a-8bd4-6457ac619c19
Apparently I had this same issue on my Windows 7 Machine.
The solution for me was to go to C:\User\"Username"\AppData and then Rightclick > properties on the "Local" folder and and "allow permissions" for everyone.
Strict Windows firewall settings will still cause the 0x80070005 error even with automatic updates. In my case that was the issue and the source of error. I had to disable the firewall. Opening the firewall settings revealed that my antivirus was controlling my firewall settings. In this case you would need to open your antivirus and disable the firewall from there.
Here's a link that helped me figure this out. Skip all the steps (they didn't work for me) before the part about disabling the firewall.
Hope this helps!
The log from the installation shows that it tries to use a directory in the home directory (namely: C:\Users\<uname>\AppData\Local\Package Cache\; if not present create the folder) which the installer has somehow no permission for.
Allowing everyone (note: probably something less permissive would be a good idea) to access this folder does the trick:
I am trying to use PostgreSQL on Ubuntu. I installed it and everything was working fine. However, I needed to change the location of my database due to space constraints so I tried an online guide to do it.
I proceeded to stop postgresql, create a new empty directory and give it permissions by using
chown postgres:postgres /my/dir/path
That worked fine too. Then I used
initdb -D /my/dir/path
to enable my database. I also changed the path_data in the postgresql.conf file to my new directory.
When I now try to start the database, it says: The postgresql server failed to start, please check the log file. However, there is no log file! Something got screwed up when I changed the default directory. How do I fix this?
First: You may find it easier to manage your Pg installs on Ubuntu using the custom tools Ubuntu provides as part of pg_wrapper: pg_createcluster, pg_dropcluster, pg_ctlcluster etc. These integrate with the Ubuntu startup scripts and move the configuration to /etc/postgresql/ where Ubuntu likes to keep it, instead of the PostgreSQL default of in the datadir. To move where the actual files are stored, use a symbolic link (see below).
When you have a problem, how are you starting PostgreSQL?
If you're starting it via pg_ctl it should work fine because you have to specify the data directory location. If you're using your distro package scripts, though, they don't know you've moved the data directory.
On Ubuntu, you will need to change configuration in /etc/postgresql to tell the scripts where the data dir is, probably pg_ctl.conf or start.conf for the appropriate version. I'm not sure of the specifics as I've never needed to do it. This is why:
There's a better way, though. Use a symbolic link from your old datadir location to the new one. PostgreSQL and the setup scripts will happily follow it and you won't have to change any configuration.
cd /var/lib/postgresql/9.1/main
mv main main.old
ln -s /new/datadir/location main
I'm guessing "9.1" because you didn't give your Ubuntu version or your PostgreSQL version.
An alternative is to use mount -o bind to map your new datadir location into the old place, so nothing notices the difference. Then add the bind mount to /etc/fstab to make it persistent across reboots. You only need to do that if one of the tools doesn't like the symbolic link approach. I don't think that'll be an issue with pg_wrapper etc.
You should also note that since you've used initdb manually, your new datadir will have its configuration directly inside the datadir, not in /etc/postgresql/.
It's way easier if you just use the Ubuntu cluster management scripts instead.
I get the error in question when I attempt to create a project. I followed the instructions found at how to install python an django in windows vista.
Also make sure that you have permission to access all of django's files. I've seen these kinds of errors happen because of permissions issues before.
EDIT: I haven't tried it out, but there's a link on that page to Instant Django, which looks like a pretty easy to set up.
You can get around this problem by providing the full path to your django-admin.py file
python c:\python25\scripts\django-admin.py startproject mysite
Most likely you don't have Django on your Python path. To test, quickly fire up Python and run:
>>> import django
If that fails, it's just a matter of getting Django onto your Python path. Either you set the environment variable, or you move django into your python2x/Lib/site-packages directory. If it does work, try importing core. If that fails there, then something is probably wrong with your Django install.
From your command line (cmd) run "ftype Python.File" and make sure that your .py files are being executed by the correct version/installation of Python.
It's possible another application has surreptitiously changed this under the hood.