urda / django-letsencrypt Goto Github PK
View Code? Open in Web Editor NEWA simple Django app to handle Let's Encrypt ACME challenges
Home Page: https://pypi.org/project/django-letsencrypt/
License: Apache License 2.0
A simple Django app to handle Let's Encrypt ACME challenges
Home Page: https://pypi.org/project/django-letsencrypt/
License: Apache License 2.0
This is a question rather than a bug. We are hosting multiple domains from our website. If I understand correctly, our app needs to generate challenge / response tokens (or manually through the backend) so that letsencrypt can validate. How does one go about requesting the certificate? Via the commandline tool? I would like to think there is an automated way of generating and renewing these through Django somehow.
It's time to sync the following versions with their latest release:
1.8.x
1.10.x
1.11.x
The Django
project will be ending 1.9
support in April 2017 and releasing 1.11 LTS
. It may be in the project's best interest to have the 2.x
release support those versions going forward. Basically, 2.x
will not support the Django 1.9
releases. Since a 2.x
release is around the corner, now would be a great time to plan for dropping it.
Instead of standing up a virtualenv
and configuring a local environment just to checkout the example_project
, it may be worthwhile to investigate moving to a docker
based solution.
This project needs one.
When following the installation instructions on pypi and using Gunicorn to run my Django app, my urls.py
reference to letsencrypt.urls
fails.
Having a look at __init__py
, this line seems strange
sys.modules['letsencrypt'] = certbot
I haven't been able to make sense of this. Since certbot is installed as a dependency, the certbot
binary is available in the pip context on the command line. So now, letsencrypt
and certbot
point to the same module as far as sys
is concerned.
As a result, it seems that Gunicorn picks up letsencrypt
as certbot
and can't find a urls
module linked to the letsencrypt
package. So, it's failing the import.
Why set the letsencrypt sys.module
equal to certbot? Wouldn't it be better just to leave it as is and have people access certbot
directly?
I am getting:
Applying letsencrypt.0001_squashed_0004_squash_for_mysql_support...Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 204, in handle
fake_initial=fake_initial,
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 115, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/migration.py", line 129, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/usr/local/lib/python2.7/site-packages/django/db/migrations/operations/models.py", line 97, in database_forwards
schema_editor.create_model(model)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 303, in create_model
self.execute(sql, params or None)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 120, in execute
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 80, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 114, in execute
return real_execute(self, sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 63, in execute
return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "letsencrypt_acmechallenge" already exists
Any way to fix it without reapplying all migrations?
Admin interface seems working now. But how to configure it?
CMD:
sudo letsencrypt certonly -a webroot --webroot-path=/var/www/html -d example.net -d www.example.net -d ins.example.net
console print
IMPORTANT NOTES:
The following errors were reported by the server:
Domain: www.example.net
<title>Page not"
Type: unauthorized
Detail: Invalid response from
http://www.example.net/.well-known/acme-challenge/j7IoGk-28pxqO1Jwj7NX2ILcaBRg_VHsP4X5t3invMM:
"Domain: ins.doask.net
<title>Page not"
Type: unauthorized
Detail: Invalid response from
http://ins.example.net/.well-known/acme-challenge/wbey1tDSg1K09qsfLYLTIhLuE09jqlC_qmJkY6vfx5w:
"Domain: doask.net
<title>Page not"
Type: unauthorized
Detail: Invalid response from
http://example.net/.well-known/acme-challenge/KYgmodeitfS769zHRLy018JfFYw5e2i07qGMm9dwBUY:
"To fix these errors, please make sure that your domain name was
entered correctly and the DNS A record(s) for that domain
contain(s) the right IP address.
It looks like Pypi might support Markdown! If so, let's switch to it.
The numbered steps are "restarting" over on PyPi, but look ok here on GitHub. This should be corrected for documentation purposes.
Currently, we link to https://letsencrypt.github.io/acme-spec/
in README.rst
, but that displays the following when opened:
NOTE: This Repository is Deprecated
This repository is not active and does not accurately reflect what Let's Encrypt currently implements. It's retained only for history.
All new work happens here: https://github.com/ietf-wg-acme/acme/
The README
file should be updated in reference to this notice.
Thank you to @michaelfrance for reporting this issue.
The project should sync with the current Django roadmap and make sure the latest versions are being targeted as expected.
Looks like we need to see about moving from TextField
to CharField
on the model.
Strategy to deal with this:
mysql
as an allowed failure (PR #9)mysql
(PR #10):
primary key
columnmysql
testing (PR #10)Creating test database for alias 'default'...
Traceback (most recent call last):
File "runtests.py", line 72, in <module>
failures = test_runner.run_tests(['letsencrypt'])
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/test/runner.py", line 210, in run_tests
old_config = self.setup_databases()
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/test/runner.py", line 166, in setup_databases
**kwargs
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/test/runner.py", line 370, in setup_databases
serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True),
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/backends/base/creation.py", line 368, in create_test_db
test_flush=not keepdb,
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/core/management/__init__.py", line 120, in call_command
return command.execute(*args, **defaults)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 222, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/migrations/executor.py", line 110, in migrate
self.apply_migration(states[migration], migration, fake=fake, fake_initial=fake_initial)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/migrations/executor.py", line 148, in apply_migration
state = migration.apply(state, schema_editor)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/migrations/migration.py", line 115, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/migrations/operations/fields.py", line 201, in database_forwards
schema_editor.alter_field(from_model, from_field, to_field)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 484, in alter_field
old_db_params, new_db_params, strict)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 665, in _alter_field
self.execute(self._create_unique_sql(model, [new_field.column]))
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 111, in execute
cursor.execute(sql, params)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 124, in execute
return self.cursor.execute(query, args)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/MySQLdb/cursors.py", line 250, in execute
self.errorhandler(self, exc, value)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/MySQLdb/connections.py", line 42, in defaulterrorhandler
raise errorvalue
django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'challenge' used in key specification without a key length")
Django 3.0 came out, and this project needs to sync up with versions and verify things are still working as expected.
I'll be using this issue to track the overall progress of this task.
As shown in PR #68 , a coverage drop wasn't marked as a build failure. I need to investigate configuring Codecov to fail any loss of test coverage automatically.
This issue will serve as the common issue for the sync and housekeeping for the year 2020 here.
what's my next step? I am not able to get the ssl certification.. I followed the directives but it's incomplete and there's no example...
django-letsencrypt forces django to update when installing. Can you set a minimum requirement?
This project will be dropping support for python 2
sometime soon. This will result in a "version bump" of the project, with support for python 2
removed.
Support for python 3.7
should be verified and added to the project.
Once issue #10 is rounded off, we will want to make sure that our database types are actually being tested (object CRUD basically).
The Django
project will be releasing 1.11 LTS
in April of 2017. It is in the project's best interest to have the 2.x
release support this new version, regardless if 1.9
support is dropped in the project.
Starting with django-letsencrypt version 2.0.0, a pip install fails where version 1.1.1 doesn't fail
OS : Linux version 3.16.0-4-amd64 ([email protected]) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19)
Error:
ValueError: ("Expected ',' or end-of-list in", 'Django >=1.8.18,!=1.9.', 'at', '')
This is on a fresh VM with python 2.7 and Django 1.11.7 installed immediately prior
How this really works? I mean I don't see anything related to letsencrypt inside admin.
Django 1.11
UPDATE:
I did migrate and got this -
Operations to perform:
Apply all migrations: admin, auth, contenttypes, letsencrypt, sessions
Running migrations:
Applying letsencrypt.0001_squashed_0004_squash_for_mysql_support... OK
Does it work with postgresql?
How can i get ACME challenge objects?
BR Hexxter
RuntimeError at /admin/
Model class letsencrypt.models.AcmeChallenge doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Hello How to fix it, I can't login admin
It's time to sync pytz
to the following:
During work on PR #59 , it was discovered that the make test
that is ran locally on a developer's machine will never report full coverage due to a recent import change required in Django 2.0.
It looks like it is time to start using / integrate tox
into the project to handle all the different Django and python versions that Travis CI is targeting.
MultipleObjectsReturned at /.well-known/acme-challenge/CHALLENGE_TEXT
get() returned more than one AcmeChallenge -- it returned 2!
I'm trying to set this up and I'm able to find the challenge but unable to find the proper response to use. Where can I find the response? I'm using acme V2
With the release of Django 2.2, Django 2.1 has reached the end of mainstream support. The final minor bug fix release, 2.1.8, was issued today. Django 2.1 will receive security and data loss fixes until December 2019. All users are encouraged to upgrade before then to continue receiving fixes for security issues.
See also: Django 2.2 released @ djangoproject.com.
With the release of Django 2.2, Django 2.1 has reached the end of mainstream support. The final minor bug fix release, 2.1.8, was issued today. Django 2.1 will receive security and data loss fixes until December 2019. All users are encouraged to upgrade before then to continue receiving fixes for security issues.
I'm losing confidence in Travis CI. Considering moving to another host (like CricleCI)
See also:
Good lord 2020 is awful isn't it?
I've got a list of housekeeping, build changes, and updates to do. Taking this odd time in history to close those linger issues, and start a re-plan.
Once I have work in motion on that, I'll close this out.
Installed according to directions and still got a 404
Ubuntu20, Apahce2, Django 3.1.4
Third-party library support for older version of Django
Following the release of Django 3.0, we suggest that third-party app authors drop support for all versions of Django prior to 2.2. At that time, you should be able to run your package’s tests using python -Wd so that deprecation warnings appear. After making the deprecation warning fixes, your app should be compatible with Django 3.0.
https://pypi.org/project/pytz/#history
Just released this month: 2018.4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.