I have this little problem regarding to upload my existing django project to github repository.
This is my working directory and here my django code stays.
mjrulesamrat#mjrulesamrat-Lenovo-G570:~/django_mj/django_test$ ls -l
total 56
drwxrwxr-x 4 mjrulesamrat mjrulesamrat 4096 Aug 27 05:31 article
-rw-r--r-- 1 mjrulesamrat mjrulesamrat 34816 Aug 26 21:42 db.sqlite3
drwxrwxr-x 2 mjrulesamrat mjrulesamrat 4096 Aug 27 06:35 django_test
-rwxr-xr-x 1 mjrulesamrat mjrulesamrat 254 Aug 25 18:09 manage.py
-rw-rw-r-- 1 mjrulesamrat mjrulesamrat 0 Aug 27 06:46 README.md
drwxrwxr-x 4 mjrulesamrat mjrulesamrat 4096 Aug 27 05:35 static
drwxrwxr-x 2 mjrulesamrat mjrulesamrat 4096 Aug 27 05:33 templates
Now when i try to add or commit it says following msg.
mjrulesamrat#mjrulesamrat-Lenovo-G570:~/django_mj/django_test$ git add .
mjrulesamrat#mjrulesamrat-Lenovo-G570:~/django_mj/django_test$ git status
On branch master
nothing to commit, working directory clean
mjrulesamrat#mjrulesamrat-Lenovo-G570:~/django_mj/django_test$ git commit -m "app_commit_no_4"
On branch master
nothing to commit, working directory clean
mjrulesamrat#mjrulesamrat-Lenovo-G570:~/django_mj/django_test$
Please help me upload code to my repository.
to upload my code to github repository, I usually create my project on github first.
clone my project to my PC with git clone https://github.com/myusername/myproject.git
copy - paste to my code to cloned project.
run git add .
run git commit -am 'this is msg'
run git push origin master
First of all I have made changes on the remote repository.
That's why it was giving me error.
So, first i have to pull the changes from the remote repository and then i have to push the changes.
These are the commands that I followed.
I learned from my sir later.
git pull remote_repo
git add .
git status
git commit -m "message"
git push -u origin master
This works good till date.
Related
I am trying to deploy my Django project on a Bitnami server, but when I try to login through admin with my superuser i get the following error:
attempt to write a readonly database
Exception Location: /opt/bitnami/python/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py, line 413, in execute
I have the following permissions to my project files:
drwxrwxr-x 6 bitnami www-data 4096 Mar 12 08:01 .
drwxr-xr-x 3 bitnami root 4096 Mar 11 10:00 ..
drwxr-xr-x 2 bitnami bitnami 4096 Mar 11 11:48 conf
-rw-rw-r-- 1 bitnami www-data 147456 Mar 12 08:01 db.sqlite3
-rw-r--r-- 1 bitnami bitnami 287 Mar 11 13:29 .env
drwxr-xr-x 5 bitnami bitnami 4096 Mar 11 10:26 app
-rwxr-xr-x 1 bitnami bitnami 667 Mar 11 10:00 manage.py
drwxr-xr-x 3 bitnami bitnami 4096 Mar 11 13:52 django_project
drwxr-xr-x 5 bitnami bitnami 4096 Mar 11 10:26 users
and this to the project directory
drwxrwxr-x 6 bitnami www-data 4096 Mar 12 08:01 django_project
I tried to run the following to give permission but without luck:
sudo chown :www-data /opt/bitnami/projects/django_project/db.sqlite3
sudo chmod 664 /opt/bitnami/projects/django_project/db.sqlite3
sudo chown :www-data /opt/bitnami/projects/django_project/
sudo chmod 775 /opt/bitnami/projects/django_project/
Can you help me? :)
Bitnami developer here. You are setting the group to www-data. The Bitnami Apache user is "daemon".
I'm doing a installation on a Ubuntu machine (16.04 server) and I need to install the plugins for the Redmine platform (the lastest version). I installed Redmine using the official documentation: Install Redmine step by step on Ubuntu
The installation was successful but now I have to install some plugins but every time I try to install I get: plugin was not found.
Since I made everything as said in the documentation I have this folder structure:
var/www/html/redmine
-rw-r--r-- 1 root root 459 Mar 13 2016 404.html
-rw-r--r-- 1 root root 648 Mar 13 2016 500.html
-rwxr-xr-x 1 root root 473 Mar 13 2016 dispatch.fcgi
-rw-r--r-- 1 root root 7886 Mar 13 2016 favicon.ico
-rw-r--r-- 1 root root 43 Jul 13 12:07 Gemfile
-rw-r--r-- 1 root root 143 Jul 13 12:07 Gemfile.lock
drwxr-xr-x 51 root root 4096 Jul 12 16:11 help
drwxr-xr-x 4 root root 4096 Jul 12 16:12 images
drwxr-xr-x 4 root root 4096 Jul 12 16:12 javascripts
drwxr-xr-x 2 root root 4096 Jul 12 16:12 plugin_assets
drwxrwxrwx 4 root root 4096 Jul 19 17:30 plugins
lrwxrwxrwx 1 root root 25 Jul 19 18:37 public -> /usr/share/redmine/public
drwxr-xr-x 9 root root 4096 Jul 13 10:02 redmine_agile
drwxr-xr-x 3 root root 4096 Jul 12 16:12 stylesheets
drwxr-xr-x 5 root root 4096 Jul 12 18:05 themes
To install the plugins I follow this tutorial: Install plugin. I use this command: bundle install --without development test --no-deployment on /var/www/html and everything is ok. But then I need to use bundle exec rake redmine:plugins NAME=redmine_checklists RAILS_ENV=production (in the same location as the previous command) and I get plugin was not found
Things I already tried:
Use Redmine last version
update bundler
execute rake on Redmine root
update all gems
set the right permissions on the plugins folders
and nothing seems to work.
bundle exec rake redmine:plugins:migrate RAILS_ENV=production NAME="YOUR_PLUGIN_NAME" in the root_app folder
Running the django tutorial for docker compose, but the command to init the django project is not working as expected.
$ docker-compose run web django-admin.py startproject composeexample .
[31mERROR[0m: Interactive mode is not yet supported on Windows.
Please pass the -d flag when using `docker-compose run`.
In windows "interactive" mode is not supported so I modified the command to run in "detached" mode.
$ docker-compose run -d web django-admin.py startproject composeexample .
Creating network "djangotest_default" with the default driver
...
Successfully built 0fb90648c1d8
[33mWARNING[0m: Image for service web was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
djangotest_web_run_1
This seems to create the boxes.. but my current directory shows no new files (from the django-admin command).
$ ls
docker-compose.yml Dockerfile requirements.txt
How do I get the container output to sync with the current working directory as expected?
The fix was to uninstall Windows 10 and install a *nix system. The files then appear as per the tutorial.
~/docker/django-test $ ll
total 60
drwxr-xr-x 4096 Sep 24 00:47 ./
drwxr-xr-x 4096 Sep 24 00:40 ../
drwxr-xr-x 4096 Sep 24 00:47 composeexample/
-rw-r--r-- 209 Sep 24 00:41 docker-compose.yml
-rw-r--r-- 146 Sep 24 00:41 Dockerfile
-rwxr-xr-x 812 Sep 24 00:47 manage.py*
-rw-r--r-- 16 Sep 24 00:41 requirements.txt
I have three directories(farmio,farmio-table,farmio-table-throttle) in apps directory of AWS-Centos server under username ec2-user, every time I do a ls -la I see two folders(farmio-table,farmio-table-throttle) accessed frequently and the pid file stored inside the folder are wiped out for which my java programs doesn't execute properly.
[ec2-user#ip-10-94-221-19 apps]$ ls -la
total 49036
drwxrwxr-x 5 ec2-user root 4096 Nov 7 09:39 .
drwxrwxr-x 3 ec2-user root 4096 May 29 12:20 ..
-rw-rw-r-- 1 ec2-user ec2-user 29 Nov 6 06:26 date.txt
drwxrwxr-x 4 ec2-user ec2-user 4096 Nov 6 06:42 farmio
drwxrwxrwx 7 ec2-user ec2-user 4096 Nov 7 2015 farmio-table
-rw-r----- 1 ec2-user ec2-user 25090806 Nov 7 09:43 farmio-table-bin.zip
drwxrwxrwx 7 ec2-user ec2-user 4096 Nov 7 2015 farmio-table-throttle
-rw-r----- 1 ec2-user ec2-user 25092514 Nov 7 09:39 farmio-table-throttle-bin.zip
Every time I try to check the folders are changed or replaced after five minutes.
Is there any way I could know which user and which command is executed in this directory so that its files are replaced/modified in Centos.
Use command history to check all the previously run commands.
$ history
If I download fossil v1.23 to my linux server, everything goes fine.
root#x:/home/james/test# unzip fossil-linux-x86-20120808112557.zip
Archive: fossil-linux-x86-20120808112557 (1).zip
inflating: fossil
root#x:/home/james/test# mv fossil fossil_1_23
root#x:/home/james/test# chmod 777 fossil_1_23
root#x:/home/james/test# ./fossil_1_23 help
Usage: ./fossil_1_23 help COMMAND
Common COMMANDs: (use "./fossil_1_23 help --all" for a complete list)
add clean gdiff mv rm timeline
addremove clone help open settings ui
all commit import pull sqlite3 undo
annotate diff info push stash update
bisect export init rebuild status version
branch extras ls remote-url sync
changes finfo merge revert tag
This is fossil version 1.23 [957b17af58] 2012-08-08 11:25:57 UTC
But 1.24 fails, with 'No such file' even though a ls command shows the file is present, like this:
root#x:/home/james/test# unzip fossil-linux-x86-20121022124804.zip
Archive: fossil-linux-x86-20121022124804.zip
inflating: fossil
oot#x:/home/james/test# mv fossil fossil_1_24
root#x:/home/james/test# chmod 777 fossil_1_24
root#x:/home/james/test# ls -l
total 3620
-rw-r--r-- 1 root root 528859 Oct 24 10:04 fossil-linux-x86-20120808112557.zip
-rw-r--r-- 1 root root 670298 Oct 24 10:04 fossil-linux-x86-20121022124804.zip
-rwxrwxrwx 1 root root 1061584 Aug 11 10:30 fossil_1_23
-rwxrwxrwx 1 root root 1418656 Oct 22 09:16 fossil_1_24
root#x:/home/james/test# ./fossil_1_24 help
-bash: ./fossil_1_24: No such file or directory
Richard Hipp rebuilt the 1.24 linux binary. The new version works fine.