I am new to ColdFusion 10 and I want to run it on localhost, so I download it and install it and done successfully. Now I want to create file and want to check by running it.
For example my file name is test.cfm so how to run it on localhost and in which folder i should save this file. I have Installed CF 10 in D directory.
D directory
|__ ColdFusion10
Kindly someone tell me how to do it. I dont find any solution, I find solution that use CF Builder but I dont want to install builder.
Please guide me.
Here is your answer
Here is complete structure that will help you to understand
D directory
|__ ColdFusion10
|__cfusion
|__wwwroot
|__ test.cfm
basically you will put your files in wwwroot folder.
hope you will now understand
Related
I am trying to deploy my Djago app on AWS Lightsail.
When I try to login/register, I am getting this error:
Attempt to write a readonly database
I have been googling solutions for quite some time and have tried setting different permissions, even giving away all permissions which might be huge security risk, however it still doesn't work.
Could anyone help me.
check that your file is owned by bitnami:bitnami. (I've been having the same exact issue and yours and i havent been able to fix it either)
So, in case someone else has this problem, what should work and what worked for me:
I moved db.sqlite3 file to one folder outside of main project dir.
Then I changed address to this file in settings.py to os.path.join(BASE_DIR, '..', 'db.sqlite3')
Though I feel like it's really a problem of user permissions, but that's above my current skill level.
I found another solution that worked for me.
See: https://github.com/mchesler613/django_adventures/blob/main/deploy_django_aws_bitnami.md
Author goes into detail about the details behind the error.
See "Error: Attempt to write a readonly database"
Change group ownership of the project root directory and the database file to daemon. For example:
$ sudo chgrp daemon project_directory project_directory/database_file
Make the project root directory and the database file writable by the daemon group. For example:
$ sudo chmod g+w project_directory project_directory/database_file
To see if the database error goes away, try reloading the Django app on the browser.
I had the same problem. Changing db.sqlite3 mode to writable doesn't work for me. I can use django shell to add data to db.sqlite3 but from apache2, it doesn't work.
Finally, I changed owner of the directory where db.sqlite3 locates to www-data:www-data, and it worked.
We are facing a very weird issue. We ship a django application in a docker container through Github Actions on each push. Everything is working fine except collectstatic.
We have the following lines at the end of our CD github action:
docker exec container_name python manage.py migrate --noinput
docker exec container_name python manage.py collectstatic --noinput
migrate works perfectly fine, but collectstatic just keeps on waiting if ran through the github action. If I run the command directly on the server then it works just fine and completes with in few minutes.
Can someone please help me figuring out what could be the issue?
Thanks in advance.
Now I am far from the most experienced but I did this recently and I have some suggestions of where to look. I'm definitely not the greatest authority though.
I wasn't using docker so I can't say anything about that. From the issues, I had here are some suggestions I can recommend to try.
Take note that all of this was for a self-hosted runner. Things would be very different otherwise.
Check to make sure STATIC_ROOT and MEDIA_ROOT variables are set correctly in the settings file.
If the STATIC and MEDIA root variables are environment variables make sure you are serving the correct environment variables file like a .env file which I used.
I used django-environ to serve my environment variables. From the docs, it says to have the .env file in the same directory as the settings file. Well if you are putting the project on a production server with github actions, you won't be able to put the .env file anywhere in the project because it will get overwritten every time new code is pushed.
So to fix that you need to specify the correct .env file from somewhere else on the server. Do that by specifying ENV_PATH.
https://django-environ.readthedocs.io/en/latest/
Under the section Multiple env files
Another resource that was helpful:
https://github.com/joke2k/django-environ/issues/143
I set up my settings file like how they did there.
I put my .env file in a proj directory I made in the virtualenvironment folder for the project.
I don't know if it's a good place to put it but that's how I did it. I didn't find much great info online for this stuff. Had to figure out a lot on my own.
Make sure the user which is running the github action has permissions to read the .env file.
Also like .env file, if you have the static files being collected into the base directory of your project you might have an issue with github actions overwriting those files every time new code is pushed. If you have a media directory where the user uploads files to then that will really be an issue because those files won't get overwritten. They'll just disappear.
Now if this was an issue it shouldn't cause github actions to just get stuck on the collect static command. It would just cause files to get overwritten every time the workflow runs and the media files will disappear.
If you do change the directory of where the static and media files are located as stated before, make sure all the variables for the paths are correct in the settings file and the .env file.
You will also need to update the nginx config file for the static and media root directories if you used nginx. Not sure about how apache does this.
You can do that with this command:
sudo nano /etc/nginx/sites-available/myproject
Don't forget to restart the nginx server after doing that.
If you are writing static and media files at a different location from the base project directory on the server, also check permissions on those directories. Make sure the user running the github action has permissions to write to those directories. I suspect that might cause it to hang but it very well might just cause an error.
Check all the syntax in the github actions yml file. Make sure everything is correct and it's not hanging cause it had an incomplete command or something like that.
But yeah, that's some things I had to take a look at. Honestly, none of this might be relevant for you. All of these issues should cause an error somewhere for the most part.
I couldn't really offer many external resources for you to look deeper into this because I'm just speaking from personal experience.
Hope I could help.
Heres my github repo for the project I did: https://github.com/pkudlanov/personal-portfolio-django
I hosted it on digitalocean on a linux server using nginx and gunicorn.
I want to enlable some PHP extentions in my custom PHP-Buildpack. But I don't know which one to edit... I tried to change the options.json in the "defaults" folder, but I get an error when I push the app via the cf command. And there is easily 20 other files named like that.
Can somebody help me to find the good one ? Thank you :)
The file has to be on the app folder, not in the buildpack folder. It has to be in a folder named ".bp-config" on the root of your app's directory.
Im trying to install django-registration-redux to my app and it work but I can't see where is the folder 'registration'.
It's really extrange, it work, but I need change the templates but I cant see where they are. Somebody can explain me where is the folder?
If you are using virtualenv you can find it in
path_to_virtual_env/lib/pythonx.x/site-packages/registration
or in /usr/local/lib/pythonx.x/dist-packages/registration if you are don't using virtualenv
I had the same problem.
I solved this by cutting the folder from the lib/site-packages/registration and added the registration folder under my-project folder.
it will me something similar to this:
my-project
app
registration
Make sure that you have registration added in your INSTALLED_APPS
This suppose to work since you have your set urls.py
Hi i am trying to host the django site using WSGI app.My project resides in /opt/labs and the contents of this are django/ labs_site/ content/ home/
labs_site was the initial project that was derived from startproject and from labs_site/urls.py i link to content,home and other modules
i have followed the documentation in https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/ till renaming labs_site/wsgi.py as os.environ.setdefault("DJANGO_SETTINGS_MODULE", "labs_site.settings")
So after this what is the next step that i should follow.I want to run the project without the runserver
modify your apache settings now. If setting up wsgi file was your first step, then next step should be modifying your apachee config to point towards that file.
The link you posted points towards this page: https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/
that has all the necessary information. You can just choose between putting all that into http.conf file or creating site file for it under sites-available & sites-enabled folders in /etc/apache.
After that - restart your apache server by /etc/init.d/apache2 or service apache2 restart - whichever works.
Then since its your first time, youll see some errors in your /var/log/apache2/error.log. Fix them... and try again :)
Good luck.