-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #48
base: master
Are you sure you want to change the base?
Dev #48
Conversation
changed SEKRET_KEY to a more complex version
Added models and database settings
add custom error pages
…ure/speech_synthesis
added base template
Feature/speech synthesis
…nto feature/rss # Conflicts: # app/__init__.py # app/templates/base.html # config.py
Feature/rss
Feature/speech synthesis
…nto feature/rss # Conflicts: # app/rss.py # app/templates/base.html # config.py
Feature/rss
…nto feature/rss # Conflicts: # app/templates/base.html
Feature/rss
Fix route in edit_joke
| COPY . . | ||
| # Finally, we run uWSGI with the ini file we | ||
| # created earlier | ||
| CMD [ "uwsgi", "--ini", "app.ini" ] No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line at end of file
| RUN rm /etc/nginx/conf.d/default.conf | ||
| # We copy the requirements file in order to install | ||
| # Python dependencies | ||
| COPY app.conf /etc/nginx/conf.d No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line at end of file
| include uwsgi_params; | ||
| uwsgi_pass flask:5000; | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line at end of file
| ; then expose on our Dockerfile | ||
| socket = 0.0.0.0:5000 | ||
| vacuum = true | ||
| die-on-term = true No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line at end of file
| class EpisodeUploadForm(FlaskForm): | ||
| file = FileField('Upload podcast', validators=[ | ||
| FileRequired(), | ||
| FileAllowed(['mp3'], "Wrong format! Only mp3 format audio files") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use different quotes style?
| @@ -0,0 +1 @@ | |||
| # Here will be tests | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are tests? :)
| @@ -0,0 +1,49 @@ | |||
| # Config Classes | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless comment
| @@ -0,0 +1 @@ | |||
| Generic single-database configuration. No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line at end of file
| test_audio_path = os.path.join( | ||
| script_path, | ||
| "tests", | ||
| "test_data", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use one quote style (single quotes)
| test_audio_path = os.path.join( | ||
| script_path, | ||
| "tests", | ||
| "test_data", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use one quote style (single quotes)
| # Spyder project settings | ||
| .spyderproject | ||
| .spyproject | ||
| yandex_tokens.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we using yandex tokens in the final version?
|
|
||
| # audio files: | ||
| app/media/ | ||
| media/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a great idea to store files created by your code in the same directories as the code itself
| @@ -0,0 +1,24 @@ | |||
| # We simply inherit the Python 3 image. This image does | |||
| # not particularly care what OS runs underneath | |||
| FROM python:3 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use a ready-made flask image?
| flask db migrate | ||
| flask db upgrade | ||
|
|
||
| flask run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flask run is only good enough for development. More on this https://flask.palletsprojects.com/en/1.1.x/tutorial/deploy/#run-with-a-production-server
| 12. Frontend: Bootsrap + jinja | ||
| ## Eriwan | ||
| ------------- | ||
| Web servis for public podcast creation where each user can add episodes and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling. I will only make this comment once about human-readable content here, though spelling is not great across the board. Spelling is very important. Misspelled words will not be found by search, making navigation in your code, comments and documentation very difficult.
| assert p.explicit | ||
| assert p.description == 'Eriwan_Podcast' | ||
| assert p.website == 'localhost' | ||
| assert p.file.name == 'feed_template.xml' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would you test a constant?
| MAX_CONTENT_LENGTH = 20 * 1024 * 1024 | ||
| UPLOAD_PODCAST_FOLDER = 'episodes' | ||
|
|
||
| DROPZONE_DEFAULT_MESSAGE = 'Перетащите аудио файл в эту зону для загрузки' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there is a concept of detached string literals in the application, it is just not used consistently across the application.
|
|
||
| HOST = os.environ.get('HOST', 'localhost:5000') | ||
|
|
||
| MAX_CONTENT_LENGTH = 20 * 1024 * 1024 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic happens here!
| @@ -0,0 +1,96 @@ | |||
| from __future__ import with_statement | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and in some other places: is it actually necessary to have foreign code in our repo? Is there a better way of handling this?
|
|
||
|
|
||
| def test_concatenate_audios(): | ||
| script_path = path.abspath(path.join(os.getcwd())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not guaranteed to be writeable
| @@ -0,0 +1,15 @@ | |||
| # Handle route and server exceptions | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless comment
| Return wrapped in jingles file path | ||
| ''' | ||
| media_path = os.path.join(app.config.get('MEDIA_ROOT'), 'episodes') | ||
| file_path = f'{media_path}/{self.id}.mp3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To everybody: Pay attention to this problem! Use os.path.join ONLY for string concatenating!!!!!!!
No description provided.