Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ New tutorial - "Deploy Django with Nginx and S3 Storage" #1072

Merged
merged 5 commits into from
Feb 17, 2025

Conversation

leaked
Copy link
Contributor

@leaked leaked commented Feb 5, 2025

I have read and understood the Contributor's Certificate of Origin available at the end of
https://raw.githubusercontent.com/hetzneronline/community-content/master/tutorial-template.md
and I hereby certify that I meet the contribution criteria described in it.
Signed-off-by: Mohsen Nasiri [email protected]

@svenja11 svenja11 added the review wanted Request a review label Feb 6, 2025
@svenja11
Copy link
Collaborator

Thank you for your contribution @leaked

I just tested the tutorial and I got up to step 3:

(venv) holu@example-tutorial:~/django_project$ python manage.py collectstatic --noinput
Unknown command: 'collectstatic'
Type 'manage.py help' for usage.

Could you please look into this?

@svenja11 svenja11 added needs action Something has to be updated and removed review wanted Request a review labels Feb 13, 2025
- Add 'django.contrib.staticfiles' to INSTALLED_APPS
- Create static directory for collecting static files
@leaked
Copy link
Contributor Author

leaked commented Feb 13, 2025

Thank you for your contribution @leaked

I just tested the tutorial and I got up to step 3:

(venv) holu@example-tutorial:~/django_project$ python manage.py collectstatic --noinput
Unknown command: 'collectstatic'
Type 'manage.py help' for usage.

Could you please look into this?

Hi

I think the problem was coming from the missing django.contrib.staticfiles app. I've added it now.
can you please check if this fixes the issue?

@svenja11
Copy link
Collaborator

Yes this helped, thank you. I now made it all the way to step 7. In step 7 I had to add "upload" in myproject/settings.py to make it work:

INSTALLED_APPS = [
    [...]
    'upload',

Step 8 didn't work for me at all. When I access http://<my-server-ip>/admin, I have to login. After login, I get this error:

OperationalError at /admin/login/
attempt to write a readonly database

Request Method:      POST
Request URL:         http://<my-server-ip>/admin/login/?next=/admin/
Django Version:      5.1.6
Exception Type:      OperationalError
Exception Value:     attempt to write a readonly database
Exception Location:  /home/holu/django_project/venv/lib/python3.12/site-packages/django/db/backends/sqlite3/base.py, line 354, in execute
Raised during:       django.contrib.admin.sites.login
Python Executable:   /home/holu/django_project/venv/bin/python3
Python Version:      3.12.3
Python Path:         ['/home/holu/django_project', 
                      '/home/holu/django_project/venv/bin', 
                      '/usr/lib/python312.zip', 
                      '/usr/lib/python3.12', 
                      '/usr/lib/python3.12/lib-dynload',
                      '/home/holu/django_project/venv/lib/python3.12/site-packages']

Could you please look into this too?

@leaked
Copy link
Contributor Author

leaked commented Feb 14, 2025

Step 8 didn't work for me at all. When I access http://<my-server-ip>/admin, I have to login. After login, I get this error:

Hi

I've added some permission-related troubleshooting steps to the documentation. This should help users who run into the common "readonly database" or permission issues during deployment.

@svenja11 svenja11 added ready and removed needs action Something has to be updated labels Feb 17, 2025
@svenja11 svenja11 merged commit f57b5ac into hetzneronline:master Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants